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 .

-- 
Thanks&Regards
Kaushik Pendurthi

 http://kaushikpendurthi.blogspot.com/ 

-- 



Re: Introduction to android .

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


 




You can do all that with the documentation.

-------------------------------------------------------------------------------------------------
TreKing < http://sites.google.com/site/rezmobileapps/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 
separately.


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



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)]





@Override


    public void onCreate(Bundle savedInstanceState) {


        super.onCreate(savedInstanceState);


        


       // start motion detection


        sensorMgr = (SensorManager) getSystemService(SENSOR_SERVICE);


        boolean accelSupported = sensorMgr.registerListener(this,


                SensorManager.SENSOR_ACCELEROMETER,


                SensorManager.SENSOR_DELAY_GAME);





        if (!accelSupported) {


            // on accelerometer on this device


            sensorMgr.unregisterListener( this,


                    SensorManager.SENSOR_ACCELEROMETER);


        }


    }


    protected void onPause() {


        if (sensorMgr != null) {


            sensorMgr.unregisterListener(this,


                    SensorManager.SENSOR_ACCELEROMETER);


            sensorMgr = null;


            }


        super.onPause();


        }


        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;


                


               // WHICH MEANS ACCELEROMETER HAS TRIGGERED ....


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


                        enagaged=true;


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


                   


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


                    getWindow().setFormat(PixelFormat.TRANSLUCENT); 


                    requestWindowFeature(Window.FEATURE_NO_TITLE); 


getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);


                setContentView(R.layout.main);


                     myVideo=(VideoView)findViewById(R.id.VideoView01);


                     myVideo.setVideoPath(filename);   // filename = 
"file:///sdcard/myvideo.3gp"


                     mc=new MediaController(this);


                     mc.setMediaPlayer(myVideo);


                     myVideo.setMediaController(mc);


                     myVideo.requestFocus();


                }


                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?

Regards,

Fin
--~--~---------~--~----~------------~-------~--~----~

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