Category Archives: Android

Android Google Map V2 – Use Multiple Maps in Application

Hi All,

Since last few days I was facing serious problem with using multiple Google Maps in a Android application project I am currently working on. The application is a true copy of already existing app and used same source code to build with some changes as per client requirement.

Recently I came to know that Google has stopped user from generating Map API keys for Google Map V1Β  hence I forced to use the latest available version. The application I am working on needed to look same as its iPhone counterpart so I used Tab Host/Activity in it.

The application started throwing issues when I used the latest version of Google Maps for Android. The problem was I had two map in the application and when I switched to 2nd Map screen from first one, the 2nd map did not work and showed same screen (map location) as 1st map screen. It accepted no user input i.e. no location change, zoom or pan.

It took me a lot of time to figure out a solution for this issue (almost 7 days), in between I found many people said it was due to Tab Host/Activity (I am not sure of it), some also suggested to use TabFragments but that did not work for me.

Solution

Finally I cam across an article on Google documents that discussed adding Maps on Android from code instead of XML and that did the trick for me. I added maps on both screen from code behind, but with this I also had to remove the map on the “OnPause” event of the Activity and re-initialize it on the “OnResume” event

I have created a sample android application that uses the solution, download it here

Note: You will need to change the Map API Key in the manifest file

Feel free to contact me in case of any problem

Cheers,

Ankit

Create Advanced List View in your Android Application

Hi All,

I have been doing some interesting work on android for the past few days, I am creating a “Take Away” application that can be used by Restaurants / Eating Houses to receive order from customer by their android phones.

Though I now know how to use most of the controls available in the Android SDK it was a little difficult for me to do some advance work with ListView control. I wanted to show a list of available dishes to the application users in a list view and the user could click on a button to add item to their order list and when they have added the item in their order list I wanted to show the quantity they need for each item and also an option to remove items from ordered list.

Advanced List View for Android Application

I have used the List View control in my earlier android development projects but did not do anything like this so I was confused on how to achieve this. I started thinking this as a complex thing to achieve so as always did some R&D on Google but found no direct solution.

I have used List/Repeater controls in asp.net development as well, so I had it on my mind that I will need to do some kind of event binding to child controls of each list item in the List View in my list adapter class but to my amazement the solution for this was far more simple.

The solution was just to write the method name on the android:onClick attribute of my image button controls and define the method in the Activity class, that is it! πŸ™‚

The method receives the control View as parameter and you can perform the business logic in the method

Hope sharing this experience of my will save some time for someone πŸ™‚

Cheers,
Ankit

Parse – backend utility for mobile apps (Android, iOS & Web)

Hi Reader,

A month back someone told me about Parse – a very good tool to manage backend functionality for mobile apps. I am not very old with developing mobile app and did not want to get stuck with problems that arises when handling back-end activities in a native way for my android apps as this is just the beginning for me, so I thought to give #Parse a try and I liked it. Though I faced a few problems, sharing my thought below

Positives about Parse:
a) Available for both iOS & Android
b) Simple and Easy to use
c) Covers most of what you may need for back-end functionality in you app
d) Supports data handling in background threads, so better performance for your app
e) Has REST API so you can Sync/share data between web & mobile version of your app
f) Allows Facebook & Twitter integration

Negative about Parse
a) New product & Support not satisfactory
b) No proper libraries available for web integration
c) Limitations with Geopoint queries

But my overall experience was good and I like the product, so I would recommend it for new mobile app developers.

I have done some advance work using #Parse on my android and web apps so in case you face any issues feel free to contact me, I would surely try to help you

Cheers,
Ankit πŸ™‚

Icecream Sandwich for Google Nexus S in India

Hurray! finally Icecream Sandwich, the latest version of Android is officially available in India for Google Nexus S.
I was hearing rumors about it for a week now and I was super excited, finally this morning an alert popped up on my phone screen saying “Icecream Sandwich 4.0.4 in now available for update” πŸ™‚

Initially I was a bit scared as I heard Icecream Sandwich has issue on Nexus S and I was looking for review on Internet from people who have already updated their phone but did not find any latest reviews.

Finally this evening I decided to go for it and update my device and as a result I am in LOVE [much more then before] with my Nexus S.

Super looks, smooth, new features (Panaromic Camera is the best feature) etc etc

Go for it guys and tell me what you think about it.

Drag & Drop Pin on Map for Your Android Application

Hi all, I am very excited as I am very close to finish my first Android Application project.

From the past few days I have been working on it and truly this project has helped me learn a variety of stuffs including using various controls, external libraries, animations & my favorite Maps in android application. Personally I feel Map makes any application much smarter.

This application I have been developing uses Map to point users current location and it also allows to drag and drop the pin to any other location on the map and get address details for the position.

I love the way Drag & Drop Pin feature works on apple products (IPhone, IPod & IPad), specially the bouncy feeling it has and I wanted my application to have the same feel, but my bad, after searching for sometime on google I found that Google has not provided similar inbuilt feature for Android [I wonder why?], see the article here.

But as said in IT industry if client want it, it has to happen πŸ˜‰ so after some more search I found another article that mentioned about a sample project which shows similar feature, see the article here. So I used the sample project and achieved the desired result. Though it does not have the same bouncy feel but it look good and satisfies the requirement.

I have created a sample Android project for everyone who may have similar requirement after now and also attached the source code for Android project here below.

Download Source : Drag & Drop Pin for Android App

Please feel free to contact me in case you face any problem, thanks for reading πŸ˜‰

Android Application Development

Alright with new technologies comming up every day, it has become very important to keep ourself updated. Today I tried my hands on developing my first Android application.

All these days I was thinking what all it takes to develop an android application on any computer but the answer was as simple as

1) Java SDK, 2) Android SDK and 3) Eclipse IDE

Not so easily do you find a good tutorials to get yourself kick started in learning new technologies, butΒ we were lucky enough get few. ThisΒ Getting Started tutorial (Video series) is really helpful to begin with and get acquainted with the basic stuffs.

I created my first “Hello Android” application today and couple of others (Flashlight etc), its fun.

This is all for now, will keep you posted. Share your thoughts πŸ™‚