Friday, May 9, 2014

Quiky for Android

After I submitted Quiky for iPhone/iPod Touch for App Review, I started working on Android version.

I already have Android Studio installed and I started from scratch. My first attempt to make WikiList as drawer failed, so I decided to have the same layout as iPhone app, which makes more sense.

Because my only available Android phone is old GSmart Rola with Android 2.2, I decided to go wide and chose API 8. In the future I can always make separate Android 4 version. It’s gonna be Holo Light, to comply the iPhone app’s design.

I created four activities – WikiList, PageList, PageView and PageEdit, all with RelativeLayout and with Fragments. Then I dragged few controls into them, ListView into WikiList and PageList, WebView into PageView and two EditTexts into PageEdit. Originally I had some buttons there, but I moved them to menu later.

I decided to make first release as soon as possible, even with some bugs here and there, as a motivation. I know Google just scans APKs for malware and publication to Play takes only few hours.

So after it sort of worked, I put android:debuggable="false" into AndroidManifest.xml (it says it shouldn’t be hardcoded, but screw it, should be easier) and made signed APK. I don’t get why there’s no checkbox for debuggable option during creation – I’d assume people make signed APK mostly for the Play. Never mind, version 1.0 was ready and submitted.

I downloaded it and it was OK, but only for the first time. When I tried to launch the app once again, it said “Application not installed on your phone”. I figured it was because I had no SD card and I had SD access permission in the Manifest. After I removed it, it worked just fine.

It took me a while before I grabbed the concept of Fragments and now almost all business logic is in PlaceholderFragment classes. I found out Google offers a “standard” set of icons, which is neat. It even allows me to get closer to the iPhone version.

The rest is just Java, which I mastered couple months ago :)

Monday, May 5, 2014

App rating in Google Play search

It was interesting to see how Google displays results for apps in Google Play. “Quiky” was unique app name throughout the whole store.

When the app was brand new and had no rating, the search for “quiky” showed the app around 10th position in the results. The rest were apps, where the word “quirky” appeared, plus apps featuring Nesquik’s bunny Quik/Quick/Quiky.

When I gave it 5 stars (it’s lame to rate own apps, I know, but this was for scientific reasons! :) the app skipped to about 3th or 4th position.

I asked my brother for another 5 stars (no loser alert, still scientific! :) and since then it stays at the first position.

Wednesday, May 8, 2013

Android App

Java has always been somehow unlucky for me, even though I have a lot of experience with similar languages, like C# and JavaScript. I tried it and failed several times over last five, six years. I was able to make the Hello World to work, but nothing beyond. This applies for Android as well, I remember installing the SDK two or three times in the past. Maybe because I used NetBeans and then Eclipse. But this time I tried IntelliJ IDEA (community edition) from JetBrains.

The first steps were obvious: File > New Project... > Android Application Module, fill the project form and create the project, package “com.qetrix”. My test device is old Android 2.2, so I selected this one and API 8. But what now? I knew something about Activities but I had no idea what it’s all about. I read somewhere it’s like a Controller in MVC. OK, but what about view (something like Form in .NET)?

I tried to add new GUI Form, but it was dead end. I tried tutorial from JetBrains and I learned the GUI is defined as XML file in res/layout/ directory. I created new XML and – voila! Nice. I started adding controls and for me it was quite understandable.

I created the screen with a list of databases (ListView with ArrayAdapter) and compiled it. After a while it launched an emulator and after it booted and I unlocked the screen, the app appeared. Fantastic! :)

Then I created new form as Login, set it as startup and launched the other from this one, using “.startActivity(myIntent);“. This was a pivotal moment for me, from this point on it was just a matter of time, manuals and best practices.


Login screen (Czech locale). Oldschool – I know :)

The development for Android is really fun after all :)