Posts

Android Cloud to Device Messaging(C2DM):Project

Image
Android Push application is an Android Application which is registers to the C2DM Server.It allows user to send and store contact,message,images,maps from the Server to your Device. It uses a features Cloud to Device Messaging to deliver messages that actually pushes the messages to your device, therefore it saves much more battery and best of all,there is nothing you need to do to enable it. The entire project(Android Cloud to Device Messaging) is mainly divided into three parts i,e the primary processes involves in this project are      -Android Push Application      - Cloud to Device Messaging framework.      - Android Push server thats sends message via C2DM Server. Overview of LifeCycle: Check following URL too to know more about C2DM,Authorization Token And Third Party Application Server. Android cloud to Device Messaging:Tutorial Client Login AuthToken Third Party Application Server Some Screenshot: Se...

Android Code Style

Android follow standard Java coding conventions. We add a few rules: Exceptions: Never catch and ignore them without explanation. Exceptions: do not catch generic Exception, except in library code at the root of the stack. Finalizers: generally don't use them. Imports: Fully qualify imports. 1.Exceptions: do not ignore: Never do this.Never wr ite code that completely ignores an exception like this : void setServerPort(String value) { try { serverPort = Integer.parseInt(value); } catch (NumberFormatException e) { } } Always: Throw the exception up to the caller of your method. void setServerPort(String value) throws NumberFormatException {     serverPort = Integer.parseInt(value);  } Throw a new exception that's appropriate to your level of abstraction. void setServerPort(String value) throws ConfigurationException { try { serverPort = Integer.parseInt(value); } catch (NumberFormatException e) { throw new Configura...

Android Progress Dialog Example

Image
In situations when you need to wait some operation it is good practice to notify user that operation is in progress.For this cases in Android present several classes which can help with this. One of them I am going to demonstrate. In this tutorial, I will show you how to add a progress dialog to your Android application. A dialog is usually a small window or tab that appears before any activity in your application. It is intended to display alerts or information to the user. A progress dialog can be used to either show some processing activity to the user or to show the progress of some custom activity using the progress bar. To create a Progress Dialog, we can make use of the ProgressDialog class which is an extension of the AlertDialog class. It can be used to display a standard progress dialog with a spinning wheel and some custom text. You can display your Progress Dialog using a simple show () call on your dialog object. Here's the syntax to create a standard Progress dial...

Error: Unable to open class file R.java and How to fix it.

[2011-05-27 12:12:39 - listActivity] ERROR: Unable to open class file /root/workspace/Manifest.java: No such file or directory [2011-05-27 13:50:38 - listActivity] ERROR: Unable to open class file /root/workspace//R.java: No such file or directory R.java and Manifest.java is a automatically generated file. The ADT has a few such annoying bugs. But you can sort them out.. What usually helps is: 1. Close Project->Open Project > Build Automatically . 2.Another thing that sometimes helps is right click project > android tools > fix project properties and remove unnecessary content or jar files. 3.Or you can do Project->clean and Refresh . If still it not generating R.java files then check your class there must be a extra line.. Import R.java.*; Remove that and then do all the above one by one.. Hope it help .. If someone know other way please let me know. T...

Conversion to Dalvik format failed with error 1

Sometime You will encounter this problem when trying to Build Android Project on Eclipse..  You will get such output in console: [2011-05-24 09:25:03 - Android C2DM] Dx 1 error; aborting [2011-05-24 09:25:03 - Android C2DM] Conversion to Dalvik format failed with error 1 You can solve this problem: Go to Project » Properties » Java Build Path » Libraries and remove all except the "Android X.Y" (in my case Android 2.2). click OK.  and then Go to Project » Clean » Clean projects selected below » select your project and click OK.   That work for me. Hope it works for you too.!!!!

Third Party Applcation Server

Image
The Third Party Server is *your* server and can actually be any process written in any language (for example, it can be a batch process or a cron script). The role of the 3rd party "server" is to send the message to the device. The Server will store (or update) the registrationID received into its local database. So, eventually the server will have registrationIDs from the devices. Your server needs to get a ClientLogin Auth token in order to talk to the C2DM servers. When it wants to push a message to the device. For ClientLogin Auth_Token:  Click Here To send a message to a particular device, the Server needs to POST to the C2DM Service the following 4 things:  The accountName which will be arxxus.pushapp@gmail.com . An authentication Token. The registrationID of the device it wants to send the message.  The message itself (Message limit 1024 Bytes) Code: // Create a new HttpClient and Post Header  HttpClient httpclient = new DefaultHttpClient()...

Software Release life cycle

Image
Life Cycle of Software Release : A software release lifecycle consists of different stages that report the stability of a piece of program and the amount of development is necessary before the final release. It is the distribution of software code, documentation, and support materials and composed of discrete phases that describe the software's maturity as it advances from planning and development to release and support phases. Each version of a product goes through a stage when new features are added, or the alpha stage, a stage that is being actively debugged, or the beta stage, and finally a stage in which all major errors have been removed, or the stable phase. Intermediate stages may even be recognized. The stages can be formally announced and regulated by the developers of the project, but sometimes the terms are used informally to report the status of a product. Pre-alpha: Pre-alpha refers to all activities performed during the software project prior to testing. These...