Mastering Common Tasks of Android App Development

Android app development involves many tasks, including designing and building the core of your application; determining user interface components; and, importantly, making your Android app commercially available to the public. This table is a "how-to" for many of the tasks you perform when developing Android apps.











































TaskHow to Accomplish
Create string, color, image, audio, and video resourcesIn the Android project look under the class="code">res directory. String and color resources are
placed in the strings.xml file in the
values sub-directory. Images, audio and
video are added in the raw
sub-directory.
Create iconsIcons are added in the drawable
directories. Common icons are placed in class="code">res->drawable. Icons for specific screen
resolutions and sizes are placed in the extended class="code">drawable directories; class="code">drawable-hdpi for high-resolution screens,
drawable-mdpi for medium resolution
screens and drawable-ldpi for low-res
screens.
Create an activityCreate a Java class for the activity that extends class="code">android.app.Activity.Activity. Create an entry
for it in the AndroidManifest.xml
file.
Create the user interface for an activityCreate the layout file for each class in the res->layout
directory. Use setContentView(class="code">...) to create and
set the view for the activity. Use class="code">findViewById(...class="code">) to extract the components of the view.
Activity must implement the class="code">onClickListener interface (the class="code">onClick(...class="code">) method).
Create a menu for an activityDefine the menu in the res-menu sub-directory of the project.
Implement the onCreateOptionsMenu(Menu
menu)
method and the class="code">onOptionsItemSelected(MenuItem item).
Add logging to your applicationUse Log.v(class="code">...), class="code">Log.d(...class="code">), Log.i(class="code">...), class="code">Log.w(...class="code">), or Log.e(class="code">...) (verbose, debug,
information, warning, and error, respectively). Parameters to each
of these methods are a string tag and a string message.
Launch a web browser from your appUse:



Intent LaunchBrowserIntent = new
Intent(Intent.ACTION_VIEW, theUri);




startActivity(LaunchBrowserIntent);
Record audio or videoCreate an intent using class="code">android.provider.MediaStore.Audio.Media.RECORD_SOUND_ACTION.
Broadcast the event using the class="code">startActivityForResult(class="code">...). Implement a
protected method onActivityResult(int
requestCode, int resultCode, Intent data)
to receive the
result as an intent.



For video, use the same code, but with class="code">android.provider.MediaStore.ACTION_VIDEO_CAPTURE.
Publish to the Android store.Create a Developer account by clicking on the
http://market.android.com/publish link at the bottom of the home
page of the Android Market. Sign your application using
File→Export→Android→Export Signed Android
Application. Upload your application from the Developer Console of
the Android Market.








dummies

Source:http://www.dummies.com/how-to/content/mastering-common-tasks-of-android-app-development.html

No comments:

Post a Comment