tag:blogger.com,1999:blog-340487942024-03-12T15:21:46.700-07:00TipsUnknownnoreply@blogger.comBlogger675125tag:blogger.com,1999:blog-34048794.post-60220500171005608372013-07-05T19:14:00.001-07:002013-07-05T19:14:19.173-07:00The importance of automating test cases<div dir="ltr"><div><div><div><div><div><div>To maintain legacy code for a longer period of time, it is best to write automated Unit testing,<br><br></div> This will maintains product quality from the situation where the fresher/ new developer has added code without understanding.<br> <br></div> In my work environment, Once the code is committed to repository, Hudson server triggers the build, test for automated Unit testing cases. If all the Unit testing cases are passed, then only it will allow us to submit.<br> <br></div> One new guy has modified some code, it is affecting some functionality. This error was captured while running the automated test cases.<br><br></div>In Android to automate test cases, InstrumentationTest Runner is available.<br> <br></div>Example for writing UnitTesting[UT]: <br><br>In case of UT, we can mock objects instead of testing with real object. I encountered the problem in getting an IP address when wifi and wifi direct is on.<br><br></div> <div> So To solve this problem, I mocked the wifi, wifi direct scenario in UT cases, so that it wont never happen again and if some one is modifying the source code, his source code should pass my testcase,Then only he can submit the source code to repository.<br> <br> <br></div><div><br> <br><div><br><br><br><div><div><div><div><div><br></div></div></div></div></div></div></div></div> Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-34048794.post-32539857026256866982013-06-26T09:15:00.005-07:002013-06-26T09:15:27.260-07:00Android App Development 5<div dir="ltr"><br>Reference: Professional Android 2 Application development by Reto meier<br><br><br>1)AIDL<br>2)IPC,Process,Thread<br>3)Bluetooth<br>4)Fragments<br>5)NDK<br><br>You need to use AIDL if you want a class outside of your application's process to access the Service.<br> If you're only using the service from inside your application, you can use a local service.<br><br>Remote procedure calls:<br>========================<br>AIDL:<br><br> In RPC, only methods are exposed.we cannot expose variabls.<br> All RPC methods are synchronous. Calling process gets blocked <br>until the remote method finishes execution.<br> <br>AIDL generated Javainterface is shared between server and client.<br>Server implements java interface. client invokeds java interface methods.<br> <br><br>uses proxy class[stub] to pass values between server and client.<br><br>Server Side steps:<br>=====================<br>1)create the .aidl file & declare RPC interfaces<br>2)AIDL ->generates the java interfaces stub [.java file] from .aidl<br> <br>3)use stub class to implement RPC methods<br> ->Stub class is derived from IBinder interface<br>4)Expose RPC methods via Service<br> -> service will be started if it is a background task<br> -> Here we will bind to the service if it is a interface<br> <br><br> in, out, inout parameters<br><br>Few rules are implementing your interface:<br>=============================================<br>1)client has to call the RPC methods in a separate thread<br>if particular RPC method is taking time or complex calculation <br> 2)No exceptions from RPC methods to caller. It wont be passed to<br>client, handle the exception locally dont throw it to caller<br>3)only methods can be exposed, data cannot be exposed in RPC <br>4)To make the service available to other or make it as public service,<br> we have to add action in intent filter. the client will make use of this action<br>in Intent & start the service.<br><br><br><br>Client side steps:<br>===================<br>0)Stub class is shared across clients<br> 1)Declare the interface variable<br> 2)Implement ServiceConnection interface<br> onServiceConnected(componentName name, IBinder binder)<br> onServiceDisconnected()<br>3)bindService (intent,serviceConnectionObject, flag);//while binding, if the service is not running, <br> it will create the service and bind to it<br> bindService will call bind() method of the service.<br>Once service connected, onServiceConnected() called. We will typecast <br>IBinder object to our interface variable.<br> 4) call the methods on your interface<br>5) To disconnec call Context.unbindService() with the instance of the service connection.<br> ->This will triggers onServiceDisconnected() method will be triggered<br><br><br> <br><br>Bluetooth:<br>=========<br>Range 10 <a href="http://meters.it" target="_blank">meters.it</a> will makes use of MAC address.<br><br>1)setting up bluetooth<br>2)find available devices or paired devices<br>3)connect with the device<br> 4)Transfer data<br><br><br>classes to be used: <br>===============<br>1)BluetoothAdapter<br> ->represents local bluetooth adapter/bluetooth radio<br>2)BluetoothDevice<br>3)BluetoothSocket<br>4)BluetoothServerSocket<br> 5)Bluetooth class<br><br>permission:<br>android.permission.BLUETOOTH<br>android.permission.BLUETOOTH_ADMIN-> modify settings/discovering devices <br><br><br>1)Bluetooth application to take attendance of students in classroom automatically.<br> <br><br><br>Sensors:<br>=============<br>1) measure motion,orientation and various environmental conditions [pressure,temparature,light]<br><br><br>sensor types:<br>============<br>1)Motion sensors<br> acclerometers-> how fast the phone is moving,monitoring device movement<br> gravity sensors-><br> rotational vector sensors-><br>2)Environmental sensors<br> barometers<br> thermameters<br>3)Position sensors<br><br><br>sensor framework android:<br>1) Determine available sensors on a device<br> 2) Determine the sensors capabilities power,range...<br>3) acquire raw sensor data frequency of the data you want[ for every minute...]<br>4) Register and unregister sensor event listeners<br><br><br><br>location,Bluetooth & sensors<br> <br><br>Based on accelerometer, detect whether the phone has fallen or the old person has fallen down...<br>and send the location details to provided contact number as SMS, trigger the call to predefined number and<br>enable the phone<br> <br><br>GPS phones to track the travel buses and its locations from Travels company<br><br><br><br><br>Fragments:<br>============<br> --> Actitvity is a container for views.<br>Fragments<br> - address large screen devices like tablet<br> - introduced Android 3.0 HoneyComb<br> - one or more fragments can be combined to an activity<br> ->mini activities with its own set of view<br> ->can reuse fragments in multiple activities<br> -> multipane UI<br> <br><br><br>Localization of UI resources are important.<br>onCreate()<br>{<br> setcontentview(r.id.abc);<br>}<br><br><br>res/layout/abc.xml-> two fragments for normal phone<br>res/layout-port/abc.xml- can have many fragments<br> Android will decide dynamically at runtime... if it is a portrait mode, it will load<br>the abc.xml from res/layout-port/ path. User doesnt need to add code for it.<br><br><br><br>Lifecycle of a fragment:<br> depends upon the activity. if the activity is paused, all the fragments are paused<br> if the activity is running,all the fragments are running.<br>if the activity is stopped,all the fragments are stopped.<br><br><br>Backstack:...<br> <br><br>Fragment inside Activity:<br> 1)Fragment can be in any ViewGroup<br> <br>DialogFragment, ListFragment, PreferenceFragment, WebViewFragment<br><br>Fragment's onCreateView()->Load the UI layout or create it dynamically.<br><br><br><br>android's Inflate() method will read xml and create UI resources.<br> <br>Dynamically adding fragments to an Activity:<br> 1)via FragmentTransaction<br><br><br>Emulator ->press ctrl+F11 to move to portrait mode in emulator<br><br>Try this<br><br> res/layout/abc.xml-> UI for landscape mode<br> res/layout-port/abc.xml- UI for portrait mode<br><br>FragmentManager,FragmentTransaction classes are important;<br><br><br><br>Localization qualitifier for tablet:<br>1) screen width<br>2) screen size<br><br><br>NDK:<br> =========<br> 1)NDK development in practice<br> c/c++ ->business logic<br> java -><br><br> 1)porting the existing C/C++ source to Android only activity we have to develop it in java.<br> 2)Execution is faster since it is converted to assembly language<br> Skips Dalvik VM, byte code to assembly language code.<br><br>C/C++ functions are invoked from Java via JNI calls.<br><br><br><br>java -> output ->.dex<br>c/cpp=> output ->library<br>Final apk => .dex + library done by NDK tool<br> <br>For Windows, cygwin 1.7 or higher is required to build NDK [binutils,gcc-g++,make,splint]<br><br><br>NDK Project:<br> src-> java files<br> res<br> jni-> .c/.cpp files & Android.mk-> output: library file copied under "lib" folder.<br> jni/Application.mk ->optional <br> <br><br>cd NDKProject<br>NDK-build clean<br>NDK-build <br> =>This will build the C/C++ source code, copy it to libs folder<br> =>After this open the project in eclipse, and compile it to create the apk file <br> <br><br>static block is executed before loading the activity or creating an object.<br><br>static<br>{<br> System.loadLibrary("fileloader"); //for loading fileloader.so<br>}<br><br>JNI function name:<br><br><br> Java_<packageName>_<ClassName>_loadFile()<br><br><br>className-> where we declared the loadFile() as native<br>PackageName-> where the class belongs to<br><br><br>JNIEnv-> from Java environment<br> Conversion of java string to C/C++ string or C/C++ string to java string done by Java environment<br> <br><br>Android.mk:<br>===============<br>LOCAL_PATH->Current project source directory<br>CLEAR_VARS->Earlier variables are cleared<br>LOCAL_MODULE :=fileloader #creates libfileloader.so<br>LOCAL_LDLIBS=>used to specify linking libraries and system libraries<br> LOCAL_LDLIBS := -llog<br><br>BUILD_SHARED_LIBRARY<br>BUILD_STATIC_LIBRARY<br><br><br><br> samsung android reference:<br><br><a href="http://developer.samsung.com/android/samples" target="_blank">http://developer.samsung.com/android/samples</a><br> <br><br><br><br><br><br><br><br><br></div> Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-34048794.post-90758089189094657912013-06-26T09:15:00.003-07:002013-06-26T09:15:18.130-07:00Android App Development notes 4<div dir="ltr">Android Media Apis:<br><br><br>1)Play audio and video with mediaplayer<br>2)Recording audio and video with media recorder<br>3)Recording video and taking pictures using Intents<br>4)Previewing recorded video<br> 5)Taking pictures and controlling camera<br>6)How to get thumbnail ??? through media scanner ???<br><br><br>MediaPlayer:<br>video/audio file can be from <br> 1)sdcard <br> 2)resource [res/raw] - For video file, we cant have it in resource.<br> 3)network [http://]<br> 4)content provider<br><br><br><br>MediaPlayer.create() will internally calls the prepare() function.<br><br><br>To display video, we should add one of the below control:<br><br> 1)VideoView <br> 2)SurfaceView - More control on playback, we can go for surface view<br> we are allowed to increase the volume... <br><br><br><br>without mediaplayer, we can use VideoView.<br>VideoView has inbuilt mediaplayer to manage the playback.<br> <br><br><br>VideoView videoView = (VideoView) findViewById(R.id.surface);<br>videoView.setKeepScreenOn(true); //screen wont be locked.<br>videoView.setVideoPath("/sdcard/test.3gp");<br><br>if( videoView.canSeekForward())<br> {<br> videoView.seekTo(videoView.getDuration()/2); <br>}<br>videoView.start();<br><br><br>videoView.stopPlayback();<br><br> <br><br><br>SurfaceView doesn't have the mediaplayer inbuilt.<br><br><br><br><br> <br>public class videpPlayer extends Activity implements SurfaceHolder.Callback<br>{<br> MediaPlayer mediaPlayer;<br><br> onCreate()<br> {<br> mediaPlayer = new MediaPlayer();<br> SurfaceView surface - (Surfa<br> SurfaceHolder holder = surface.getHolder();<br> holder. <br> }<br> <br> onSurfaceCreated(SurfaceHolder holder)<br> {<br> mediaplayer.setDisplay(holder); //before prepare, call set display()<br> mediaPlayer.setDataSource("/sdcard/test.mp4");<br> mediaplayer.prepare();<br> mediaplayer.start();<br> <br> }<br> onSurfaceChanged()<br>{ <br> //width, height or surface is changed<br>}<br><br> onSurfaceDestroyed(SurfaceHolder holder)<br> {<br><br> mediaPlayer.release();<br> <br> }<br> <br><br>}<br><br><br><br><br><br>2) Audio and Video recording: MediaRecorder<br> <br> Add uses-permissions in AndroidManifest.xml:<br> android.permission.RECORD_AUDIO<br> android.permission,RECORD_VIDEO <br> <br> Add uses-permission for WRITE_EXTERNAL_STORAGE <br><br> 1) Create MediaRecorder<br> 2) InputSources->SetAudioSource(MIC) or SetVideoSource(CAMERA)<br> 3) OutputFormat->setOutputFormat()<br> 4) Encoders ->setAudioEncoder()<br> setVideoEncoder()<br> 5)location of the recorded file->setOutputFile("/sdcard/video.mp4")<br><br> 6) mediaRecorder.prepare()<br> 7) mediaRecorder.start()<br> 8) mediaRecorder.stop()<br> 9) Release media recorder by mediaRecorder.release()<br><br>3)Preview video recording:<br> we have to add surfaceview in XML layout.<br><br><br> MyActivity extends Activity implement SurfaceHolder.Callback<br> {<br> MediaPlayer mediaplayer;<br><br> onCreate()<br> {<br> }<br> <br> onSurfaceCreated()<br> {<br> mediaRecorder.setPreviewDisplay(holder.getSurface()); <br> mediaRecorder.prepare();<br> }<br> onSurfaceDestroyed()<br> {<br> mediaRecorder.release();<br> }<br> onSurfaceChanged()<br> {<br> <br> }<br> <br> }<br><br><br>Pass data to intent using extra like putExtra();<br>startActivityForResult(intent,requestCode); requestCode is used to identify the child.<br> <br><br><br>4) Using intents to record video<br><br> Intent recordingIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);<br> recordingIntent.putExtra(MediaStore.EXTRA_OUTPUT, outputUri);<br> recordingIntent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY,0 or 1); //0 for MMS 1- video<br> startActivityForResult(recordingIntent,RECORD_VIDEO);<br><br><br> we will get the output in onActivityResult()<br><br> onActivityResult(int requestCode,int resultCode,Intent data)<br> {<br> if (requestCode == RECORD_VIDEO && resultCode == RESULT_OK)<br> {<br> Uri recordedVideoPath = data.getData();<br> } <br> }<br><br> This will launch the native video camera activtiy and allow the users to start,stop recording.<br><br><br><br>5) on Emulator,we can record audio.<br> <br> <br> Objective: <br> 1)Create a project to record audio<br> 2)playback the recorded audio <br> 3) <br> <br>5) using intents for image capture:<br> void takeThumbnail(){<br> <br> Intent takingPhoto = new Intent(MediaStore.ACTION.IMAGE_CAPTURE);<br> startActivityForResult(takingPhoto, TAKE_PICTURE);<br> //It will create thumbnails<br> }<br><br><br><br>6) Controlling camera and taking picture:<br><br> 6.1)Add uses-permission android.permission.CAMERA<br> 6.2)Camera class<br> Camera camera = Camera.open();<br> ...<br> camera.release();<br> 6.3) Camera.Parameters params = Camera.getParameters() ;//get existing settings<br> camera.setParameters(params);<br> <br> we can change <br> 6.3.1) SCENE_MODE<br> 6.3.2) FLASH_MODE<br> 6.3.3) WhiteBalance<br> 6.3.4) ColorEffect<br> 6.3.5) focusmode<br> 6.3.5) setJpegQuality(),setJpegThumbnailQuality()<br> 6.3.6) Image, preview and thumbnail size<br> setPictureSize(), setPreviewSize()<br> 6.3.7)Image and preview format:<br> setPictureFormat()<br> setPreviewFormat()<br><br> 6.3.8)setPreviewFrameRate()<br> <br> <br><br>Previewing camera:<br> <br><br>MyActivity implements SurfaceHolder.callback<br>{<br> onCreate()<br> {<br> <br> } <br>}<br><br><br><br>Location based services:<br>==========================<br> <br>Location and Sensors:<br>======================<br>1)Location providers<br> - Location Manager<br> - Location Providers<br><br> Two common location providers:<br> 1) GPS provider <br> *will gives more accuracy than network providers<br> * consume more battery<br> * no cost involved<br> 2) Network providers [ coming from carrier service like Airtel,] [with internet]<br> * need internet connection<br> * pay for carrier service<br> <br> <br>2)obtaining current location<br> Location location= LocationManager.getLastKnownLocation(string.GPS_PROVIDER);<br>3) Proximity alert in android<br> ->once the user enters into another state, we will get alert message like "welcome to tamilnadu from airtel".<br> ->1 km radius of the tamilnadu, location manager triggers the proximity alert.<br><br>4)Ex: Put the proximity alert while travelling...<br> Before entering the radius of the location, proximity alert receiver should trigger <br> alerts<br><br>5)Geocoder:<br> street addresses and map coordinates<br> <br> Forward geocoding->find coordinates of an address<br> Reverse geocoding->finds street address of co-ordinates<br> <br> Latitude of bangalore:12.78<br> longitude :77.56<br><br><br>geocoder class is going to use internet & connect to google server to<br>get address,coordinate conversion<br><br><br><br><br>Google maps API v2:<br>===================<br><br>Process,Thread & IPC:<br> ========================<br> we can specify the service on which process it should run or create a new process for service.<br><br>By default, All the components belong to same process.<br>we can specify the process in AndroidManifest.xml for activity/service/broadcast receiver/content provider.<br> <br><br> when the process will be killed:<br> Android system may decide to shut down the process based on available memory and importancy of process.<br><br>Service:<br> onCreate/onStart/onStop<br><br><br>Thread creation in Activity/service/Receiver.onReceive() should finish within 10 seconds.<br> Java threads can be used for thread creation.<br><br><br>Thread creation:<br> 1)Thread,Runnable<br> 2)AsyncTask [Android]<br> 3)Implement threads and use the Handler class to synchronize with <br> the GUI thread before updating the UI<br> Handler ->synchronization mechanism, update UI thread can be done via Handler.<br> one thread can access another thread via synchronization mechanism.<br><br><br>AsyncTask:<br>============<br> 1)handles thread creation<br> 2)Thread management<br> 3)synchronization<br><br>class myTask extends AsyncTask<InputType, Progress,Result><br><br> if we dont want progress, make Progress as void.<br><br>String ... parameter - > Array of Strings in Java<br> <br>class myTask extends AsyncTask<String, Integer,Integer><br>{<br> protected Integer doInBackground(String ... parameter) //parameter is inputtype, return value is Integer specified in AsyncTask<br> {<br> //Called in New Thread<br> //Dont have access to UI thread<br><br><br> int progress =0;<br> PublishProgress(progress);<br><br> return result;<br> } <br><br> onPostExecuted(Integer result)<br> {<br> //called on Main thread or UI thread<br> //This will be called after we returned result from doInBackground();<br> //whatever doInBackground() function returns, it will be available in the onPostExecuted() fn argument "result".<br> //can access UI elements <br><br> } <br> onProgressUpdate()<br> {<br> //Called on UI/main thread<br> //can access UI elements <br> //This will be called once PublishProgress() is invoked <br> <br> } <br> <br>}<br><br><br><br>Executing an asynchronous tasl:<br><br> new MyAsyncTask.execute("inputString1", "inputString2");<br> <br><br>execute()-> will create the new thread automatically,doInBackground() will be called<br> <br><br><br><br>Handler mhandler = new Handler();<br><br>child Thread or Runnable's Run()<br> {<br> mHandler.post(doUpdateGUI); <br> } <br><br>Runnable doUpdateGUI= new Runnable()<br>{<br> public void run() {<br> //access or update UI elements<br> } <br> <br>}<br><br><br><br>Advantages of Java thread :<br>======================<br> 1)we can schedule your threads using timer <br> 2)we have more control in threads<br> 3)Synchronization is our responsibility<br> AsyncTask doesnt have the access to thread control.<br> <br><br><br></div> Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-34048794.post-63375603251940455082013-06-26T09:15:00.001-07:002013-06-26T09:15:04.822-07:00Android App Development notes 3<div dir="ltr">DataStorage:<br> persistent storage of data<br><br>persistent storage:<br> 1)Shared preferences- stores key value pair in xml<br> can save states of UI or UI data <br> Limit:Only primitive datatypes [booleans,floats,ints,<br> longs and strings]<br> getSharedPreferences(filename,mode)->can be shared by other activities & and other activities<br> getPreferences()->cant be used by other activities<br> <br> Ex:read from the preferences:<br> SharedPreferences prefs = getSharedPreferences("UserFilename",0); <br> boolean bSignIn = prefs.getBoolean("staySignIn",false);//false is the default value if the value doesnt exist<br> <br> write to preferences:<br> onStop() fn:<br> SharedPreferences prefs = getSharedPreferences("UserFilename",0); <br> prefs.putBoolean("staySignIn",bSignIn);<br> prefs.commit();//To store the value <br> <br> xml file path:data/data/com.app/shared_prefs/UserFilename.xml <br> once we uninstall application, shared_preferences file will be deleted.<br> 2)Internal Storage<br> -Save files directly on the device's internal storage<br> <br> 3)External storage<br> <br> 4)SQLite databases<br> Helper classes: SQLiteOpenHelper,SQLiteDatabase,Cursor<br> Any DB<br> 4.1) Create DB<br> 4.2) Create table with schema<br> 4.3)Insert,Update,Delete,query<br> <br> 4.1,4,2 can be performed by SQLiteOpnenHelper class<br> 4.3 can be performed by SQLiteDatabase class <br><br> It will create data/data/com.app/shared_prefs/UserFilename.db. we can pull it from device<br> and can see the data using any SqlReader.<br><br><br><br><br>ContentProviders -required to make your DB as public<br> -access to contacts possible by contacts contentprovider<br><br>Implement new content provider:<br> =================================<br> 1) set up system for storing the data with SQLiteOpenHelper & SQLiteDatabase to manage DB operations<br> 2) Extend the ContentProvider class to provide access to the data<br> 3) Declare the contentprovider in AndroidManifest.xml<br> <br><br> ContentProvider implementor, ContentProvider client<br><br> ContentProvider client refer via Content URI. Ex "content://contacts/people"<br><br><br> content://com.example.transportationprovider/trains/122<br> <br><br> content://-standard prefix<br> com.example.transportationprovider - authority part of URI, identity of DB, it identified the content provider<br> trains - identifier of table name<br> 122 - rowid of the table<br> <br> Declare the contentprovider in AndroidManifest.xml:<br> <provide name= "TransportationProvider" authorities="com.example.transportationprovider" ... ><br><br><br>Ex:<br> android.provider.ContactsContract.Contacts.CONTENT_URI<br> <br>ContentProvider must implement<br> 1)query(Uri...) - From this URI, it has to identify which table client requires...<br> 2)Insert()<br> 3)update()<br> 4)delete()<br> 5)getType()<br> 6)onCreate()<br><br><br>ContentProvider client use ContentResolver class.<br> <br> ContentResolver cr = getContentResolver();<br> cr.query(CONTENT_URI,...);<br> cr.insert(CONTENT_URI...);<br> <br>From CONTENT_URI's authority, it will find out which class & perform query() or insert()... operations.<br> <br><br><br><br>Querying a contentprovider:<br><br>For querying a contentprovider, ContentProvider Client requires 3 information;<br> 1)what is the content_URI of ContentProvider<br> 2)Column names of ContentProvider<br> 3)what are all the datatypes of ContentProvider<br> so that he can decide whether to use cursor.getString or cursor.getInt() or cursort.getBoolean()<br><br> 1) ContentResolver.query()<br> 2) Activity.managedQuery()<br> - Best practice is invoking managedQuery() from Activity. so that cursor will be aligned to<br> lifecycle of an activity<br><br>Uri insertedRowIdUri= contentResolver.insert()//returns the URi of row id<br><br>To delete the row,<br> contentResolver.delete(rowIdUri)<br>Delete multiple rows:<br> contentResolver.delete(condition);<br><br> <br>MediaStore is a content provider to acccess multimedia.<br><br><br>SQLiteDatabase.query() has where class and selectionArgs;<br> <br>we can give our conditions like this in where clause;<br> <br><br> String where = "username='sundar'";<br> or<br> String where = "username='" + stringSundar+"'";<br> <br>If we have multipe where conditions, do the following:<br> String where = "username=? AND password=?";<br> String selectionArgs[] = {"sundar","password"};<br><br>& pass it in query( ...where,selectionArgs...);<br> <br><br><br><br><br>Security in Android:<br> 1) it is above Linux. it has all features like one process cannot access another process's memory<br> 2) permissions {READ_CONTACTS, internet permission};<br> while instlallation, if that application is using CONTACTS or <br> when we allow, the permission is granted and APK will be installed.<br> permission is granted during installation time by package installer.<br> uses_permission tag.<br> we can also create new permissions using permission tag.<br> <br> 3) Every Android App. should be signed with digital certificate<br> [Application signing is must]<br> <br><br>How to sign the application in Android:<br>1) we can create our own digital certificate [self signed certificate]<br> 2) Normal application is certified with debug certificate.<br> otherwise it wont run in emulator<br>3)To release it in google playstore, we should not use debug certificate.<br><br> 3.1)Create private and public key [keystore]<br> 3.2)sign application with certificate<br> <br> <br> <br> <br> <br><br>if we want to make my activity public, we have to declare IntentFilter for that activity.<br><br><activity name ="sundar"><br> <Intent-Filter><br> <action name = "com.sundar.app.sundar"> <br> <category = DEFAULT> //without DEFAULT category it is not working.<br> <data><br><br><br>if anyone trigger/send this action "com.sundar.app.sundar", the activity "sundar" will be launched.<br> <br><br>permission = normal -> autogranted during installation<br> dangerous ->request the user response while installation<br> Signature -> if two activities have the same certificate,one activity can access another activity<br> or the inbuilt application.<br> secure system functions, our activity, service,contentprovider and broadcast receiver by<br> including android:permission attribute.<br> <br><br> <br> <br>Sign certificate in the application:<br> 1) File->export->Export Android Application->Select the application<br> 2) select create new keystore <br><br>if my application validity will expire tomorrow, what will happen if I installed my application today ? will it run <br> or it wont run?<br><br>Android application validity,<br>Multiple applications can have the same keystore.<br>Certificate validity is checked at the time of installation only. not every time it is running.<br>So if I have installed today, it will run fine tomorrow also. Tomorrow if any device is trying to install<br> it, it wont install because of validity expiration.<br><br><br><br>if we have not added uses-permission for reading contacts, if we try to read contacts,<br>it will give security exception and show force close dialog.<br> <br><br>How to secure public activity:<br>==============================<br> using permissions.<br>Server application has to create the permission using permission tag to allow access the activity.<br>Client application should use uses-permission tag to launch the server application's activity.<br> <br> <br><br><br><br>While creating the permission, the user should add it as signature level permission. so that the created permission<br>can be accessed<br><br><br>Resources:<br>============ <br> 7 primary resource types;<br> 1) Simple values - /res/values/<br> - R.<resource type>.<name of resource><br><br> Externalizing strings helps to localize it <br> Reuse it easily<br> <br><br> 2) Drawables - <br> 3) Layouts<br> 4) Animations<br> 5) Menu<br> 6) Styles<br> 7) Raw<br> 8) XML<br><br> Resource files should contain lowercase letters,numbers,peroids(.) and underscores (_).<br><br> Resource inside resource access can be done by @<ResourceType>/<ResourceName>.<br> <br><br>Animation:<br>===========<br> 1)Tweened animation<br> -ops:rotate,stretch,move,fade<br> 2)Frame animation-> sequence of animations in order<br><br><br>Menu XMLs can be loaded by MenuInflater class.<br> <br><br><br>Resources:<br>=============<br><br>ResourceType ResourceName<br><br><br>filename as resourceName<br> layout<br> drawable<br> menu<br> animation<br><br>name as resourcename<br> string <br> color<br> dimen<br> styles<br><br><br>Resources can be accessed by<br> 1) R.in java code<br> 2) in XML<br> @<resourceType>/<ResourceName><br><br><br>AAPT will create R class.<br><br> For each resource type, there is a subclass in R class.<br> <br> Syntax:[packagename.]R.<resource_type>.<resource_name><br><br><br>Resource res = getResources() //get resources object<br><br>String[] planets= res.getStringArray(R.array.planets_array);<br>String title = res.getText(R.string.main_title); <br> <br><br><br>if we are using resource in another resource,<br><br> syntax:@[packagename:]resourceType.resourceName<br><br>Native resources can be found from android.R class.<br><br>Localization:<br> res/values/strings.xml<br> res/values-fr/strings.xml<br> res/values-fr-rCA/strings.xml<br><br><br><br> <br> <br><br> <br><br> <br><br></div> Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-34048794.post-51769373884114713802013-06-26T09:14:00.001-07:002013-06-26T09:14:07.650-07:00Android App Development 2<div dir="ltr">Steps to add new activity in Android Application:<br><br>Register the activity in AndroidManifest.xml.<br>finish() is used to close the activity.<br> <br><br><br><br>1) Activity which has launcher category and MAIN action <br> will be showed on screen first.<br>This is called the main activity.<br><br>2) Menu<br> Menu items can have shortcuts or icons with text.<br> Icons are supported only in first 6 items.<br><br>By pressing menu button,menu will be displayed.<br> <br> 2.1) options menu - 6 items are supported in single screen<br> - if we have more than 6 items, last item will be shown as more... <br> - while clicking more, it will show expanded menu <br> Options menu belongs to Activity.<br> <br> If we want to add options menu in our activity:<br> we have to implement the following:<br> while clicking menu key, onCreateOptionsMenu() fn will be invoked.<br> <br> 1) onCreateOptionsMenu() returns true menu will appear on screen<br> returns false menu wont appear on screen<br> 2)onOptionItemSelected() - if we handled the selected menu item, return true<br> if we have not handled the selected menu item,return false.the base class version of<br> onOptionItemSelected() will be invoked<br> <br> <br> <br> menu.add(groupid,ItemId,order,menuText)<br> <br><br> <br> 2.2) context menu<br> - will be displayed if we do long press on any view<br> - belongs to the view<br> - register the view by registerForContextMenu<br> - Dont have support for icons or shortcuts<br> implement:<br> onCreateContextMenu() <br> onContextItemSelected()<br> <br> 2.3) SubMenu<br> - part of another menu item<br> - it can be options menu or <br> context menu<br> - submenu is supported only one level...<br> Nested submenus are not supported<br> implement:<br> onCreateOptionsMenu()<br> SubMenu fileMenu =menu.addSubMenu("File"); <br> SubMenu editMenu = menu.addSubMenu("Edit");<br> fileMenu.add(itemId,"new");<br> fileMenu.add(itemid,"open");<br> <br> <br><br>Develop sample application for context menu and submenu.<br><br>Notifying user:<br>===============<br> 1)Toast notification<br> - no user interaction<br> - used from activity or service<br> - Acivity stills active while displaying toast & responsive<br> - Doesn't accept interaction events<br> 2)StatusBar notification<br> - Persistent reminders<br> - alert remains as long as user have not seen or visited it<br> - need interaction from user<br> - Ex: SMS, low battery,download status, once content is downloaded, download complete notification<br> - used from activity or service<br><br> it requires:<br> -icon for the status bar<br> -title,expanded message, expanded view<br> -Pending intent triggered to launch the application or activity<br> -on user action, we can launch activity or service or broadcast receiver<br> <br><br> 2.1)Get a reference to the notification manager:<br> NotificationManger mNotificationMgr=(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);<br> 2.2)Create notification:<br> String tickerText = "hello";<br> Notification notification= new Notification(R.drawable.ic_launcher,tickerText ,System.currentTimeMillis());<br> 2.3)Define the notification's expanded message and Intent:<br> //wrap the intent object inside pending intent<br> Intent notificationIntent= new Intent(this,Myclass.class);<br> PendingIntent pendingIntent = PendingIntent.getActivity(this,0,notificationIntent,0);<br> notification.setLatestEventInfo(this,contentTitle, contentText,pendingIntent);<br><br> For service:<br> PendingIntent.getService()<br> For broadcast:<br> PendingIntent.getBroadcast()<br> <br> <br> 2.4)Pass the notification to Notification manager<br> mNotificationMgr.notify(notificationId,notification); <br><br> once application is launched, clear the notification in system. <br> <br> <br> who will trigger the pending intent in notification ???<br> It will be done by Notification manager.<br><br><br> 3)Dialog notification<br> - used only from activity <br> - Current Activity will be in Pause state<br> - AlertDialog<br> - max. selectable 3buttons<br> - buttons appear on dialog bottom<br> - checkboxes or radio buttons allowed<br> -<br> <br> - ProgressDialog<br> - DatePickerDialog<br> - TimePickerDialog<br><br> Add dialog to activity:<br> 1) implement onCreateDialog(dialogId)[create & return dialog] <br> Every dialog has its own unique id.<br> Called only once<br> <br> 2)when we want to display a dialog<br> call showDialog(dialogId);<br> showDialog internally calls onCreateDialog(withIdArg)<br> 3) remove dialog can be done by removeDialog();<br> <br> AlertDialog.Builder class can be used to configure the dialog properties.<br> By default all dialogs are cancelable.<br><br><br><br><br> Two types of dialog box:<br> 1) Spinning wheel dialog- Dont know when it will end we will go for the spinning wheel dialog<br> 2) Progress dialog - know when the task will end<br> For download status, we are sure when download will end.<br> horizontal<br><br>Spinning Wheel dialog:<br> <br> boolean iscancelable= true;<br> ProgressDialog pDialog = ProgressDialog.show(MyActivity.this,"","Loading please wait..",isCancelable);<br> when everything ends, <br> call progressDialog.cancel()...<br><br> <br>Horizontal dialog:<br> <br><br><br>Adapters and Adapter views:<br>=============================<br>Adapter <br> 1)provides data to AdapterView [listview,gallery,spinners];<br> 2)responsible for making a View for each item<br> <br>Two types of adapter:<br> 1) array adapter <br> 2) cursor adapter <br> <br>Adapter:<br> 1)supply data<br> 2)handles UI view<br><br> listView.setAdapter() <br><br>Adapter base class:BaseAdapter<br>ArrayAdapter - Array data<br>SimpleCursorAdapter - handle database related data<br> <br><br>Intent:<br> -message passing mechansism that workes both within application and between applications<br>Types of intents:<br> 1) Explicit intent- launching the activities of same application <br> 2) Implicit intent -launch the activity of other application<br> <br><br><br>Example for implicit intent:<br> Intent i = new Intent(Intent.ACTION_DIAL,Uri.parse('tel:555-1234"));<br> startActivity(i);<br><br>Explicit intent syntax:<br> Intent i = new Intent(Action, data)<br> Action - mandatory<br> data - optional<br><br> It will find out the activity which can perform the ACTION on that data.if it finds the activity,<br>it will launch activity. <br><br> Resolving implicit intent at runtime is called as Intent resolution.<br> <br><br>Android registry:<br>====================<br> contains classname action and datatype.<br><br>At run time, it looks into the registry & decide which activity launch.<br>If multiple activities can perform the same action, Android will popup the dialog to user for selecting the right application.<br> <br>If there are no application match found, then it will crash and give force close dialog.<br><br><br>Any ways to update Android registry??<br><br><br>Native android actions:<br> ACTION_ANSWER<br> ACTION_DIAL<br> ACTION_EDIT - Activity that can edit data specified in the intent<br> ACTION_PICK - pick an item from the content provider in the intent<br> ACTION_VIEW-Activity that can view data specified in the intent<br> ACTION_SENDTO<br> <br>Contacts DB is exposed publicly to others by content providers.<br> <br>Intent i = new Intent(ACTION_VIEW,Uriparse("<a href="http://google.com" target="_blank">http://google.com</a>"); #launch the browser<br><br>Intent i = new Intent(ACTION_VIEW,Uriparse("tel:123456");#???<br> <br><br> From parent activity, we can get child activity information if<br><br> 1)child activity launched with startActivityForResult()<br> 2)Once the child activity is closed, it will triggers the parent activity's<br> onActivityResult()<br> requestcode let us know from which child activity, we are getting results<br><br> <br>IntentFilter:<br>===============<br> intentfilter contains<br> 1)action<br> 2)category<br> 3)data<br><br> Activity.Action<br> <br><br>In AndroidManifest.xml<br> <data androidscheme="abc" /><br><br>During installation, Android manifest file is checked. Installer will update the android registry.<br>Activity without intentfilters, we can say without private Activity which can be launched only from that application.<br> <br>Activity with intentfilters can be accessed from any application.<br><br><br>refer OpenIntents.org defines the already available intents from other apps in google play or playstore.<br><a href="http://openintents.org" target="_blank">openintents.org</a><br> <br>Broadcast Receiver:<br>===================<br> Android uses broadcast intents to broadcast system events like battery low,battery level, network connections etc<br><br> Intent i = new Intent(action);<br> sendBroadcast(i);<br> <br> i-Broadcast intent<br> action-Broadcast action<br><br><br> Mainly used from services<br><br>Native Android Broadcast Actions:<br> Android broadccasts intents for many of the system services primarily to<br>track device status changes.<br> <br> <br>1)ACTION_BOOT_COMPLETED<br>2)ACTION_CAMERA_BUTTON<br>3)ACTION_MEDIA_MOUNTED<br>4)ACTION_MEDIA_EJECT<br>5)ACTION_DATE_CHANGED<br>6)ACTION_TIME_CHANGED<br><br>Time limit in onReceive() is 10 seconds.<br><br>Two types of broadcast:<br> 1)order broadcast<br> based on highest priority<br>2)<br><br>Broadcast is not visible to user whereas status bar notification is visible to user.<br><br>In AndroidManifest.xml, register the broadcast action for broadcast receiver.<br> <br>Static registration<br><br><br>Register by code:<br>===================<br>Dynamic registration of broadcast receiver:<br><br>if register it in code, usually add it in OnCreate() of launcher activity.<br><br>IntentFilter filter= new IntentFilter("com.test.action.newLocation");<br> LocationUpdater recvr= new LocationUpdater();<br>RegisterReceiver(recvr,filter);<br><br><br>Unregister by code:<br>=================<br>unregisterReceiver(recvr); #if forgotten, it will give <br><br><br>Diff static registration and dynamic registration:<br> ===================================================<br><br>static registration:<br> If my application is not available, it will be able to receive broadcast action<br> Ex; BOOT_COMPLETED<br><br>Dynamic registration:<br> ====================<br> If my application is not available, it wont be able to receive broadcast action<br><br>For system events, go for static registration.<br>For Application specific events, go for dynamic registration.<br> <br><br>Same BroadcastReceiver can be used to register for multiple broadcast intents;<br><br><br> In onReceive()<br>{<br> string action= intent.getAction();<br> if(action == BOOT_COMPLETED)<br> {<br> handleBootCompleted(); <br> }<br> else if(action ==BATTERY_LOW )<br> {<br> handleBatteryLow();<br> }<br> <br>}<br><br><br>Service:<br>===========<br>two ways of service:<br> 1)background and long running task & No UI<br> 2use service as interface [IPC]<br>======> AIDL<br><br><br>Activity and Service is running in the same thread.<br>while launch a service, new thread will not be created.<br>Service is not a separate process, it is belonging to the activity process and running in the same thread.<br> <br><br>Service:<br> 1)Create service class<br> 2)register the service in AndroidManifest.xml<br> 3) if you want to make it public, register the intent filter for the service so that others can use ur service<br><br><br> <br>Creating a service:<br> 1)startService & stopService<br> 2) In case of interface or IPC, use bindService(), unbindService() fn<br><br><br> single service instance used for serving multiple applications.<br>if one application is using the service, onCreate() onStart() is called.<br> Second application is creating the service, then it wont call onCreate(), onStart() will be called repeatedly.<br><br><br>Always create thread<br><br>1)less chance the service will get killed compare to background process<br> 2)Even though the activity will be killed, still the service will run in background<br><br><br>Actvity will start the service.<br>Service will broadcast the receiver.<br>Activity will receive the broadcast.<br> <br> <br><br> <br> <br><br> <br><br><br><br><br><br><br><br><br></div> Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-34048794.post-55557946902311555672013-06-26T09:13:00.001-07:002013-06-26T09:13:52.562-07:00Android App Development<div dir="ltr">1)TVS motors-mp3 player in android for indonesian client<br>2)Samsung has printer with android os<br>3) GE healthcare scanning - with android Os<br>4) ATM also has android OS<br><br>Windows Phone or iOS is tightly coupled with OEMs/manufacturers.<br> <br><br>Advantages:<br>1) Google map applications<br>2) Background services and applications { ex: image download in background}<br>3) Shared data and Interprocess commn<br>4) All applications[in-built application/third party app. no difference] have all apis.<br> <br>if we want to make our DB public, we have to implement content provider , so that others can make use of it.<br><br>Application framework - List of classes & APIs available for developers <br><br>dvm:<br> -Allows multiple instances of virtual machine<br> -less Binary size<br><br> java -> .class -> .dex <br> .apk -> dex + resources<br> <br><br> accelerometer-> rotation,tilt motion sensors<br><br>Idea:<br> Set training mode in mobile,when the user is calling<br> the caller should receive message/voice message about the user's scenario.<br><br><br><br> while pressing BACK button, by default it will goes to previous activity.This is done by Activity manager.<br>Activitymanger has backstack to perform this.<br> <br><br>View manager does the drawing job/control or draw the views[button/combo box any control] on screeen.<br><br>Any code apart from java is called as resource.Ex. XML,photo,image,audio/video<br>Via Resource manager, we will access the resources <br> <br><br>Android Application:<br><br>Package manger name should be unique.<br>while creating the process by android kernel, it will makes use of package name as identifier.<br>So no two applications should not have the same package name.<br> <br><br><br><br>gen folder- autogenerated files are available in this folder.<br><br><br>Entry point for the Android application is who has action.MAIN in androidmanifest.xml<br><action android:name="android.intent.action.MAIN" /><br> & LAUNCHER flag.<br><br>During installation, AndroidManifest.xml is checked. if the minSDK criteria is not satisfied application wont be installed.<br><br><br><br><br><br>Android Application blocks:<br>==============================<br> 1)Activity-Single Screen<br> 2)BroadCastReceiver- to receive external events<br> 3)Service<br> 4)ContentProvider<br><br>Except broadcast reciever, we must register it in AndroidManifest.xml.<br><br><br> Difference between actions and broadcast receivers?<br> Diff service and midl service?<br><br> Intent,action<br><br> <br>Activating components:<br>=======================<br> Intent can<br> i) start an activity [startActivity(new Intent(this,NewActivity.class));]<br> ii) start a service [Context.startService() ]<br> iii)can send broadcast[context.sendBroadcast() ..]<br><br> Activity class is derived from context. So whenever context is needed, we can use Activity object or Activity's this pointer.<br><br><br><br> <br>Shutting down components:<br>==========================<br> <br> 1) ContentProviders and broadcastReceivers - No need to shut down explicitly shutdown<br> 2) Shutdown activity<br> finish() or finitshActivity() [Parent activity will call finishActivity() of child activity]<br> <br> 3)Shutdown service<br> - Context.stopService() or stopSelf()<br> <br><br><br>Lifecycle of an android application:<br>=======================================<br> process's lifetime is not controlled by the application itself.<br> Android will decide when to kill or stop process.<br><br>The order of killing processes will be decided by<br> 1) How mportant [importance hierarchy]<br> 2) memory need<br><br>Importance hierarchy:<br> 1)Foreground process- visible to user and having focus<br> 2)Visible process - visible to the user but not having focus. [onPause state] Activitylaunches the dialog. Activity is visible but not focus.<br> 3)Service process - not visible to user. it is in running<br> 4)background process- not visible to the <a href="http://user.it" target="_blank">user.it</a> is in stopped state.<br> 5)Empty process - doesnt hold any acctive application components[as a cache to improve startup time] <br><br>First android will try to kill empty proces, background process...foreground process until required memory is available.<br> <br>aapt is used to construct apk file.<br><br><br>State of activity:<br>==================<br>1)Running -focused screen<br>2)Paused - visible to user but not focused<br>3)Stopped- not visible to user and it is in stopped state.<br> 4)Inactive - when we finish() activity, it will goes to Inactive<br><br>Callbacks of activity:<br>========================<br>OnCreate()<br>onStart()<br>onResume()<br>OnPause()<br>OnStop()<br>onDestroy()<br>onRestart()<br> <br><br>onPause() & onStop() will be called if activity is going to stopped state.<br><br><br><br>finish() activity will invoke<br> 1)onPause<br> 2)onStop()<br> 3)onDestroy() <br><br><br>Save your user data to persistent storage in onPause() .<br> Load your user data to persistent storage in onResume(). <br><br><br>Lifecycle methods:(onPause/onResume...)<br><br>For all lifecycle methods, we should call super version of it.<br><br> ex:<br> onPause()<br> {<br> super.onPause()...<br> }<br><br><br>Activity manager is responsible for handling acitivity's lifecycle.<br><br><br><br><br>while launching activity-> onCreate(), onStart() ,onResume()<br>pressed HOME button -> OnPause(),OnStop()<br> <br><br>UI is based on View and ViewGroup classes.<br><br>SetContentView(R.id.activity_main);<br><br>It is loading activity_main.xml file for displaying UI content.<br><br>ViewGroup->View or ViewGroup...<br><br><br><br> Through DDMS's Emulator control, we can make a call or SMS to emulator. Try it...<br><br>Layout:<br> FrameLayout: pins each child view to top left corner<br> --->add controls dynamically this will be used<br> LinerarLayout-aligns each other in either vertical or horizontal<br> Relativelayout-defines position of each view relative to others and to the screen boundaries<br> rightof, leftof,below,above <br> TablelLayout - lays out view using grid of rows and columns<br> Gallery - displays single row of items in horizontal scrolling list<br><br><br><br>We have to implement onTouch or OnClick ? what is the best practice??<br><br>Android best practice is always assume that there is a keyboard.<br> If touch listener is not available, android will convert the touch listener to click listener.<br><br><br>So as a practice, we have to implement onClick().<br><br><br><br>Adding new activity:<br><br> 1) Create XML UI layout [/Res/layout/auth.xml]<br> 2) Create activity class & setContentView(xmlUILayout);<br> 3) Register the activity in Androidmanifest.xml<br><br></div> Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-34048794.post-47878505401400427562013-01-16T07:36:00.001-08:002013-01-16T07:36:42.168-08:00<div dir="ltr" style="text-align: left;" trbidi="on">
Nice Article about Improvise/adapt/overcome: <br />
www.peakprosperity.com/blog/improvise-adapt-overcome/52001</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-34048794.post-85262904320550739472012-12-19T09:38:00.004-08:002012-12-19T09:38:43.557-08:00<div dir="ltr" style="text-align: left;" trbidi="on">
How to check whether the TV remote control's battery drained or not ?<br /> If the battery power is good,It will emits Infra Red rays. We can't see infrared rays normally.There is a way to see <br />this infrared rays. How???<br />Place the remote control's Infra red LED facing to the mobile camera, run the mobile camera in preview mode and press the keys in remote.<br />See the mobile camera's preview. If the battery charge is good, Infra red LED will emits light </div>
Unknownnoreply@blogger.com4tag:blogger.com,1999:blog-34048794.post-71195434234127805762012-12-12T10:30:00.000-08:002012-12-12T10:30:21.503-08:00<div dir="ltr" style="text-align: left;" trbidi="on">
<br /><br />Competition Sites:<br />1) ACM ICPC<br />2) codeforces<br />3) topcoder<br />4) codechef<br />5) google code jam<br />6) Saratov university [espl for tricky testcases]<br /><br /><br />To do:<br />===========<br />0) Study and practice<br />1)Always read a chapter from algorithm and do problems in book<br />2)Solve the related problems in contest sites<br />3)Solve the related problems available in all text books<br />4)Always choose hard problems and try to solve it...<br />5)Solve interview problems related with it<br />6) Read topcoder articles and solve problems related with it...<br /><br /><br /><br />1) Trees<br />http://codeforces.com/problemset/tags/trees<br />2) Graphs<br />http://codeforces.com/problemset/tags/graphs<br /><br />3) Datastructures<br />heaps,segment trees,BST, HashTable<br />http://codeforces.com/problemset/tags/data%20structures<br /><br />4)Expression Parsing<br />http://codeforces.com/problemset/tags/expression%20parsing<br /><br />5) Hashing <br />http://codeforces.com/problemset/tags/hashing<br /><br />6) strings<br />http://codeforces.com/problemset/tags/strings<br /><br />7) string suffix:<br />http://codeforces.com/problemset/tags/string%20suffix%20structeres<br /><br /><br />8) greedy<br />http://codeforces.com/problemset/tags/greedy<br />9) dynamic programming problems list:<br />http://codeforces.com/blog/entry/325<br />http://codeforces.com/problemset/tags/dp<br />10)Divide and conquer<br />http://codeforces.com/problemset/tags/divide%20and%20conquer<br /><br /><br />11) Mathematics<br />http://codeforces.com/problemset/tags/math<br />12)geometry<br />http://codeforces.com/problemset/tags/geometry<br />13) probablilities<br />http://codeforces.com/problemset/tags/probabilities<br /><br />14) combinatorics<br />http://codeforces.com/problemset/tags/combinatorics<br /><br />Above are from codeforces...<br />Below are from topcoder<br />15.Recursion<br />16.sorting<br />17.String manipulation/string parsing<br />18.Encryption and compression<br />19.advanced math<br />20. sortings..<br />21.maze<br />22.BackTracking<br />23.Maximum flow problem<br /><br />Best resources for competition programming preparation:<br />http://problemclassifier.appspot.com/<br />http://emiraga.wikispaces.com/Problems+by+topics<br />https://github.com/BrockCSC/acm-icpc/wiki/Online-Resources<br />http://www.stanford.edu/class/cs97si/<br />http://webcourse.cs.technion.ac.il/234900/Spring2012/en/ho.html<br /><br /><br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-34048794.post-24526723365549056582012-12-10T09:59:00.002-08:002012-12-10T09:59:40.524-08:00<div dir="ltr" style="text-align: left;" trbidi="on">
What I have done and what I have learnt from comptetition problems:<br /><br />From Codeforces,I solved the following problems:<br />
<br />1) Files list<br /> Previously in OS or c program, we can have 8 characters filename and 3 characters for extension.<br />I felt that design in this problem<br /> http://codeforces.com/problemset/problem/174/B<br /><br />2)cd and pwd commands<br />http://codeforces.com/problemset/problem/158/C<br /> From this problem, I learnt that how we can implement cd and pwd commands in shell.<br />How it will remembers the user's present working directory especially the user is doing cd ..<br /><br />3)BHTML & BCSS<br />http://codeforces.com/problemset/problem/172/E<br /><br /> From this problem, I learnt that How css is applied with HTML tags. How we can highlight the tags with user's choices.<br /><br />4)Simple XML<br />http://codeforces.com/problemset/problem/125/B<br /><br /> From this problem I learnt that How XML tags can be aligned or C/C++ source code is aligned based on {} brackets in editor<br /><br />5)try... catch problem<br />http://codeforces.com/problemset/problem/195/C<br /><br />From this problem, I learnt how compilers will execute exceptions with try ... catch blocks<br />It is one of awesome reallife problem.<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-34048794.post-9113102154240748252012-12-10T09:40:00.001-08:002012-12-10T09:40:42.175-08:00<div dir="ltr" style="text-align: left;" trbidi="on">
<br />How to change android system volume Up/Down ???<br />
<br /> Through AudioManager, we can set the volume up/down.<br /><br /><br />Today I faced this issue while working with media-volume-control<br />1)http://stackoverflow.com/questions/8446337/how-to-solve-error-this-attribute-must-be-localized-at-text-with-value-top<br />2) R.java:10: duplicate class error<br />
I just removed the R.java and compilation is going smooth<br />
<br />3) How to copy the eclipse project into android source code and compile it ???<br /> copy the application project into android source code's packages/apps/ folder<br />within the application project,Add Android.mk with below contents:<br /><br /> LOCAL_PATH:= $(call my-dir)<br /> include $(CLEAR_VARS)<br /> LOCAL_MODULE_TAGS := optional<br /> LOCAL_SRC_FILES := $(call all-subdir-java-files)<br /> LOCAL_PACKAGE_NAME := VolumeControl_S #Target package name<br /> include $(BUILD_PACKAGE)<br /><br /> From android folder give source build/envsetup.sh,lunch and then<br /> cd to packages/apps/yourApplication/ and give mm command. This will build the application code & create the APK file.</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-34048794.post-67404245727016261432012-12-04T10:04:00.001-08:002012-12-04T10:04:40.289-08:00<div dir="ltr" style="text-align: left;" trbidi="on">
Problems faced while compiling android application with old version to ICS/JB:<br />
<br />
1)http://stackoverflow.com/questions/8446337/how-to-solve-error-this-attribute-must-be-localized-at-text-with-value-top<br /><br />2) I got Android APK compilation Error: R.java:10: duplicate class<br />
<br />
Solution: I just removed the R.java file and compilation is going smooth<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-34048794.post-43715123604958499962012-12-04T10:01:00.002-08:002012-12-04T10:01:46.285-08:00<div dir="ltr" style="text-align: left;" trbidi="on">
How to copy the eclipse Android Application project into android source code and compile it ???<br />
<br /> copy the application project into android source code's packages/apps/ folder<br />within the application project,Add Android.mk with below contents:<br /><br /> LOCAL_PATH:= $(call my-dir)<br /> include $(CLEAR_VARS)<br /> LOCAL_MODULE_TAGS := optional<br /> LOCAL_SRC_FILES := $(call all-subdir-java-files)<br /> LOCAL_PACKAGE_NAME := VolumeControl_S #Target package name<br /> include $(BUILD_PACKAGE)<br /><br /> From android folder give source build/envsetup.sh,lunch and then<br /> cd to packages/apps/yourApplication/ and give mm command. This will build the application code & create the APK file.<br /><br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-34048794.post-71096072208681781162012-12-04T10:00:00.001-08:002012-12-04T10:00:12.097-08:00<div dir="ltr" style="text-align: left;" trbidi="on">
ICS features:<br />
<br />
From ICS onwards, Android by default handles Keyboard/mouse input events... No need to do anything extra to make it work...<br />
<br />
<br />
<br />
To know more about how to handle keyboard events/Simulate keyboard events:<br />
http://thecodeartist.blogspot.in/2011/03/simulating-keyevents-on-android-device.html<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-34048794.post-60179285215701702482012-11-30T23:12:00.000-08:002012-11-30T23:12:07.588-08:00<div dir="ltr" style="text-align: left;" trbidi="on">
ICS, JB Phone window manager difference: <br />
<br />
while playing video on fullscreen, status bar will be hided during playback in JB. This will not happen with ICS.<br />In ICS, Window manager will check for the mStatusBarCanHide flag to identify whether the system is having Phone UI or Tablet UI.<br />If it is having Phone UI, mStatusBarCanHide flag will be set to true. Whereas in case of tablet, this flag will be set to false.<br />Based on this flag, window manager differentiate the Phone UI or tablet UI.<br /> Display 600 dp is Phone UI.<br /> Display 720 dp<br /> Display > 720dp, tablet UI or larger screen UI<br /><br />In ICS, status bar hiding support is available only phone models. It is not available for tablet UIs.[Refered from android ICS release notes]<br />In JB, it will checks for the mHasSystemNavBar. This value indicates whether device is having tablet UI/larger screens or smaller UI/phone UI.<br />This flag will be set to true for tablet UI.<br /><br /> One more major difference between ICS and JB is that while playing video on fullscreen, ICS will hide the status bar by calling status bar service's collapse() method whereas in JB, it will change the window manager layout.window manager layout's display frame/navigation frame/content frame will be set the video screen. Ideally status bar will be there in screen but it wont be shown to user due to display viewport.<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-34048794.post-73281456253129570542012-11-29T10:27:00.001-08:002012-11-29T10:27:27.075-08:00<div dir="ltr" style="text-align: left;" trbidi="on">
How Wifi/ethernet/3G service is working in android:<br />
=================================== <br />
<br />
<br /> 1) while bootup, connectivity service will launch all networking services.<br /> <br />In android, most of the system services cant be directly interactable by user applications/any other medium.<br /> Every service will have a manager which will talks with service. For example, To interact with connectivity service, Connectivity manager is available. User/application will query for the available network connections from Connectivity manager.<br /><br /> In the same way, wifi manager is available for Wifi service, Window manager is available for Window service and so on.<br />During bootup, System server launches connectivity service.connectivity service launches/initiates wifi/3G/ethernet services.<br /><br /> To receive whether the link is up or down, ethernet connection is connected or disconnected, we will receiving notifications from <br />framework.[android_net_wifi.cpp/android_net_ ] This framework file watches for network connectivity by reading /proc or sys file system.<br /><br /> if wifi is available then under proc/net/wireless/wlan0 interface will be created. So the framework will waits for proc/net/wireless/ file for any changes.<br /> More over we will get notifications from driver on link up or down information. Once the link is up, it will be updated to Mobile/Wifi/ethernet trackers. These trackers will query for the network information like DHCP IP address,netmask and so on from DHCP service/dhcp daemon.<br /> <br /> Once the wifi/mobile state tracker got an IP address and necessary information about the network it update to Connectivity manager.<br />Meanwhile it will also update the Wifi/Ethernet manager which will talks to wifi/ethernet/3G services .<br /> <br /> UpdateConnectivity of connectivity manager is being called to update the CONNECTED /DISCONNECTED network information to connectivity service.<br /> <br /> while user application queries for connected network information from connectivity manager, Connectivity manager will get this information from connectivity service.<br /> If multiple network connections are available, Connectivity service will decides which one to choose for network connection.<br />For example, if we have 3G connection, we reached into Wifi area, Wifi can download more data compare to 3G. So Wifi connection will be selected for network connection, 3G connection will be teared down.<br /> Every network has priority based on priority it will choose the desired connection.<br /><br /> In linux and all, Ethernet/Wifi connection is possible at the same time. But the kernel will make use of any one interface[wifi/ethernet] at a time.<br /><br /> wifi state tracker will make use of DHCP daemon to get dhcp ip address. For Dhcp request, Some class is available which will calls system/core/libnetutils library. which will talks to dhcp daemon initiated from init.rc.<br />
<br />
This DHCP daemon will query the ip address and set the IP address,netmask information in system properties [dhcp.wifi.ipaddress,dhcp.wifi.netmask]. If the Wifi state tracker doesnt receive any dhcp response for a particular timeout period, it will report timed out error. If dhcp reply is received it will reads Ip address and netmask from the given interface and update it on settings.<br />
CONNECTIVITY_ACTION is an intent which will be used to update the network information from connectivity manager/service.<br /> </div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-34048794.post-9418297474578310222012-11-24T02:11:00.000-08:002012-11-24T02:11:28.311-08:00<div dir="ltr" style="text-align: left;" trbidi="on">
<br />How to maintain various versions with the same target binary inside android file system ???<br /><br /><br />In Android, whatever folders with Android.mk files are added to external folder in android file system,while building the android, it will be compiled.<br />
<br /> I faced an interesting problem. Wifi need wpa_supplicant. There are multiple wpa_supplicants are available in external folder. I could not figure it out which one will be compiled.<br /> external/wpa_supplicant<br /> external/wpa_supplicant_6<br /> external/wpa_supplicant_8<br /><br />Because whatever things we copied to external folder, if it has Android.mk, then that folder will be compiled.<br />All 3 folders are having same target binary [wpa_supplicant,wpa_cli]. If we have multiple target binary with the same name, compilation will fail.<br /><br />I analysed and found that in device.../BoardConfig.mk will have the macro to specify the WPA_SUPPLICANT_VERSION=0_x_8.0<br /><br />if the WPA_SUPPLICANT_VERSION is 5.0, wpa_supplicant folder will be compiled.<br />if the WPA_SUPPLICANT_VERSION is 6.0, wpa_supplicant_6 folder will be compiled. <br />if the WPA_SUPPLICANT_VERSION is 8.0, wpa_supplicant_8 folder will be compiled. <br /><br />within the external/wpa_supplicant/Android.mk if the WPA_SUPPLICANT_VERSION == 0_x_5.0, then only the folder source codes will be compiled.<br />within the external/wpa_supplicant6/Android.mk if the WPA_SUPPLICANT_VERSION == 0_x_6.0, then only the folder source codes will be compiled.<br />within the external/wpa_supplicant8/Android.mk if the WPA_SUPPLICANT_VERSION == 0_x_8.0, then only the folder source codes will be compiled.<br />Target android board can have any supplicant version, it might be 5.0 /6.0/8.0. <br /><br /><br /> <b> Lessons learnt:<br /> </b> we can have multiple versions of the same binary under external folder,decide which version to be compiled based on target board.<br /><br />
<b>where I can apply:</b><br />
<br /> Assume that TI android board has various accelerators for display.Some TI boards will use x hardware accelerators for display. Some boards will use Y hardware accelerators for display. We can use same target binary so it can either use x hardware accelerator or y hardware accelerator for display based on BoardConfig. Finaly display binary is same. <br /><br /> we can not put only x hardware accelerator source code in android. It will fail while compiling for Y hardware accelerator source.<br />User has to take care of copying the code based hardware accelerator. Or else we can copy x and y hardware accelerator code and decide which<br />one to be compiled by boardconfig.mk macros .<br /><br /><br /><br /> </div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-34048794.post-4104639129298219092012-11-23T09:17:00.001-08:002012-11-23T09:17:40.228-08:00<div dir="ltr" style="text-align: left;" trbidi="on">
Problem in static IP:<br />
===============<br />
<br /><br />I ported the android x86 ethernet support to android board.<br />I used the same kernel to run ICS and jellybean OS.<br />I faced the problem in setting static IP. while switching from DHCP to Static IP, entire system hangs.<br /> Ethernet patch is storing the value in Settings. while reading the value from settings and setting the static IP, it hangs...<br />Since ethernet is configured in bootup time, system hangs and doesnt proceed booting android.<br /><br /> I analysed and found that providers/settings data will be stored in /data/data/com.android.settings.provider/settings.db.<br />All android applications/providers database values will be stored under /data/data/com.android.ApplicationName.<br />To clear the settings value, we can format /data/ partition , So that stored information will be deleted.<br />Now I am able to proceed with booting android.<br /> But still problem is there while setting static IP.I doubted the network environments/OS/my program.<br /><br /> 1)Through ifconfig, I am able to set static IP address. So there is no problem in network environment. <br /> 2) I doubted IP settings are not allowd in jellybean, any new services have been added to change IP address. Since I am using same kernel, there wont be any changes in kernel level.<br /> 3) I doubted my entire program is not working. But same code was previously working with ICS.<br /><br />Previously with ICS, I am able to set static IP and tested well.Same code is not working. I doubted my static Ip setting itself is not working.<br /> To narrow down the issue, I hardcoded the netmask value, afterwards it is able to set static IP.<br /> In my code, I debugged and found that it is hanging in netmask to prefix conversion which is required for setting static IP address.<br /><br /><b> Lessons Learnt:</b> 1) All android applications store data/database values under /data/data/com.android.ApplicationName[Package name of the android]<br /> 2) Always document the sample inputs/environments for success cases, So in future, if the system is failing, we can try with that input.<br /> 3) always test lower limit and upper limit values... System hangs since It is failed in lower limit <br /><br />
Please refer my previous post about netmask to prefix conversion problem.<br />
http://sundararajana.blogspot.in/2012/11/netmask-prefix-length-netmask-is-also.html<br />
<br /><br /><br /><br /> </div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-34048794.post-45376376391200787942012-11-22T11:08:00.000-08:002012-11-22T11:08:06.427-08:00<div dir="ltr" style="text-align: left;" trbidi="on">
Netmask , prefix length :<br />==========================<br /><br /> netmask is also measured as prefix length. The number of bits set in netmask value is called as prefix length.<br />Example : Netmask:255.255.255.0 Prefix : 24 //number of bits set in 255.255.255.0 value.<br /><br /> To convert the netmask to prefix I added below code in Java:<br /><br /> netmask= lookupHost("255.255.255.128");<br /> while ( netmask !=0)<br /> {<br /> if( netmask & 1)<br /> ++prefixLength;<br /> netmask = netmask >> 1;<br /> <br /> }<br /><br /> Simple code :<br /> The above code is working fine for sometime. Sometimes it is not working...<br /> I found that netmask to prefix conversion is breaking and makes the system hangs....<br /><br /> The input 255.255.255.0 is working fine. But 255.255.255.128 is breaking ... <br /><br />Finally figured that the problem is with the code. <br /><br /> In a 32 bit signed integer, 255.255.255.0 is not giving any problem. So LSB is stored as a first byte in memory ...<br /><br /> lookupHost converts the string as 0 255 255 255[bits set] as integer..[0x00ffffff].<br />when it comes to 255.255.255.128, 128 255 255 255 [bits set as 0x80ffffff. So netmask will always not equal to 0, So it is in infinite loop.<br />>> shift operator operates on bits not on sign bit. netmask's sign bit will always 1 & it satisfies netmask != 0 condition infinitely.<br /><br />Solution:<br /> To avoid this problem,<br /> 1)I have to use >>> operator which will also operates on sign bit.<br /> 2) I can also check for the maximum limit.<br /><br /> Above code can be modified as below:<br /><br /> <br /> netmask= lookupHost("255.255.255.128");<br /> while ( netmask !=0)<br /> {<br /> if( netmask & 1)<br /> {<br /> ++prefixLength;<br /> if (prefixLength == 32)<br /> { <br /> break; //exit while loop since maximum allowed value is reached for prefix length for 32 bit IP address, maximum prefix len is 32<br /> }<br /> }<br /> netmask = netmask >>> 1;// >>> Unsigned right shift <br /> <br /> }<br /><br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-34048794.post-66733408955147561822012-11-21T11:03:00.001-08:002012-11-21T11:03:34.289-08:00<div dir="ltr" style="text-align: left;" trbidi="on">
Practice Programming[ About Perfect Practice]: <br />
http://codekata.pragprog.com/2007/01/code_kata_backg.html</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-34048794.post-57601338928899984372012-11-19T09:32:00.002-08:002012-11-19T09:32:39.102-08:00<div dir="ltr" style="text-align: left;" trbidi="on">
<b>Android logcat with Process ID and Thread ID:</b><br />
Android logs can be printed with Process ID and thread ID.<br />
<br />
<b>Command to print logcat with PID and TID:</b><br />
<br />
/system/bin/logcat -v threadtime <br />
<br />
When it will be useful ?<br />
<br />
1) If any crash is occured, we can identify which thread or process id is crashing. we can enable logs in all the modules. If we got any logs from crashing thread, then crashing thread and logs TID and PID will match . Based on it, we can localize the crashing location/thread.<br />
<br />
2) PID and TID will be useful to check which framework classes used by application. For example, If I want to check audio track is used by application or not. I can enable logs in audio track class. While printing logs, it will show the process id and thread ID for Audio Track class.<br />
<br />
we can match the PID with running applications PID to figure it out.<br />
<br />
otherway is we can decompile the APK binary to source code to check whether AudioTrack/framework class is used.<br />
<br />
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-34048794.post-89417469221106968392012-11-19T09:10:00.002-08:002012-11-19T09:10:58.698-08:00<div dir="ltr" style="text-align: left;" trbidi="on">
Android APK to java source code conversion:<br />==============================<br />Required tools for conversion:<br /> i) 7zip ii) dex2jar iii)jd-gui [java decompiler GUI]<br /><br /><br />1)Rename the .apk file to apk.zip.<br />2)unzip using 7zip software to folder.<br />3)unzipped folder will have classes.dex file<br />4)use dex2jar to by below command:<br /> dex2jar "D:\classes.dex"<br /> This will create the jar file in "D:\classes_dex2jar.jar".<br />5)run jd-gui and open "D:\classes_dex2jar.jar" jar file.<br /> This will give you the source code of the APK.<br /><br /> From jd-gui, we can do File->Save All sources . So that all sources are saved as zip file.Unzip the file to get the source code.<br /><br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-34048794.post-84001263370237554892012-11-18T03:15:00.001-08:002012-11-18T03:15:39.106-08:00<div dir="ltr" style="text-align: left;" trbidi="on">
<b>Running/Launching Linux/Android OS with same kernel, Is it possible How to do?:</b><br />
<br />
In Embedded/STB devices, Mostly they will be using the Linux OS.<br />Now they are moving to android. How it is possible for them to move to linux???<br /><br /> over the Linux kernel, Some patches/changes are applied and it is called as android kernel. They are having separate branch also.<br /> To run android, Below Components involved:<br /> bootloader, kernel,android source code compiled binaries <br /><br /> we have to compile kernel with target[ARM /x86] architecture. In the same way we have to compile android source code to the target architecture[x86/ARM]. <br /><br /> Initially the bootloader will loads kernel. Kernel will starts init process of android.<br /><br />This init process will loads init.rc, init_board.rc scripts and also launches all the android services.<br /><br /> The user can load linux/android OS with same kernel.<br /><br />we can have a script to launch android/linux OS or based on user choice.<br /><br />In launching an android script, we have to run android init processes in background;<br /><br />android_launch.sh<br /> ./androidbin/init & # This init binary is generated from android source code.<br /><br /> The target device should have all the android binaries.<br /> <br /> Linux also have the same script.<br /> <br />linux_launch.sh <br /> ./linuxbin/init &<br /><br /> Linux source code also has init source code. This should be invoked if we want to launch the linux.This init process will launch all linux binaries.<br />
The device should have all the linux source code compiled binaries.<br /><br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-34048794.post-41764047245633588972012-10-18T11:16:00.003-07:002012-10-18T11:16:40.861-07:00<div dir="ltr" style="text-align: left;" trbidi="on">
<style type="text/css">
<!--
@page { margin: 2cm }
P { margin-bottom: 0.21cm }
A:link { so-language: zxx }
-->
</style>
<br />
<div style="margin-bottom: 0cm;">
PPPoE: </div>
<div style="margin-bottom: 0cm;">
================</div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
For internet connection we might have
used DSL modem. I am using BSNL modem in my home. Internally how modem is working?</div>
<div style="margin-bottom: 0cm;">
<br />
</div>
<div style="margin-bottom: 0cm;">
We will connect telephone connection
with DSL modem to receive/send over the network. From modem, we will connect the
ethernet cable with PC to get internet connection. Initially modem was connected to RS232
serial port or USB 1.1 port. But it will have very less speed. Serialport maxspeed is at max
192 kbps. To speed up internet connection, PPPoE connection was made.
</div>
<div style="margin-bottom: 0cm;">
<br />
</div>
<div style="margin-bottom: 0cm;">
PPP protocol client is running in
PC. PPP server will be running in Modem.</div>
<div style="margin-bottom: 0cm;">
PC 's ethernet card communicates with
modem's ethernet card. It is like connection ethernet cable between
two systems as like a serial cable.</div>
<div style="margin-bottom: 0cm;">
<br />
</div>
<div style="margin-bottom: 0cm;">
PPP client is running in PC, It
will interacts with modem [PPP server] to have internet connection.
Usually modem internet connection will be authenticated by username
and password.</div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
Since internet connection is made
through PPP protocol. If OS supports this PPP client, then it will be
able to access the modem. That's why we are able to get internet
connection regardless of OS .</div>
<div style="margin-bottom: 0cm;">
<br />
</div>
<div style="margin-bottom: 0cm;">
Wireless DSL router has antennas to
access wireless access points. Wireless router will have its own page
settings. By giving this from PC, <a href="http://192.168.1.1/">http://192.168.1.1</a>
we can change the router settings.</div>
<div style="margin-bottom: 0cm;">
<br />
</div>
<div style="margin-bottom: 0cm;">
<b>How data is transmitted in DSL modem:</b></div>
<div style="margin-bottom: 0cm;">
<br />
</div>
<div style="margin-bottom: 0cm;">
DSL modem communicates with nearest
telephone exchange's device. This device is called as Digital
Subscriber Line Access Multiplexer (DSLAM). Data will be transferred
over the telephone exchange's optical fiber cable. Whenever we are
downloading a web page, packets of webpage travel over optical fiber
internet lines directly to the DSLAM at the neighborhood telephone
exchange. At the DSLAM, they are split into as many as paralllel data
streams, modulated onto a separate signal and sent through cable. The
modem demodulates the signal to datastream also will do error
correction,put the data in proper order and sends it to the computer
over ethernet line.</div>
<div style="margin-bottom: 0cm;">
<br />
</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-34048794.post-77704784559779465362012-10-15T11:36:00.002-07:002012-10-15T11:36:42.773-07:00<div dir="ltr" style="text-align: left;" trbidi="on">
Android ICS environment setup issue with Ubuntu 12.04 LTS:<br />
<br />
I stuck up with installation problems and found the below blog is helpful to resolve the issue:<br />
<br />
http://techblog.simoncpu.com/2011/07/required-packages-for-building-android.html</div>
Unknownnoreply@blogger.com0