Showing posts from May, 2013

Bitmap to Base64 conversion

ByteArrayOutputStream baos = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.JPEG,100,baos);
byte[] b = baos.toByteArray(); String outputString = new String (Base64.encode(b,resultCode);

Android versus HTML5

Native     Apps:
Integrated  deep hardware integration
Supports latest hardware innovations
native look and feel.
Broader access to device hardware
Closer integration to system features
Ability to integrate with other apps
faster, smoother and more attractive.

Web Apps:

Universal coverage  - mobiles

Advanced UI

Standard based

Mean by Native

Software development kit for Dalvik using java

Native development kit using c++
Renderscript using c99

Much graphics

Page turn, video gallery  using renderscript.

Get Gps Coordinates in android

package com.example.gps;

import android.location.Location;
import android.location.LocationManager;
import android.location.LocationListener;
import android.os.Bundle;
import android.content.Context;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends Activity {

    private Context context;
    double latitude;
    double longitude;
    Location location;
    LocationManager locationManager;
    TextView tv;

    protected void onCreate(Bundle savedInstanceState) {
        tv = (TextView) findViewById(;
        LocationManager mlocManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);

        LocationListener mlocListener = new MyLocationListener();
        mlocManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0,

    /* Class My Location Listener */