Archive for the ‘Android’ Category

Android UI problem

Android Kitkat has very confusing UI. Actually, Android UI has been like this so far.


There is a ‘turn around’ button on the bottom. it means “Go back”.
However, on top of the screen there is also ‘<‘ button. Usually there was so-called a hamburger button.

Both means “Go back”. However, there is difference where it goes back. The bottom one goes back to its immediate previous screen, while the top one goes way back to a list screen.
Probably from there different view controller was spawned ( if using iOS terminology )

Isn’t it confusing?

Can’t Android Studio 1.0.1 find your JDK?

Well, as usual, I tried the latest Android toolset again.
I’ve used Eclipse with ADT so far and tried Android Studio a while ago.

However, it looks to me that Google put Android Studio in front of Eclipse.
That sounds like Android Studio is good enough to use. So, I decided to try it.
(Although I’ve used Eclipse for long time, I don’t like it. People who say Eclipse in favor say so because Eclipse has many good features. However, how to glue all of them is not good with Eclipse. Eclipse is all-round tool. I’ve used it with some VHDL open source compiler, have used for long time for C/C++ project on Linux and for Makefile analyzer on Windows. Because it has all functionality with help of plugins, it’s not good at anything. (each functionality is the best. But again, how to glue them are not good. If you don’t understand what I’m saying, try to open some sample project for Android. What’s weird is that you need to choose “Create” for opening a project. )

Anyway.. again.. I’m disappointed with Android Studio in terms of the 1st experience.
It couldn’t find where the latest JDK was installed and couldn’t find its matching VM.
Well, JDK is made by Sun/Oracle. So, there is such discrepancy. However, at least, Google people could make some “Read Me First” popping up after being installed and guide a user to configure any further setup.
However, it just displayed “Can’t find a matching VM.”

Ok.. I know that many GUI programs print out something when being launched from a terminal. So, I did it. It complaint that STUDIO_JDK environment variable is empty. Hmm.. it looks like it should point to where JDK is installed. But shouldn’t it be JAVA_HOME? After looking up Google, some said it could be solved by setting JAVA_HOME. But no luck. It may have been true with older Android Studio. (Well, currently one is 1.0.1 version, though.) So, I directly set up STUDIO_JDK from console like this.

export STUDIO_JDK=/Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk

And launched with : open /Applications/Android\ Studio.app

It worked!

Hey.. Google people! Why don’t you guys make the 1st experience with Android Studio better? You have some competition ( from MS with Visual Studio 2015, although theirs is based on Mono. )

c.f. http://tools.android.com/tech-docs/configuration/osx-jdk

One step closer to native coding on Android platform?

There is a native ‘activity’ class. So, using it, it’s said that it’s possible to develop native ‘activity’ code.

Take a look and read doc about it!

Switching to Android from iPhone

( should not be too much shocked. I, anyway, have another iOS device, iPod Touch with 4 inch screen. )

약 25불에 스맛폰 껍데기를 사는 건, 1 센트짜리 Moto X에겐 배보다 배꼽이 더 큰 억울한 경우지만.. 그래도 이번에 Android로 바꾼다.

{ Well.. the power button of my iPhone 4 is not clickable any more. I can still use it, and iOS wakes the device up even after discharged and turned off for itself.  However, it’s time to upgrade the old 3G iPhone 4, and Moto X costs just 1 cent. — I’m so glad! A few weeks ago, I tried to switch to Moto X, but it costed ~$45. If hidden cost is added up, then it became $100 easily. But 1 cent for Moto X is good deal. Well.. Motorola Mobility is gone and absorbed by Lenovo. Probably why they are liquidating the fairly new Moto X this quickly is that probably the new leaders at Lenovo may have different plan and don’t want to support old Moto-Google device. They may introduce devices of their own design. How different can they be is different issue. However, if the doomed H/W manufacturer made the device on some standard like how the PCs are, I think there is no problem in installing any new Android OS on it. Anyway, migration to new OS on Android world is not as quick as how it is on iOS worldAlthough this guy says it’s pretty quick to adopt new Androids…
Well, the adoption rate for the latest and the 2nd from the latest in Android market is pretty good. Being faster to newer whatever is not necessarily good always. As far as I  remember ( yes! I have monitored Android market and its SDKs since its introduction ), the Jelly Bean adoption ratio was not this much several months ago.
Anyway, I have strong feeling that the reason people adopt even faster on iOS devices are.. they are usually enthusiastic on their Apple technology and I noticed that many old things were broken and deprecated quickly especially in iOS 7. So, as a developer, I would adopt iOS 7 very quickly also if I work on iOS project at work or home. I left Panascout behind though.

So.. what all of that says is that Moto X will have good life span, not just as a functioning device but also in terms of S/W support. I know that smartphone engineering is different from PCs. So, the H/W manufacturer would end up provide some glue layer between Android and its underlying H/W, because the H/W components can be different from vendors. But they are mostly now commodity. They may end up using different address space, though… So.. anyway..
}

어차피 iOS 장비는 iPod Touch가 있으니.. (이것도 회사일 하기 위해서, 회사에 요청하다가 안들어주고 fix만 요구하기에 내 돈주고 산거).. 더군다나 이제 새 iOS 프로젝트는( 맡게 될지 자체를 모르겠지만) 4인치 이상에서 시작할거고, 3.5인치도 제대로 view controller를 이용해서 할거기 때문에 그다지 필요치 않다.

애플이 미국 시장에서 거의 45% 시장을 장악하는 기염을 토했지만, 안드로이드가 점점 좋아지는 이 시점에 (여전히 framework는 iOS에 비해 나쁘지만) 돈주고 멤버쉽에 가입해야만 장비에 내 테스트 프로그램을 올리는 (때때로 iOS 프로그램 만들고 싶은 아이디어가 떠올라 개념을 테스트하고 싶을때) 것 조차 못하게 하는.. 이런 황당한 상황에서 web app이 경우에 따라선 훌륭한 대안이 되겠지만 역시 번들로 만들 경우엔..
그래서 안드로이드가 훌륭한 대안이 될 수있다는 생각.

이제부터 주말엔 공부 모드. 웹 앱쪽도 Cappucino와 Ember인지 Amber인지도 공부해볼 생각. Cappucino는 금방 익힐거 같고.. Amber도 그다지 어려울거로 보이지 않음. 어차피 DOM editing의 성질을 갖는 비효율적 JavaScript 기반 프로그래밍에 framework로 감싸서 마치 네이티브 개발의 스타일을 적용하는거라… 그래도 JavaScript 지식 다시 refresh하고, AJAX 쪽을 봐야겠지. 정확히 내 Web programming은 AJAX이전에서 끝나니.
(근데 HTML 3.x까진 그래도 좀 웹 프로그래밍에 관심이 있었는데, 그 후엔 영 없어졌으니. 마치 Java처럼. 처음엔 Java 굉장히 좋아했는데, 점점 이럴 거 왜 Java 쓰나 하는 생각. )

Agile 문서도 더 읽어볼 작정.
원래 S/W Engineering이란게 흔히 말하길 코에 걸면 코걸이 귀에 걸면 귀걸이라지만, 미국 사람들은 여기에 꽤나 목 메는거 같다.
그리고 자기네가 아는 용어가 마치 다인양 생각하기 때문에, 그걸 synch하기 위해서라도 읽어 두는게 좋겠다 생각.
( 왜.. 다른 것도 그렇지만 특히 이 AJAX는 사람들마다 쓰는 용어가 다 다르냐.. )

Objective-C for Android

Well, we have heard about many SDKs like C# for iOS, C# for Android, Java for iOS, etc.
However, comparably Objective-C/Cocoa for Android was less visible. Probably it’s because there are more Java programmers than Obj-C programmers.

However, it looks attractive, especially if you know how dirty, unelegant  different Android SDK is.along with Java.
Don’t get me wrong. I was huge fan of Java in early 1990s.

So, anyway, if any of you visiting my blog has interest in using your knowledge about Obj-C for Android, try taking a look at this.
https://www.madewithmarmalade.com/products/juice

Reply from Samsung and they lied again…

We would like to explain about the Galaxy S4 test which was claimed by some benchmark sites

OK.  They said..

Galaxy S4 is operated up to its max. performance, 533Mhz under general environment.

However, in full screen mode where “status bar” is hidden, some games which can be too much burden for long use is operated at 480Mhz.

However, S browser, Gallery, Camera, Video Player etc and apps requiring full screen mode and some benchmarking tools are operated in the environment where it can achieve its max performance.

We would like to say that it is not intentionally adjusted to increase benchmark score only for specific tools.

Samsung Electronics is doing its best to provide the optimal usage experience to our consumers and opens our ears to customers’ voice.

 

It’s very tricky. Actually the 3rd and 4th statements contradicts each other. On the 3rd sentence, they say for some benchmarking tools, the Galaxy S4 operates in its max performance, while on the 4th sentence, they say it’s not intentional. Huhhhhh? Can a device figure out if it’s a benchmark program? How can it operates in its max performance for such benchmarking program automatically without being said so?

Some guys figured out that it was intentionally tweaked for increasing benchmark speed.

The folks at AnandTech decided to investigate and found out that the phone does indeed let its GPU run at a higher frequency when particular benchmark software is running. They found a similar oddity with the CPU — it wasn’t restricted for other apps, but it was forced to run at max speed during benchmarks. Then they decided to look for direct evidence that this was intentional.

It is like to say, “I broke into a house through its window and took some jewelry, but I didn’t steal it.”

“If Samsung makes, it’s different!” Yes, you are!

That’s famous slogan in S.Korea.

I don’t like to write something which can be seen as disrespect something, but..

Samsung Busted Boosting International Galaxy S4 Benchmarks

When Android frameworks are compared with Win32…

Just my little thoughts on Android…

Currently, I’m reading “Fragments” class document. I found out that it was pretty hard to follow, because the terminology Android developers ( not application developers, but the framework developers ) chose didn’t help to make it “self documented code”.

If someone insists me to compare how bad Android APIs are compared to Win32, I would say this.

When I put my hands on ToolBox API and Win32 API about 20+ years ago, I thought Win32 was designed very poorly compared to ToolBox.How bad Android is compared to Cocoa is much worse than how bad Win32 was compared to ToolBox.

Because Google people elected many not-sound-natural terminology and method / class names, it prevents from writing self-documented code.

Why haven’t Android app developers pointed those out?
Probably aren’t they interested in framework and API design itself? They are just busy to spit out Android apps?

Compared how it was about 20 years ago, it’s pretty hard to find any technical article on S/W architecture design for platforms popular in the market nowadays. ( Well.. nowadays tech. writing is done by journalists not S/W engineers… )

On April, 17, 2013, at AllThings D conference, MS head of Windows phone said,

“With Android … it’s kind of a mess,”

Well, he said iPhone is boring. But.. anyway I think he is right about Android. ( and I also agree with him about iPhone. )
Some people would say to Terry Myerson, the head of Windows phone, “Do your own business” or “How dare! Your Windows phone is not as successful as iPhone or Android phone!”.
But whether his Windows phone is successful or not, ( so thus whether he deserves to say that or not ) I think he pointed out the critical point of Android ( and iOS )
Nowadays S/W business is driven more by marketing and business, not by technology. So, whether a platform is bad or not, if it gathers some popularity in the market, people tend to rush into it.
I’m really sorry about it.

 

Thoughts on naming for some concept

Well, I know that many S/W engineers don’t care about naming for some concept. But naming is very important because it speaks for itself about what it is for, for what you can use it, and so on.
Because well-named terminology helps smooth flowing or transitioning across multiple related concepts, naming well helps a framework easier to understand and reduces human errors in applying those features represented by those terminologies for.

I’ve written code for more than 20 years. So far, I put my hands on many technologies, languages and frameworks from different companies.
Borland, Symantec, Apple, MS, IBM, and many other open source project organizations to name the few. So, I’m qualified to compare them.
However, consistently, it was only Apple which was good at that. More interestingly, when a company put some proper naming for their classes, architecture etc, how to use them was also easy and overall architecture was more well defined and refined.
I think it’s not coincidental. Once one has rigid and clear idea on a target concept, one can name it properly and design its architecture clearly.

I remember that I wrote about MS’s awkward naming on some of their technology a while ago.
Today, I’d like to take an example from Google.

I made up my mind to take a look at Android SDK more deeply to be able to write actual code ( not just read and understand code ) for Android.
While doing that I ran into a few odd names for their classes and architecture.
“Activity” and “Intention” are good examples.
While working for many companies, I noticed that people just pick function/method names with “noun” form. Do you know what’s wrong about it?
Method and functions are for “doing” or “action”. So, it’s better to have “verb” form. While variables are good to be in “noun” form.
By doing so, code you write starts to be “self-explanatory” or “self-documented”. And it can reduce human mistake in writing code.
Now, let’s pick “Activity”. What kind of feeling you get?
Isn’t it something like, “it’s for DOING something” not “what it is”, or “being”.
So, if it is to mean “event handler” or “transition between views” or “collection of methods to be executed”, it’s easier to memorize the concept of “Activity” and to use the memorized concept.
However, in Android terminology, it’s more about “things to be presented visually.”
In other words, it’s “View” or “Window” on other frameworks.

For example, on Win32/MFC platform, you design a “Window” resource and it has a “View” internally. On Cocoa ( for iOS ) you design UIView. In other words, you put some buttons and text lables on an instance of a UIView. On Cocoa for Mac, you first put a Window and it has NSView in it just like that of Win32/MFC.
However, if you open “res > layout” folder of an Android project, there can be “Activity” xml files which describes those visual stuffs to be presented.
So, “Activity” is not about “action” between views or windows, or action/event handlers.
Well, Google people can defend this like.. “Well, things are happening on a pane presented as view. So, we see a View as a playground on which many actions are happening. So, Activity makes sense.” Well… even though I admit it, it still feels more relevant if “Action” means the “What’s happening on those panes”, not the “pane” itself.
If a naming is this bad, even though you memorized it, you have to think about it whenever you use it. If you are a programmer only for Android, then there can be not so many problems. But if you happened to be a multiplatform-savvy programmer or if you are to use different technology on a platform like Ruby/Ruby-on-Rails, JavaScript, PHP, etc, each of them would not use same kind of “hard to understand and memorize” concept and terminologies.

Also, “Intention” is also good example. What you can think of when you heard of “Intention”.
“Hmmm… It’s for presenting what you are going to do (probably) next time.”
Right?
Well… it turned out that it’s for tossing data between event handlers and “Activity” or can be anything for passing parameters.
Well… then why do they “invent” such a new class? Wouldn’t it be better to utilize some terminology to mean “data”?
Or you can say, “Wouldn’t it be better to pass them as parameters?”
Well.. yes. But at least, if there are lots of things to toss across entities in a program, sometimes it’s better to embrace in a container and just pass a few container instant. But anyway…
In Cocoa term, “Intention” looks to be implemented using “dictionary” or in general CS term, “hash” table.
In MFC term, it will be CMap. The common naming strategy for them are the naming is based on “data type”. Because it can be used for any purpose, it’s better to have generic name. Now let’s think about “Intention”. Hmm.. is it as generic as “hash table”, “NSDictionary”, “CMap”, “CArray” etc?
No way. Also, there is already well established terminology for it, “parameter”. Then why they invent a new one “Intention”?
If I were a Google engineer, I would name it, for example, “Param”, or can be a little more creative with same approach.

Overall, I’m sorry to say this but S/W architecture portrayed from the SDK doesn’t look good either. It feels like it’s overly complicated.
It feels like my first day of seeing Mozilla CORBA-like object brokering code or MS COM. It’s like that something can be done more simply is done in hard way.

Well… making an egg stand is difficult if you think of it from the scratch for yourself. Once you know the answer, it turned out to be very simple.
However, for architecting thins like Android OS, there were a lot of existing solutions and models they can look up.
It looks like that.. it’s done by small group of people haphazardly. ( Umm.. I know the history of development of Android. )
If they keep make this architecture evolve, who knows? Probably they can run into a wall someday, which is very hard to break.

현장감 넘치는 Android 개발자의 Android에 대한 생각

주인장이 쓴 글 제목은 안드로이드를 “혐오”하는… 인데, 과연 굳이 혐오까지 할 필요가 있을까 싶다만, 읽어 볼만하다. 깊이 없이 한 플랫폼을 추앙하는 사람들이라면, 비록 안드로이드가 아니라 iOS나 기타 그 무엇이라도 읽어볼만 하다.

[Android] 안드로이드를 혐오하는 개발자 이야기

%d bloggers like this: