Wednesday, August 24, 2011

Deploying Android apps on phones and tablets

There are features like "telephony" that are supported only on phones, if you include them in your application manifest the tablet users will not be able to find the app in the Market. Google's solution to that is to deploy multiple APK under the same package.


PHONES (deploy first):


It is OK to include android:largeScreens="true" for phones as you will see at the end.


TABLETS (deploy second):

If you want the app to show on the Android market for tablets, deploy another APK with API-Level 9 ( android:largeScreens="true", android:minSdkVersion="9")

DO NOT include, or try android:required="false" android:name="android.hardware.telephony":

After deployment you will see 2 versions on your developer's dashboard:

Please support us and download the FREE app:

Saturday, August 13, 2011

XML file design and formatting

It is well know that XML files are larger and therefore slower that JSON, however with careful design they don't have to be so. Remember the rule:

1) it the tag repeats only once then it should be converted to an attribute, for example:
- name, latitude, longitude, etc.

2) shorten the tag names, but don't go to far so it is still human readable
3) compress (zip) XML files when transferring them over a network

1) put each attribute on separate line, white space does not cost when compressed
2) extend line length to at least 120 characters for readability, your window size most likely allows for more

Friday, August 12, 2011

Still comparing iPhone to Android?

Disclaimer: I ALWAYS have BOTH iPhone and Android on me, I use both. I had 3 iPhones and several Android models including tablets of both OS.

Apple has a beautiful consistency of the product, and the hardware is just yummy, but as with superior breeds of the animals, does not matter how well groomed and "purified", the diversity and evolution eventually wins as the environment constantly changes. 

An Example of  such changes is that I mostly write my blogs from the phone, I never thought I will be doing it, but it is convenient especially with the Google Blogger app. I would not be able to type the long articles on virtual keyboard, so I rather use an OFFSHOOT of the mobile evolutionary tree, Motorola Droid2. I don't have much love for that particular phone, but I got it for free, no argument there. 

Maybe in few months I will have different needs and I will choose another model. 

So today, the only way you would convince me to switch my DROID2 for iPhone is if I could sell it on eBay and buy a newer, better Android phone (with keyboard). 

For me, there is no comparison, iPhone loose hands down on daily basis.

Couple of examples:
  1. If you want to have an alarm app (check out our Shame Alarm app) on iPhone you have to start it and leave it in the foreground -- and that is only one of the many problems of iOS, Google solved it long time ago. 
  2. I use desktop widgets on my phone all the time, iPhone may have them soon.
  3. Switching between running apps, I do it all the time bouncing between email and chat and browser and blogger.
  4. I type probably 3 hours a day on my phone, including my blogs, emails, chat, there is no keyboard on any iPhone

I cannot live without the above, and hundred other features users of iOS never heard of.

Let me know what features of each platform you find a must-have.

Friday, August 5, 2011

Using stereo 3.5mm jack to communicate with IR remote

I was thinking about making a universal 3.5mm jack device (IR and more).

This is not a new idea, versions of it has been around for 7 years, but it is still a cool project.

Griffin had something like that patented for several years, read this article, it is still cool. RedEye Mini has recently covered it commercially. Total Control seems to have Android version.
    For IR remote, the first approach is to communicate to 3.5mm jack, it seems that you can pre-record messages as 36kHz - 44kHz, 16bit Stereo square PCM (pulse-code modulation) wave files. Here is a geeky in-depth article from

    RedMote is providing Android source code and apk as well as few sample WAV files. The design is very cool:

    Here are the components needed as provided by RedMote: (Former Bender) is providing great schematics for the project:

    Quoting from the article: "two IR LEDs mounted in reverse [..] each IR LED will emit half the signal/frequency (15~20Khz). Together they will reproduce the original IR frequency exactly like the original remote."

    The optimal solution of course it to develop a sound generator and plug in the remote specifications.
    Here is a listing of remote specifications.

    I also think it would be cool to design Arduino board/shield that would plug in to 3.5mm jack and be able to receive:
    • IR emitter for controlling AV equipment (and add some social sharing component to TV watching)
    • IR proximity sensor to trigger stuff like alarm, or camera/voice recording
    • Ultrasound Sonar for various distance detection
    • and more..

    It take time and effort to create tutorials, please support my efforts with a couple dollar donation, any amount will be greatly appreciated!

    Magnetic Card Reader

    Here is a cool DIY project for couple of bucks worth of components:

    Wednesday, August 3, 2011

    Android: including HTML pages stored within the app

    Let's say we have a "Welcome", or "Help" HTML page that we want to include in the app. We put it in the assets directory, I created subfolder there called html.

    Now I can call:


    Monday, August 1, 2011

    Square - Credit Card Reader

    What's that? Micro iPod, toy tank, satellite dish? Not sure and I don't care as long as it has Android APIs.