featured, Technology

My first Android app

Hello all

Today I finally started some Android development. I’m not a Java developer and have never done mobile development before but I was keen to get started. So as usual, Hello World was the first app I had to build.

I started off with AppInventor, which I found was great for drag-n-drop GUI and programming. This was great to start off with and get familiar with some of the GUI components. However, I wanted to see and write code. So I headed over to http://developer.android.com and clicked on getting started. To be honest I skipped the “What is Android?” section and moved to “Application Fundamentals”.

Android SDK installed, Eclipse configured, Android Virtual Device setup and we are GO. New Android Project created and compiled. A blank screen 🙂 . It was time to add a couple of UI controls a TextView and CheckBox. I could have used the friendly UI to drag components onto the device “screen” but I thought I should go straight for XML.
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<CheckBox
android:id="@+id/checkBox1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>

A TextView followed by a CheckBox underneath. Switch to the Graphical View tab and we get a visual confirmation of these two controls. Simple stuff so far.

Now we want to change the text of the TextView. We can add android:text="caption" to the above XML but that’s static text and boring. Let’s go to the source code in our HelloWorldActivity.java file. The following two lines of java get the TextView control and sets its text property:

final TextView tv =(TextView) findViewById(R.id.textView1);
tv.setText("changed Text");

Similarly for the CheckBox:

CheckBox chkEnable = (CheckBox)findViewById(R.id.checkBox1);
chkEnable.setText("Enable");
chkEnable.setChecked(false);

We can compile and run this. You will see the “changed Text” at the top and right underneath it a check box.

Hello World

Beautiful.

The next step for me was to add some functionality to the Check Box. Here’s the code:

chkEnable.setOnClickListener(new OnClickListener() {

      	  @Override
      	  public void onClick(View v) {

      		if (((CheckBox) v).isChecked()) {
      			Intent in = new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);
      			startActivity(in);
      			Toast.makeText(HelloWorldActivity.this,
           		 	   "Enable GPS" , Toast.LENGTH_SHORT).show();  			
      		}
      		else {
      			Intent in = new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);
      			startActivity(in);
      			Toast.makeText(HelloWorldActivity.this, "Disable GPS", Toast.LENGTH_SHORT).show();

      		}

      	  }
      	});

Here we add a onClickListener to detect when the Check Box has been clicked/tapped. In this we have a onClick() method which defined the actions to take when the check box is clicked. Here I am opening the Location settings of Android and showing a toast notification. I should mention here what an “Intent” is. An Intent is a message for a specific activity,  service or broadcast. For Activities, this could be the action to perform, and for Broadcast this could be a message. Above I’m using an Intent to perform the action of starting the location settings Activity. I then use Toast.makeText to show a notification.

So far so good. This wasn’t a big challenge so I set out to add Google Maps. I already had the functionality to open Location settings so I thought this follows on nicely. This is where things get complicated. I won’t post the whole code here but I will link to the tutorials I followed.

[1] http://developer.android.com/guide/topics/location/index.html

[2] http://developer.android.com/resources/tutorials/views/hello-mapview.html

[3] http://developer.android.com/guide/topics/location/obtaining-user-location.html

These give a step by step tutorial to add Google Maps and also acquire a position fix using either network or GPS. So here’s one I made earlier:

Hello World with Maps, Notification and Location information

Here I have taken the location information and displayed it in my TextView. The little Android shows the current position and the Toast notification is triggered by checking the “Enable” check box.

You can get this apk here. This is for devices with Android 4.0 and above. I have only tested this on Samsung Galaxy Nexus and with a help of a friend on Samsung S II.

Disclaimer: This software is provided “as is” with no warranty. (I have always wanted a chance to write that 😛 ).

Standard
featured, Technology

Google Chrome (beta) for Android

Early his week Google released a beta version of their Chrome browser for Android 4.0 (Ice Cream Sandwich). You can download the beta from Android Market.

The native web browser in Android has shared the webkit with the desktop version of Chrome for a while now. The performance improvements are related to JavaScript execution and it feels well optimised for a mobile environment. The UI is very simple and similar to the desktop version. Some nice features like tab organisation are well implemented.

Instead of talking about the UI, here are some screenshots.

Try out Chrome and let me know what you think.

Standard
featured, Technology

Samsung Galaxy Nexus (Updated)

So I finally got my Galaxy Nexus delivered and it is a beauty!

In this post, I’m not going to talk about all the features of the phone or of Ice Cream Sandwich. I’m going to talk about my experience of using the Galaxy Nexus and moving from a Blackberry to Android.

The move to Android

The first impression was that ICS looks very sleek. Very smooth and shiny. Compared to Blackberry OS6, the interface flows much better.

Obviously a major change was moving from the awesome hardware keyboard to a soft keyboard on Android. The change is made difficult by the lack of physical feedback. Sure the Galaxy Nexus vibrates on key press but that is not a replacement for a physical push of the button. So it’s safe to say I miss the keyboard on the Blackberry!

Next on the list is the screen. Here’s an understatement to describe it: it’s huge! No really it maybe smaller than the Samsung Note or the Dell Streak but it’s still huge! The plus side to this, well there are several. More screen real estate, bigger keys on the soft keyboard and of course the Galaxy Nexus has a half HD screen. The sAMOLED screen is easy on the eyes while being sharper and producing more colours. The 1280×720 resolution is as expected, amazing. Having a 4.6 inch screen is not good for the battery. From the android’s battery manager, about 40-50% of the battery is consumed by the screen alone. The Galaxy Nexus has a 1750mAh battery which isn’t big but survives for a day without any heavy CPU/GPU usage.

Do I miss BBM? No. I was never a big fan or user of BBM but now I have WhatsApp Messenger on which pretty much all my friends are available. I never use to watch any videos on the BB on such a small screen. The HD screen makes watching movies a pleasure. Reading books is also good, Google Books is available out of the box and syncs with your account. I found Moon+ Reader free to read other formats like epub.

NFC

Near Field Communications. Right now in the UK, there are no practical uses that I’m aware of. No Google Wallet, No Mastercard PayPass or Oyster travel card (London Underground travel card). I found the “NFC TagInfo” application very useful in reading the tags. For most tags it is able to read the ID and memory block size etc. Obviously most tags are encrypted and to decrypt, you can enter the Access Keys.

What is novel is that the NFC antenna is actually embedded in the battery itself. I’m not sure what technical advantage is of doing this compared to embedding it in the back cover. I would like to see more practical applications of this technology sometime soon in the UK.

All in all, I’m really liking Android 4.0 on Samsung Galaxy Nexus. I am glad to have moved on from Blackberry and as my friends say I have “seen the light” now. haha

I hope you are enjoying your Galaxy Nexus and I would recommend upgrading if you are due.

Updates:
I didn’t mention the notification indicator before. Well it’s located in the bottom bezel of the phone and is a 3 colour LED. Although here are no options in ICS to choose the notification colour, I have noticed that Facebook notifications have the blue light whereas Gmail and others have the generic milky multi colour.

Standard
featured, Technology

Google+: A Review

Google+:The latest attempt at social networking with a difference. It has been known for a while now that Google was working on something called “Circles”, a Facebook equivalent. However, Google+ takes the concept a lot further than just social networking.

Google+ has introduced 2 major new features: Hangouts & Sparks.An enhanced feature of social networking is Circles.

Circles

Circles can be argued as a new feature but in my opinion it is glorified lists. It is definitely a new perspective on managing contacts. In some ways, it makes it easier because the graphical interface makes it easier to add,view and manage contacts.

Whenever you post an item, whether that is a status update, photos, video or relationship update, you can choose exactly who is able to view that. Multiple Circles can be selected but also individual people. Management of Circles is key to privacy in Google+. Adding the right people in the right Circles means that your posts are visible only to the people you want to share them with. It is also possible to add one individual to multiple circles. So if a friend is added to Friends, you can create a new Circle “Roadtrip group” and add him/her to that too. So you can share links related only to that activity with that Circle but not the rest of your friends.

Hangouts

Hangouts are great! It is literally where people can meet all their friends and actually talk face to face. Basically it is a group video chat in which people can drop by easily to say hi. Unlike all the current video conferencing solutions, Hangouts shows only one speaker at a time on the big screen. All the rest of the contacts are shown at the bottom with their live video in smaller size.

None of the social networks right now, have this feature. Facebook has group chat but only text. Hangouts is also rivalling Skype. Skype currently has subscription based grouped video chat feature. With Google+, Hangouts is free. There have been reviews by tech blogs which say that the feature works flawlessly. Its smooth video streams, transitions and the switching works great, the only limiting factor is apparently your internet connection. Below is a video from LifeHacker.

Sparks

Everyone knows the “like” feature in Facebook which allows you to follow a certain company or group but this is limited to only one group. You have to like several groups or companies that interest you. Sparks simplifies this massively. Sparks lets you follow your interests. This is similar to searching a generic topic hashtag on Twitter. Say you like Robotics, you simply search “robotics” and add it as your interests. This will give you access to all the items related to the field of robotics from different sources. Google being the top search engine, only provides you with reliable, trusted and informative posts from the web related to your interests.

I really like this feature because it means I don’t have to selectively look up certain groups or companies related to my interests and it filters for me all the news items. If you wish to follow certain blogs or groups, you can do that too. Simply search the name of the blog and you’ll be presented with results only from that blog, then just add it as your interest.

Stream

What is a Stream? Stream is a feed of posts from your circles. It is the equivalent of “News Feed” in Facebook minus the updates from your interests. Here you’ll see anything that your contacts have shared with you, updates, photos, videos or even locations. When sharing something, there is an option to add your location to the post. This is available from a desktop platform or mobile platform.

There seems to be no equivalent of “the wall” in Google+. So to direct certain shares towards individuals, a “+[name]” is required. This works like “mentions” in Twitter or tagging friends in posts on Facebook. If your share mentions a friend of two, that post will be viewable to only those people by default. This can be changed an Circles can be added by clicking “Add more people”.

Buzz & +1

Google+ integrates with Buzz and +1. On your profile there are tabs for Buzz and +1 which show your Buzz posts and things around the web that you like. Although you cannot post to Buzz from Google+ you can +1 posts that you see in your Stream.

Other features

Google has launched Google+ on Android and the mobile web. Android has a dedicated application which gives users even more features such as Instant Upload and Huddles. Instant Upload allows user to upload a photo or a video directly from their Android device. Huddles is a group chat and is a mix between Google Talk and iMessage or BBM. Its instant messaging but for a group and its cross-platform. So when Google+ applications hit all the other ecosystems (iOS, Blackberry, WebOS ) everyone will be able to Huddle together.

You can visit the mobile website at http://m.google.com/plus .

My experience with Google+ so far has been limited but great. The features are great especially Sparks & Circles that I have used. But I don’t have a webcam to test Hangouts 😦 . The mobile website is also very accessible and clean layout making it easy to use. I just hope Google+ has a good uptake unlike Google Wave.

Please do share your thoughts and experiences in the comments section.

Sources/Links: Google+, Google+ (mobile), Youtube

Standard
Technology

Repost: Microsoft makes more from Android than from Windows Phone 7

HTC agreed to pay Ballmer and his cronies $5 per shipped Android set. Citi says that HTC has sold 30 million sets, adding $150 million of fresh greens to Microsoft’s piggy bank.

Now, Microsoft sold two million Windows Phone licenses over the same period, which accounts for $30 million dollars using an estimated license fee of $15 for each Windows Phone shipped.

Source: Gizmodo, Citi

Standard
featured, Technology

Android ADK (Accessory Development Kit) + Project Tungsten

Moments ago at Google IO, the Android open Accessory Development Kit (ADK) was announced. This is a great move to open up the Android ecosystem and allow developers to build android compatibility in to their devices. One of the commercial examples shown was an exercise bike by LifeFitness. Using the ADK, they were able to interact with a game on the Android phone by cycling. the controls were simply the speed and difficulty of cycling effort. Another example was switching on/off lights in a room. Well, they actually played with the lights in the conference centre itself.

Android @ Home

Demonstration of Project Tungsten. Reference Hardware Hub connected to speakers. (The Hubs are small cubes between the speakers.)

Another feature of the Android OS shown was Android @ Home . This is a framework primarily for home automation. It is completely open, free and requires no registration or validation for use and development. Project Tungsten is an initiative which shows an example of application of Android @ Home. The Android Hub as it was called is reference hardware running the Android OS along with the Android @ Home framework. Any Android device is able to interact with this hub. The example use demonstrated was streaming music directly from Music Beta by Google to this Android Hub controlled by the Xoom tablet. The process was described as the Hub receiving track information from the tablet and then independently retrieving the music from the cloud.

Predictions

There are some home automation solutions already but they do not integrate well with out mobile devices. Google’s ADK and Android @ Home is a way for Google to enter this space and also expanding its ecosystem. Where I see this going is, there will be a Tungsten Hub or similar capabilities built in to consumer devices such as AV receivers, TVs, Digital Photo Frames, etc. Google already has Google TV which might be phased out once Android @ Home matures. This will definitely rival AirPlay, however, its implementation will be closely monitored to look for quality of applications and hardware. Apple has AirPlay integration with third party hardware manufacturers so it will be interesting to see how fast the same hardware manufacturers take up Android @ Home framework and how Google will control this.

Apple or Microsoft do NOT yet have a ADK present for their OSes currently. Apple currently approves 3rd party devices with AirPlay meaning quality control but does not allow any independent developer to develop hardware with AirPlay capabilities. Microsoft has its own Media sharing in the Windows platform but not on Windows Phone 7 yet.

Source: Android ADK , Music Beta by Google

Standard