• Fast and Efficient way to transfer images between Activites in Android

    We often need to transfer images between activities. Well there are many methods to transfer images. You can make the image into a Base64 String and pass it as String argument extra in a bundle between activities You can save […]

     
  • How to load a spinner with values from SQlite Database in android?

    Here is a simple example showing how to load a database values in a spinner in android. OK we will start. This is the layout for the spinner row. spinner_row.xml This is the layout for the interface. activity_main.xml Now this […]

     
  • How to make a http call repeatedly from a service in android?

    We may have applications in which we may have to make repeated calls to a webservice. At that time services may be useful. This is such an example in which we will be creating a Service in android to create […]

     
  • How to move a body manually in Box2D? or Give a force to a body in Box2D, iPhone.

    This is a sample code to move a body in Box2D . First you have to make a body with variable name “moving_rec” and call the below function in a schedular at regular intervals. -(void) moveBody{ b2Vec2 force = b2Vec2(0,0); […]

     
  • Creating a JButton component in swing

    Java swing provides a native look and feel that emulates the look and feel of several platforms. Here i am going to create a Button and adding it to Frame. For this first create a Jframe object,a JPanel object and […]

     
  • Using Tabbars in ANDROID, A Simple Example……….

    This is a simple example showing how to use tabbars in ANDROID. First create a new project and copy this code to it. Now create three another java files by right clicking the src folder and name it FirstTab.java, SecondTab.java, […]

     
  • Java Applet MouseEvents

    A simple event based applet applications is described below First importing the necessary header files // Demonstrate the mouse event handlers. import java.awt.*; import java.awt.event.*; import java.applet.*; /* <applet code=”MouseEvents” width=300 height=100> </applet> */ Next step is to create a […]

     
  • Date and TimePicker in ANDROID.

    The following code simply allows you to select a date and time using the datepicker and timepicker in ANDROID.

     
  • Java check memory Allocation

    When run the code the output will be similar to this Total memory is: 5177344 Initial free memory: 4986744 Free memory after garbage collection: 5063784 Free memory after allocation: 5045296 Memory used by allocation: 18488 Free memory after collecting discarded […]

     
  • How to find the device ID or Serial Number of an android device?

    Here is a simple API to find the device ID of an android device. There are many ways to get the device ID in android Note : Try this in a real device, then only you will get the device […]

     
  • Applet FlowLayout Example

    The FlowLayout class puts components in a row, sized at their preferred size. Creates a new flow layout manager with the indicated alignment and the indicated horizontal and vertical gaps. The hgap and vgap arguments specify the number of pixels […]

     
  • ANDROID Tabbars Example……..

    This is a simple example showing how to use tabbars in ANDROID. First create a new project and copy this code to it. Now create three another java files by right clicking the src folder and name it FirstTab.java, SecondTab.java, […]

     
  • Using Tabbars in ANDROID, A Simple illustration……….

    This is a simple example showing how to use tabbars in ANDROID. First create a new project and copy this code to it. Now create three another java files by right clicking the src folder and name it FirstTab.java, SecondTab.java, […]

     
  • Using Tabbars in ANDROID, A Simple Example……….

    This is a simple example showing how to use tabbars in ANDROID. First create a new project and copy this code to it. Now create three another java files by right clicking the src folder and name it FirstTab.java, SecondTab.java, […]

     
  • Listening incoming sms message in Android

    When a new sms message is received by the device, a Broadcast Receiver is registered. For this IntentFilter filter = new IntentFilter(SMS_RECEIVED); registerReceiver(receiver_SMS, filter); should be included . Also sms are sent in PDU’s(Protocol Description Units) format, which act as […]

     
  • Showing Twitter updates on Blogger/Blogspot

    Hi, If you want to show the latest twitter update of yours in your blogger/blogspot, then use the following steps. 1. Go to your blogger ‘Design’ 2. Click ‘Add A Gadget’ 3. Add ‘HTML/JavaScript’ 4. Paste the following JavaScript code […]

     
  • What is Objective C Keyword id ?

    Hi, Objective C uses a special keyword ‘id’. Let’s see what it is. Objective C -id- is actually a ‘pointer to an object’. That is ‘id’ can hold a pointer to any objective c object. It doesn’t matter the object’s […]

     
  • Dynamically Load CSS in Adobe AIR/FLEX / Load css in Adobe AIR/FLEX using Class.

    This example shows how to dynamically load css in Adobe AIR / FLEX. Here in this example Panel id the tag name for the panel control. Drag a panel control to your design then copy the code to your source […]

     
  • How to detect shake Gesture in your iPhone Cocos2D?

    For detecting shake in a cocos2D program copy these lines to your layer class bool shaked_once; //default false self.isAccelerometerEnabled = YES; [[UIAccelerometer sharedAccelerometer] setUpdateInterval:1/60]; shaked_once = false; Then copy this function to the same file…. and you are done…….. -(void) […]

     
  • Preventing Overriding in Java

    Methods and variables can be ‘override’ in subclasses. (Yes, it’s a good feature too!). But what if we don’t want to ‘override’ our Methods and Variables in Java? It’s simple… Declare them using the keyword ‘final’ as modifier. That’s it. […]

     
  • Creating Exceptions in JAVA

    This is a simple custom exception in java. That is, we can create an exception by extending the exception class. The “throw new MyExcep” will throw an exception and the error message we specified will be displayed import java.lang.Exception; @SuppressWarnings(“serial”) […]

     
  • Abstract Class in java

    This example shows how a simple java abstract class works Here “Shape” is the abstract class abstract class Shape { abstract void initial(); // methods only defined….. abstract void display(); } class cube extends Shape { void initial() // Abstract […]

     
  • Java Exception

    Simple java program to show how exception works public class exception { public static void main(String[] args) { try { int a = 10; int b = 10/0; } catch(ArithmeticException e) { System.out.println(“Exception Caught ” + e); } } } […]

     
  • Working with SQLite Database in ANDROID.

    Below is a straight forward example of how to deal with SQLite database in ANDROID. Go ahead and copy and paste the following code to your java file. The example has one database and performs functions like insert delete and […]

     
  • How to remove unwanted frames from memory in iPhone?

    In Cocos2D in iPhone often you may be using spritesheets which amy cause memory leaks because they are unused textures in memory even when you go from one scene to other. So make sure to remove all those unwanted textures […]

     
 

Theme by HermesThemes

Copyright © 2018 CoderzHeaven. All Rights Reserved

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.