Introduction to android .

by kaushik p » Tue, 12 Apr 2011 07:15:09 GMT

Sponsored Links
 Hi all ,

I am kaushik Pendurthi , I have been developing mobile apps in the platforms
like Meego before , Now i have started to develop apps on android. Can
anybody suggest me a good book for learning the key concepts of android like
- setting up android environment,  develop basic application and how to add
different packages .

Kaushik Pendurthi 


Re: Introduction to android .

by TreKing » Tue, 12 Apr 2011 10:18:35 GMT


You can do all that with the documentation.

TreKing <> ; - Chicago
transit tracking app for Android-powered devices


Sponsored Links

Re: Introduction to android .

by Michael Franz » Tue, 12 Apr 2011 10:27:39 GMT

Other Threads

1. UrgentHelp:Play Video file when accelerometer is triggered code error:

Hi All,

MyTask: I want play a video file in media player or videoview when the device 
is being shaken(accelerometer triggers). 

1. I'm able to get notification whenever accelerometer is triggered on the 
device using the following code separately. 

2. And i'm able to play my video file from sdcard using the following code 

I'm now integrating both to play my video file when the accelerometer
has triggered(whether device moved or shaked or etc). But when it was
working both the functionality separately, is not working when i
integrated both code to work as per my MyTask. After integrating the
code, i tested by shaking my device to observe starting video, but it
throws error as "The application has stopped unexpectedly. Please try

Can some one please look at my code below and suggest how do improve it and 
resolve it based on your experince and view?

Integrated Code for both Accelerometer access and Playing Video
when device is triggered accelerometer: [NOTE: The same code when i
executed separately, worked fine for both cases(Accelerometer access
and Playing Video)]


    public void onCreate(Bundle savedInstanceState) {



       // start motion detection

        sensorMgr = (SensorManager) getSystemService(SENSOR_SERVICE);

        boolean accelSupported = sensorMgr.registerListener(this,



        if (!accelSupported) {

            // on accelerometer on this device

            sensorMgr.unregisterListener( this,




    protected void onPause() {

        if (sensorMgr != null) {



            sensorMgr = null;




        public void onAccuracyChanged(int arg0, int arg1) {

        // TODO Auto-generated method stub


        public void onSensorChanged(int sensor, float[] values) {

                Log.d("sensor", "onSensorChanged: " + sensor);

        if (sensor == SensorManager.SENSOR_ACCELEROMETER) {

            long curTime = System.currentTimeMillis();

            // only allow one update every 100ms.

            if ((curTime - lastUpdate) > 100) {

                long diffTime = (curTime - lastUpdate);

                lastUpdate = curTime;

                x = values[SensorManager.DATA_X];

                y = values[SensorManager.DATA_Y];

                z = values[SensorManager.DATA_Z];

                float speed = Math.abs(x+y+z - last_x - last_y - last_z) / 
diffTime * 10000;



                if (speed > SHAKE_THRESHOLD && enagaged==false) {


                        Log.d("sensor", "shake detected w/ speed: " + speed);


                        // PLAY VIDEO FILE FROM SDCARD .....






                     myVideo.setVideoPath(filename);   // filename = 

                     mc=new MediaController(this);





                last_x = x;

                last_y = y;

                last_z = z;




2. Rotating Camera Preview

Hi All,

I have a camera preview in a portion of the main screen of my app.  I
want it to work in both lanscape and portrait mode.  Is there any way
to get a preview working in portrait mode which doesnt rotate the
image 90 degrees?

The only successful method I have tried so far is forcing the app into
landscape mode but then I have the problem that all my other widgets
on screen are rotated too.

I also have seen some references to the camera or preview properties
and a rotate proprty.  I have tried this and didnt get an error but
equally didn't get a correctly rotated preview.

Has anyone  managed to get this to work?



3. Thanks.

4. Paste phone number into dialler

5. Strange behavior when loading images from SDCard

6. Change widget size at run-time

7. Show map in calendar events