Solving development problems  |  About this blog

Archive for the ‘android’ tag

The dark side of Android phone development – part 2

About this blog post
Unlike the Official Google articles that are mostly praising Android as Mobile platform, this article covers practical development experiences with Android platform.

Authors of this article have prior practical experiences in web and desktop enterprise software development and have recently developed few Java applications for Android 2.1-update1. Content has been written in Autumn 2010, statements in the article are referenced to that time and to the testing on Samsung Galaxy S i9000 phone.

Android Development

As we pointed out in this blog title, we just wanted to make an awesome Android phone application and we wanted to find out how much effort does Android OS really take for a development. Users don’t care about this and web press don’t care much as long Apps are great and working and all the hard work by developers isn’t mentioned a lot, except at dev blogs.

How Android is working
Android market is the main source from which users download mobile Apps to their phones. First thing that we noticed is that Google, the grandmaster of web search engines, doesn’t even have search feature on Android Market website so you can not find mobile App that you are looking for. By statistics there is only a small amount of payable Apps and their price is around a dollar ($1) and most of the applications on the Market are free.

Web view of Android market v iPhone App store

Google definitely plays whole different game on mobile space. Knock-outing all other players with free OS for all handset Vendors it gained mass and popularity and is trying to secure future dominance over mobile search and advertisement, Apps. This isn’t such a bad strategy after all if you think that predictions for Mobile market are $17.5 billion $ by 2012.

Developers are the most collateral damage inside Android value system. They are trying to make good Apps and it is a shame that Google don’t care to promote developers properly with better Market and it looks like Google is the only one who gains profit out of this relationship. Is it also true that Google has been lucky, or to say it better, just on time with Android launch and become the only real competitor to iPhone, which is sold by only one vendor – Apple.

On the contrary, Android, that has open approach, allowed many different vendor carriers to get into smart phone market (HTC, SAMSUNG, …). Taking advantage of growing Apps market and advertising Android platform Google is collecting large statistic numbers for variety of marketing use. At the same time public relationship (mostly fans) has done a great job hiding the background of so called always beta Android platform.


Why Android is not very friendly for developers and can improve a lot in the future?

  1. No earnings for developers Developers have less chances to earn money on the market since the users expect to download FREE applications - good for users, bad for developers. In the long term is also bad for users because they will get lower quality products. Here are not counted enterprise solutions for real clients.
  2. Market is not organized Market is huge, tens of thousands of Apps, lots of daily uploads with no quality control... Lots of free Apps are very poor and not very good and this means that is harder to find a quality product on Android market. Consider how can normal user find your application?
  3. Bad API consistency Java in theory is a good idea, you should learn language, coded once and then run the code on different platforms and Android runs Java applications. Android platform have different features, like file structure, graphical interface, accessing hardware features, etc. So programmers make APIs and libraries to simplify development, to avoid writing code for same functionality over and over again. Android API has like every other API issues with backward compatibility, extensibility, maintainability... and backward compatibility is poor, applications written for 2.1 are not guaranteed to work on newer phones (2.2). Code does not necessarily compile for latest version because Google has renamed a method or a constant (e.g. frequently used FILL_PARENT renamed to MATCH_PARENT).
  4. API bugs API documentation is sometimes inaccurate and outdated, for example saying "this method will always return a list with at least one element" but what it does is exactly the opposite - returning null. As Android has many documentation issues phone manufacturers interpret documentation in their own way, not following the documentation strictly (e.g. random phone resolutions). Manufacturers improvize to gain some hardware features, like accessing the secondary camera or secondary SD card (e.g. originally /sdcard is for external storage but on Samsung Galaxy S /sdcard is used for internal, /sdcard/sd for external). Developers always have to look for work-arounds, trying to write some logic code at first that it does not work, trying the other way and it does not work either, trying for the third way when it finally works. Dealing with that kind of work-arounds takes time and nerves. In long-term this issues may result in non-consistent APIs, different for each phone model, as it was back in J2ME days.

  5. Other Android disadvantages we experienced:
    • Not so easy customizable (you can change colour of a button but cannot change the transition animation between activities)
    • Emulator is slow, no camera support
    • Sometimes during development testing Phone Galaxy S freezed and the only way to wake up the phone was to take battery out.
    • Not as friendly to use as iPhone, e.g. you have to deal with USB drivers. Not as fast as iPhone.

Conclusion: Android solutions are short-terms for developer, patch it and "works now" and API design is really a large downside for a mass consumer product as it is Android.

Why Android is also not perfect for final users?

  1. Bound to Google Android phone user needs GMail account to download an application from the market. Once a user logs in with GMail account and downloads at least one application it can no longer remove the account from the phone without resetting the phone to the factory defaults. With default settings open Google has chance to always track an account for controlling downloads and tracking IP and GPS location of the phone (default settings on Samsung Galaxy S phone).
  2. Hacks, viruses, security, privacy issue on Android phones can be exploited easily with numerous hacks to unlock the phone (e.g. by uploading custom firmware ROM) or bypass security restrictions (root access hacks). Even with the brand new phone you can type *#*#...# sort of secret codes to access the hidden or debugging features on Android phone. For access to for hidden GPS settings type: *#*#1472365#*#* on Samsung Galaxy S phone).
    Pre-installed system applications can enable Wi-Fi, Bluetooth, camera, browse contacts without user ever knowing or agreeing. In our case we get unwanted silent imports of GMail messages and contacts just by logging with GMail account on the Android market.
  3. Beta quality products for users Nowadays Mobile phone market is already huge and touch screens are very popular and competitors are fighting for every percent on the market. To be a step before or to catch the competitors Google needs to provide Android products fast. Quick releases mean less testing and buggy features, resulting in fair-quality beta products. Samsung Galaxy S is at the time of writing the hottest Android phone on the market and many are comparing as Android iPhone, but guess what: GPS does not even work correctly with the initial firmware. Sometimes touch screen freezes and you cannot turn off or reset the phone because "turn off" is triggered with a touch (there is always a way to take battery out and insert it again).
    To emphasize this test with Galaxy S: Android software is currently the main problem, not hardware. Software could be a whole lot better, hardware is at it's optimum.


What are the conclusion sorted by the facts:

  1. Users expect free apps resulting less $ for developers
  2. Fairly compatible platform versions
  3. Android market is big with lot of toy apps and few very useful everyday applications
  4. Privacy issues: Google holds you and you can not escape
  5. Questionable security, easily exploited platform (hacks)
  6. Constant searching for work-arounds during development
  7. Phone manufacturers use API in its own interpretation
  8. Fair quality software, is it a bug or feature?

Final words

In the terms of software and UX we have to admit that iPhone is currently much better then Android, who is trying to catch up, resulting in quick decisions, bugs, and lower quality product. Android is improving and we can soon expect it will be a stable platform (1 year) and because is »open« platform compare to »closed« iPhone system has lot of potential to overcome iPhone. There is large amount of phone manufacturers that produce Android phones with free Android OS opposite to iPhone which is under Apple control. Very important fact is that number of Android developers are growing more rapidly than developers for iPhone and also on the market Android phones are selling faster then iPhone (USA example). Android is definitely a step forward compared to J2ME but now it looks that it is going to the same problematic direction (resolutions, different hardware, compatibility).

What do you think? Share your thoughts in the comments.

What is happening in Mobile world? – Mobile thoughts part 1

We all see that Mobile content is heading to Headlines and mobile world has engaged into mobile/web mix of many new and old forms such as: print, games, education …

On Mobile ground is currently most important IT battle for future dominance over mobile digital space, mobile platform and users. At that moment nobody really cares about the Internet browser fight although HTML5 trends can change all this in future. Nowadays users use phones and pads for work, social communication, games, computing, watching live events, education … and all these devices are handy and easy to use. In last two (2) years world has changed a lot and now these devices are considered as given.

Many entrepreneurs, developers and marketing managers are seeking for gold in Mobile world. The rhythm is being dictated from big and small companies such as Apple, Google, Microsoft, Nokia, HTC, RIM, Facebook, Foursquare, Gowala, HP … How important it is can be simply shown with following diagram – how many lawsuits are undertaking between these companies at the moment. For every new trend or part of technology is a race who will be the first to release new feature, who will ship new device sooner, update operating system with new features and take the lead.

Source: http://flowingdata.com/2010/10/11/mobile-patent-lawsuits/

The mobile battle ain’t finished yet, it has just barely started

In a few years mobile market has changed dramatically and Apple is responsible for user experience and touch screen revolution with releasing iPhone back mid 2007. Apple, although not the only one company working in the touch and gesture field, at that moment was first and still has leading position on the market with new iPhone 4 and very sexy iPad. On his heals is brother Google with Android platform and new players are joining to the party. One of the big companies that missed new Mobile kick start was Microsoft, and now has  fresh new Windows Phone 7 platform launched in autumn 2010. The big question is what BlackBerry and Nokia (with QT platform) will do in the near future?

How is distributed Mobile market share
BlackBerry owns 30%, iOS owns 28% and Android owns 19% of the total US Mobile market share where Nokia with Symbian still holds around 40% of the world market share.

[Link: By Mashable]

Mobile users wants superb phones and when we talk about OS on mobile phone users gets into psychical relationship with the company behind the each platform.
Android platform has grown rapidly in 2010
Android OS smart phones ranked first among all smart phone OS handsets sold in the U.S. in the second quarter of 2010, at 33%. iOS is ranked third with 22%.

[Link: Wikipedia quotes ]

Android vs. iOS popularity (http://zeeis.me/ios-android-popularity/)
Users generally don’t care about or knows what kind of  OS is running on their phone. They know that this or that phone is cool and as long it is working good and fast and brings good experience on nice handsets with reasonable price they are super happy. Apps are important but definitely not decision maker which phone platform/phone we will choose. In near future probably lot of Apps will be very similar across platforms as it is trend to port successful Apps on different platforms by the same Vendor. Nevertheless Apple App store for iPhone and iPad wil be tough to beat by the competitors, thought.


Written by Avivo

December 2nd, 2010 at 1:24 pm

Transfer/Copy contacts from Nokia to Samsung Galaxy S

Technology should help people in their life not the opposite.
Moving contacts from one phone to another should be an easy task – couple of minutes and that’s it.
But…

  • Nokia (model E51) using Nokia PC Suite can export contacts only to CSV or TXT format
  • Android Samsung Galaxy S i9000 can read vcf (vCard) format from its memory card

That means not a happy marriage, or marriage that started with a divorce.

The first task in resolving this conflict will be:

Use Nokia PC Suite to synchronize your phone with Microsoft Outlook so you will get all your Nokia contacts in MS Outlook

OMG, MS Outlook can’t export contacts as vCards (it can import them from vCards, but no export).

But, there is a way (and this will be second step):

(Outlook 2007 version) Go to your Contacts and select all of them and then click on
Actions menu > Send Full Contact > In Internet Format (vCard)

And if you have a lot of contacts your Outlook (2007 version) will give you this error message:

When you do some search you will find out that you should delete files in Temp Outlook folder and to check this folder permissions, there is also a small tool to do this – but that didn’t help us out and we got the same message Cannot create file: Olktmp.vcf. Right-click the folder…

We found out that number of contacts you want to export is important and you can’t export them all (if you have many contacts) but you need to pick smaller number of selected contacts.

It helped us only to choose a smaller amount of contacts – about 50 contacts and then click on:
Actions > Send Full Contact > In Internet Format (vCard)

New mail message will open so send it to one your email.

In this email you will get vCards as attachments, so save them all to the disk to one chosen folder.

After repeating this operation you will get all your contacts as vCards in one folder.

So, finally you are ready to copy them to Samsung Galaxy S smartphone, but it is problem because you will need (when importing copied contacts in your phone) to confirm ever contact and this can take a time if you have a lot of them.

There is a trick to combine/join/merge all vcf (vCard) contacts into on vcf (vCard) file (in Windows OS) by typing this DOS command:

copy *.vcf AllMyContacts.vcf

Now, upload AllMyContacts.vcf to your Android smartphone’s SD cartd and go to the Contacts > Menu “More” > Import/Export >Import from SD card > choose one file (AllMyContacts.vcf)

Finally, we have them :-)

Samsung Kies Software for Samsung Galaxy S i9000 Smartphone

Got a new Android phone Samsung Galaxy S i9000 and tried to connect it with a PC. Galaxy S is a good phone, but as good as it is, the Samsung Kies software is bad.
There are problems when installing Kies on Windows 7 (64-bit version) and during installation we got a blank screen like this:

Installing Samsung Kies blank white screen problems

Installing Samsung Kies blank screen problems


As you can see during installation we got white modal screen, but Windows 7 helped as because in Taskbar it shows active window preview so we somehow try to guess where to click with mouse button.
We tried to install it 5 times and we finally managed – the trick is to quickly click on installation screens buttons “Continue”, check “I Agree..” because you have less than a half second to do this and then you can watch in your Taskbar zoom what is really happening in this white screen.
Finally, here it is installed :-)

Thoughts on android mobile development

Intro
We like the taste of MVC in ASP .NET and have some practical experiences in coding Java applets, J2ME and Silverlight applications.

Lately our team decided to build a simple application for Android phone to try the platform. Story begins with an idea and motivation, installing and setting Eclipse + Android SDK, and like always, a sketch, todo list, etc.

Issues

  • For each property in layout xml the “android:” namespace is needed. Of course it can be replace with “a” but it still annoying to write it every time. Example <LinearLayout android:id=”@+id/pnlSomething” />   There is more advanced graphical xml standard – SVG
  • oops, I tried (miss-clicked) to run android as classic Java application but it returns an error (like build error),
    next time I try running as android application this error wont go away even if the code is fine
    solution: delete error from the error list and it should work fine :)
  • sometimes I run a debug and don’t notice the tiny icon in the far right bottom corner of eclipse
    that shows the application is launching and it’s stuck… and I try to launch it again, and again
    and applications are trying to launch parallel… solution: close eclipse and start again
  • connection refused on localhost? is this a joke? is only google.com allowed?
    firefox opens it normally, firewall is off, same on IIS and apache, permissions are set in manifest.xml
    reason: ‘localhost’ means the internal loopback of device (emulator) not the PC,
    solution: use your LAN IP
    //solution: edit hosts and set something like 127.0.0.1   pc-localhost //does not work
    http://groups.google.com/group/android-developers/browse_thread/thread/801645febf0523ea/9e779925e9570828
  • when a crash occurs it is just a crash, without detailed message or tip, developer should guess the error
    * and, BTW, emulator shows wrong time on windows (7:04 PM while the real time is 21:04 on GMT+1 timezone
    or 5:07 PM when the time is 19:07)
  • Record breaker among IDEs: 1.131 GB of RAM taken by Eclipse
  • A lot of features: social media, web, google maps, sqlite, bluetooth,
  • gestures, camera, speech recognition, 3D, processing…
  • s it easy to learn? theory yes, it is logical and quite simple, well documented;
    but dealing with basic practical issues is a pain

What really annoys us is that when we write layout in xml and we are confidant with it schema is right, works in theory, draws a preview but just don’t work in emulator Eclipse won’t tell what is the problem it just says “Source Not Found.”

Comparison: C# vs Java

A good programming language uses less code and effort to complete a task. What makes Silverlight (C#) coding easier and Android (Java) coding harder? Advantages of C# over Java or what is missing in Java:

  • lambda expression and Linq make handling data, arrays, xml easy
  • properties
  • partial types when dealing with large files
  • preprocessor directives (#if, #region) to bring visual focus on the particular part of code that is being developed and hide the other code
  • verbatim string, like @”C:\Program Files\android\sdk.exe” without escape characters
  • nullable types, like int? that can be -n…0, 1, 2…n or null
  • ‘yield’ keyword
  • ‘??’ operator
  • enumerations that are avoided in Android (Android uses constants, requires documentation to locate a constant)

* comparing to Silverlight you need to write more code in a more complex way for same features (ie. async, binding,
db, events)

* nullable types, like int? that can be -n…0, 1, 2…n or null

Written by developer

June 28th, 2010 at 2:04 pm