Monday 3 August 2015

Basic programming for android



Are you an Android user or someone interested by the use of it? If so, this newsletter has a few essential statistics about it, together with useful hints and steering. And, in case you need assistance in growing Android packages, you may learn how with some of the item's fundamental Android programming code.

 Android is growing programs (software). It turned into created for cellular telephones and other gadgets (which include smartphones and tablet computer systems).
- Is frequently called the Open Handset Alliance
- It includes an working gadget, middleware and key applications
- The mobile platform is to be had, at no cost, because the Android Open supply challenge
The Android net site is a good location to start.
Version history: 23 September 2008 became the release of version 1.Zero. Seeing that then, every model has been advanced under a code call based on a dessert object. The contemporary model is Honeycomb 3.0 SDK (a tablet-most effective release of Android). Later this yr, October or November 2011, Android will release a more moderen version called Ice Cream Sandwich (as a way to encompass facial popularity and new APIs).
The Android Dev manual (see references) gives a realistic advent to growing packages for Android. And, for those interested by retrieving more approximately this open supply software, don't forget analyzing some of the "Google Android How-To courses" (that are articles from BH).
The use of Android
system necessities
observe: users need to down load Eclipse and Android SDK (1.6).
- begin here by using putting in the Android SDK
- those the usage of Eclipse, make certain to put in the Android improvement equipment (ADT) Plugin
the usage of Android SDK (word: Google had launched Android SDK)
- It presents the gear and APIs needed to begin growing packages.
- it'll run on windows XP or Vista; Mac OS 10.Four.8 or later; or Linux Ubuntu Dapper Drake or later.
The use of Eclipse
- to edit files and verify that they compile
- used for mistakes checking
- to test directories in search for Java files
Android applications are written inside the Java programming language, so getting to know a chunk of Java is essential.
Additionally, Android helps XML syntax. It's used for designing application displays.
Need assist getting began? There may be a useful forum (blog) that customers can research Android fundamental Programming. The site: Android Competency middle. It incorporates Android tutorials and pointers.
For customers wanting to build graphical person interfaces for the Android cellular phone platform, there may be DroidDraw.
Android uses the aapt device into an Android package deal, an archive document marked via an .Apk suffix.
Using the Android Asset Packaging tool
- Is included inside the tools listing of the SDK
- It allows you to view, create, and update Zip-compatible documents (zip, jar, apk)
building the code
word: To construct the files, run make from within your operating listing.
$ cd ~/mydroid
$ make
note: If customers are lacking the "run-java-device," strive setting the ANDROID_JAVA_HOME env var to $JAVA_HOME
$ export ANDROID_JAVA_HOME=$JAVA_HOME
To Create an AVD (Android virtual devices)
android create avd --target 2 --name my_avd
To pick, add, Delete, and alter statistics - use the content company URI (CONTENT_URI)
The CONTENT_URI consist of three parts:
importing (examples):
import android.App.AlertDialog.Builder;
import android.Content material.Context;
import android.Content material.DialogInterface;
import android.Content.DialogInterface.OnClickListener;
import android.Desire.ListPreference;
import android.Preference.Desire;
import android.Util.AttributeSet;
to ask for a user's call:
androidid='@+identity/nameMessage'
Examples of how to outline the pastime entry within the AndroidManifest.Xml:
android:name='DialogActivity'
android:label='@string/activity_dialog'
android:subject='@android:fashion/subject matter.Conversation'>
'
</activity>
To Create a conversation:
MyDialog conversation = new MyDialog(context); conversation.Display();

the usage of AlertDialog:
AlertDialog conversation = new AlertDialog.Builder(context).Create();
conversation.SetMessage('Do you play golfing'?); conversation.SetButton('sure', myOnClickListener); dialog.SetButton2('No', myOnClickListener);
dialog.Show();
to add a document:
private void insertRecords(String name, String phoneNo)
ContentValues values = new ContentValues();
values.Put(humans.Call, call);
values.Positioned(Contacts.Phones.Kind, humans.Telephones.TYPE_MOBILE);
values.Positioned(people.Variety, phoneNo);

To show a file:
non-public void displayRecords()
String columns[] = new String[]  humans.Name, humans.Number ;
String call = null;
String phoneNo = null;
call = cur.GetString(cur.GetColumnIndex(humans.Call));
phoneNo = cur.GetString(cur.GetColumnIndex(humans.Quantity));

To adjust a file:
private void updateRecord(int recNo, String call)
ContentValues values = new ContentValues();
values.Put(humans.Call, call);

To Delete a document:
personal void deleteRecords()
Uri uri = human beings.CONTENT_URI;
getContentResolver().Delete(uri, null, null);

0 comments:

Post a Comment

 

Copyright @ 2015.All Rights Reserved By Syed Furqan DID YOU KNOW IT.

Google Analytics Alternative