HTC Blinkfeed – Operation Success! Patient Close!

I’m a hardcore fan of the quality of the HTC smart phone hardware. I had a worst experience with samsung hardware in its Onnia Pro model. I’ve thrown away the phone in just one week. Later I changed Sony Xperia, it was good. But the bigger screen is introduced by HTC first in India. I got HTC Desire HD, then HTC One V (low end model) and now I’m using HTC One Max.

HTC Desire HD

HTC Desire HD

One Max is a wonderful piece of hardware once again. It never hangs. (I’m using it for 4 months now). Pretty faster. The customized UI is good. This customization of User Interface is called as HTC Sense. I like that. HTC has the Sense version 5.5 in One Max. The English and Tamil fonts they use, Blinkfeed are the selling points of One Max. They have finger printing sensor with One Max. For me it is highly inconvenient.

HTC Sense 5.5 has pleasant interface

HTC Sense 5.5 has pleasant interface

Why Blinkfeed is annoying?

It gives option to integrate with social media, news, trending topics etc. It is good to have. But they failed to look at a hardcore social user cum blogger like me. Let me point out some intersting drawbacks.

Feedly and Flipboard makes feed reading a pleasant experience

Feedly and Flipboard makes feed reading a pleasant experience

* I’m unable to post to all my social network at same time. I had this feature in Desire HD. But I’m able to post on only one social network at a time.
Select facebook… post
Select twitter.. post
Select Google plus.. post.
ooh! why should I use HTC sense? I can do that from the native apps.

HTC BlinkFeed

HTC BlinkFeed

* What about RSS Feed? I should be able to read the feeds in which I’m interested in. I’m following n number feeds – my friends’ blogs, Indian news papers, etc. There is no other option to include those feeds. Alas, even they don’t support blogspot and wordpress. Crazy!

Though I have HTC Sense version 5.5, I still use Feedly (Sometimes Flipboard) to track the news and feeds. That is much convenient. I’m sure HTC had spent considerable amount of time in bringing the BlinkFeed. But It is useless!

KitKat upgrade to Goof tamil support

The main purpose of getting OneMax for its bigger screen and excellent Tamil support. All the android client supports Tamil now a days. Why the hell I need to go for HTC? The reason is Tamil Fonts! Unlike other vendors like Samsung/Sony/Micromax, HTC comes with Murasu Fonts which is very good for reading tamil for long time. (Thanks our Tamil Computing Pithamakan Mr “Murasu” Muthu Nedumaran).

Tamil Support in HTC One Max

Tamil Support in HTC One Max

But Kitkat upgrade in HTC had spoiled the Tamil support in Web browsers. Murasu fonts are replaced by Default Android Font, which is painful for eyes.

Default HTC browser doesn't have proper tamil rendering after KitKat Upgrade. You need to use Chrome

Default HTC browser doesn’t have proper tamil rendering after KitKat Upgrade. You need to use Chrome

The tamil font is not consistent after KitKat upgrade. The Murasu fonts are missing in many places in many apps.

The tamil font is not consistent after KitKat upgrade. The Murasu fonts are missing in many places in many apps.

The native email app is so cruel in rendering Tamil fonts

The native email app is so cruel in rendering Tamil fonts

 

But Still I like this piece, because of the Standard UI customization and quality hardware! phewwww!

 

Hello World Application in android

I have given some code snippets for some of the simple android applications under the same tag. Unfortunately, I couldn’t continue developing it further. Let me start once again now. I hope this hello world application be a good starter!

So the above diagram shows the components of Application development. Please have a look at the Android Fundamentals http://developer.android.com/guide/topics/fundamentals.html

Please install the Android SDK an ADT plugin for Eclipse as explained in http://developer.android.com/sdk/index.html

Once you are ready with the setup, create a new Android application as given in the screenshots below.

Once the project is created, You can see the default code stub HelloAndroidActivity.java have been created as above. This is a sub class of Activity. We will add a text and show it in the UI. You can see the code changes below.

package org.grassfield.helloandroid;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class HelloAndroidActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView textView = new TextView(this);
textView.setText("Hello, Android");
setContentView(textView);
}
}

 

Now Run the project, we can see Android emulator is getting opened. Give some time to do the loading process. You can see the output as below.

 

have fun 🙂

A simple RSS Parsing Android application

Adding further more changes to my code given in my earlier post, I am adding the source code as well as the APK file for a simple RSS SAX parser.

This will parse the feed http://foxbrush.wordpress.com/feed and show the content on the screen. More finetuning required, will be added later.

Source file (eclipse project archive) – http://ubuntuone.com/4Id0xEpemi3JwEhIRvwQKd

APK file – http://ubuntuone.com/4SjwRCdQwh6QsoWBd46TAY

Android version required 2.3.1; Tested with my HTC

Feedparser (c) – http://www.ibm.com/developerworks/opensource/library/x-android/

HTTPURLConnection in Android

A Code snippet that reads a URL and print the HTML content on the screen, as raw text.
You may need to refer my earlier post to enable the necessary permissionpackage org.grassfield;

package org.grassfield;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class HellodroidActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
try {
URL url = new URL("http://www.google.com");
HttpURLConnection openConnection = (HttpURLConnection) url.openConnection();
InputStream inputStream = openConnection.getInputStream();
StringBuffer sb = new StringBuffer();
int c=-1;
while ((c=inputStream.read())!=-1){
sb.append((char)c);
}
inputStream.close();
TextView textView = new TextView(this);
textView.setText("Google Output ==>"+sb.toString());
setContentView(textView);
} catch (MalformedURLException e) {
e.printStackTrace();
TextView textView = new TextView(this);
textView.setText(e+"");
setContentView(textView);
} catch (IOException e) {
e.printStackTrace();
TextView textView = new TextView(this);
textView.setText(e+"");
setContentView(textView);
}
}
}

Android Terminologies – 1

I hate theory.. But being at startup, I need to know this!

Android applications are written in the Java language. The compiled Java code with necessary files required by the application is bundled into an Android package (.apk file). Bundling is done by the android package aapt. All the compiled code in a .apk will be called as ‘application’, which will be redistributed and downloaded inside the phones.

Every application runs in its own Linux process. Android takes care of starting and shutting down the applications.
Each process has its own virtual machine (VM), so application code runs in isolation from the code of all other applications.
Each application is assigned a unique Linux user ID. Permissions are set so that the application’s files are visible only to that user and application only.

Application terminologies.
An activity presents a visual user interface for one focused task the user can do. An application can consist of one or more activities. One of the activities in the application will be marked as first, moving from one to another is performed by current activity start the next activity.

Service – it doesnt have a UI, but runs in the background for to do certain continuous tasks.

A broadcast receiver is a component that receives and reacts to broadcast announcements. Many broadcasts originate in system code — for example, announcements that the timezone has changed, that the battery is low, that a picture has been taken, or that the user changed a language preference. Applications can also initiate broadcasts — for example, to let other applications know that some data has been downloaded to the device and is available for them to use.

A content provider makes a specific set of the application’s data available to other applications. The data can be stored in the file system, in an SQLite database, or in any other manner that makes sense

Ref: developer.android.com

Hello World in Android

After installing the SDK and eclipse extension, next step is to create a our HelloWorld code, isn’t it?

That is very simple

Start a new Android Project in Eclipse

Give necessary parameters. Please see the explanations below (Credit: developer.android.com)

Here is a description of each field:

Project Name
This is the Eclipse Project name — the name of the directory that will contain the project files.

Application Name
This is the human-readable title for your application — the name that will appear on the Android device.

Package Name
This is the package namespace (following the same rules as for packages in the Java programming language) that you want all your source code to reside under. This also sets the package name under which the stub Activity will be generated.

Your package name must be unique across all packages installed on the Android system; for this reason, it’s very important to use a standard domain-style package for your applications. The example above uses the “com.example” namespace, which is a namespace reserved for example documentation — when you develop your own applications, you should use a namespace that’s appropriate to your organization or entity.

Create Activity
This is the name for the class stub that will be generated by the plugin. This will be a subclass of Android’s Activity class. An Activity is simply a class that can run and do work. It can create a UI if it chooses, but it doesn’t need to. As the checkbox suggests, this is optional, but an Activity is almost always used as the basis for an application.

Min SDK Version
This value specifies the minimum API Level required by your application. If the API Level entered here matches the API Level provided by one of the available targets, then that Build Target will be automatically selected (in this case, entering “2” as the API Level will select the Android 1.1 target). With each new version of the Android system image and Android SDK, there have likely been additions or changes made to the APIs. When this occurs, a new API Level is assigned to the system image to regulate which applications are allowed to be run. If an application requires an API Level that is higher than the level supported by the device, then the application will not be installed.

Once you are done with the wizard, eclipse will give you one activity class.

We edit the class so that Android world will say our name 🙂

package org.grassfield.android;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class HelloWorld extends Activity {
/** Called by the android when the activity is first created.
* Do the initialisations here.*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
/*
* An Android user interface is composed of hierarchies of objects called Views.
* A View is a drawable object used as an element in your UI layout,
* such as a button, image, or (in this case) a text label.
* Each of these objects is a subclass of the View class and
* the subclass that handles text is TextView.
*/
TextView textView = new TextView(this);
textView.setText("Grassfield Welcomes!");
setContentView(textView);
}
}

The project folder structure is like this

Once you are done with code editing, Build your project once.

Run the project as a Android Application

You will see your phone running your application now! WOW 🙂

now in landscape!!

Long live java, unix, android!