TGIMBA – Android Client

I released the The Globe in My Bucket Application (TGIMBA) android client in the Google Play Store 🙂

Locate in Google Play Store:
1-Go to https://play.google.com/store?hl=en
2-Search for ‘TGIMBA’
GoogleStoreLocation

Source Code – https://github.com/ehelin/TGIMBAAndroidSourceCode

API Source Code (same as other clients) – https://github.com/ehelin/TGIMBA

This particular client was a little more challenging than the website and Microsoft Windows store versions.  Part of the reason was Microsoft made JavaScript a first class citizen in the Visual Studio Universal Application Eco-system.  Creating the Windows Phone 8.1/Windows 8 clients was as simple as taking the website JavaScript and putting it into a Windows Store wrapper.  I have not created the Windows 10 version, but I am anticipating that it will be as easy as the Windows 8.x release.

The Android release is a totally different set up and this release was my first venture into the Google Ecosystem.  This meant using the Android Studio Integrated Development Environment (IDE) which was new to me.  My one previous Android application had been completed in Eclipse which is a very nice IDE with a lot of users.  I think Google is trying to ‘own’ more of the Android Eco-system and this is one of many steps toward that goal.  Initially, I was a little annoyed I had to learn another IDE.  However, I was pleasantly surprised. Unlike Microsoft’s Visual Studio Store setup which requires a developer account, I was able to download Android Studio and start using it without an account.  Of course there was a learning curve, but it was not as difficult as I thought it would be.  All of the keyboard shortcuts are different and the build is as well, but once I figured out where most things were (thanks to the many, many bloggers out there), it is a nice IDE.

The next new step was to use the ‘Android’ flavor of Java.  Previously, I had used org.apache.http.client.HttpClient to make all my Application Programmatic Interface (API) calls.  With API 23, this class has been deprecated in favor of HttpUrlConnection (see reference #1).  You can still use HttpClient in API 23, but I wanted to be compatible moving forward, so I ended up using HttpUrlConnection.  It did prove to be a little more difficult to use than HttpClient.  The biggest issue was posting to my .NET API.  I was able to make posts from other .NET applications as well as from Postman, but the post object using this class always came back into the API method as null.  I think the issue was on the .NET API side, but I could never find a work around using a Post.  So, I used a Get for all calls.  Unconventional, but it works and was enough for me to get the application into the store.  I am going to list it as a known bug on the TGIMBA Road map and hopefully fix it in the next release.

Another item that I learned creating this client was the virtues of having a template based view.  With this client and previous projects, I have always constructed my User Interfaces (UI) dynamically in code.  Moving forward, I am no longer going to do this and will use markup views appropriate to the technology and bind the data to it.

Another deprecated class was one for converting a string to Base64.  The deprecated class works and its successor did not (for me).  I am going to hopefully rectify this in the next version.  The working class/method is org.apache.commons.codec.binary.Base64.encodeBase64(arg).  Its replacement is supposed to be android.util.Base64.encode(arg).  The odd thing is that the decode version from the new class works just fine.  It may turn out to be bug in my code.

Stay tuned!

References
1-http://stackoverflow.com/questions/32153318/httpclient-wont-import-in-android-studio
2-http://stackoverflow.com/questions/18207470/adding-table-rows-dynamically-in-android
3-http://stackoverflow.com/questions/4216745/java-string-to-date-conversion
4-http://stackoverflow.com/questions/6674578/multiline-textview-in-android
5-http://stackoverflow.com/questions/10614696/how-to-pass-parameters-to-onclicklistener

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s