Posts

Showing posts from June, 2011

Native Methods and Libraries - Java

What are Native Methods and Libraries? Native methods  and  native libraries  are bits of platform-specific executable code (written in languages such as C or C++) contained in libraries or DLLs. Inside your Java applications you can gain access to the functions inside those libraries, allowing you to create a sort of hybrid Java and native code application. Although using native methods can give you some extra benefits Java does not provide (such as faster execution or access to a large body of existing code), there are significant disadvantages in using native methods as well. Why Use Native Methods? Gaining access to special capabilities of your computer or operating system Needing the extra speed that native methods provide Needing access to a large body of existing code Disadvantages of Native Methods With a hybrid Java and native method program, however, you've given up that cross-platform capability. First of all, Java programs that use native methods cannot...

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...