Android is an open source, Linux- and Java-based, software framework for mobile and portable devices. The Android operating system has a well-designed Java-based SDK to make developing apps straightforward and fun. Before you develop Android 3 applications, get to know Eclipse (an integrated development environment for Java developers) and how to do some common tasks such as creating icons and activities.
>
>
Android: Using the Eclipse IDE for Java Development
Nowadays, software tool developers use an Integrated Development Environment (IDE) for easier Java development. The most widely accepted IDE among Java developers is Eclipse. This table gives you quick tips for using the Eclipse IDE to develop Android apps.
>
>
>
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.
Task | How to Accomplish |
---|---|
Create string, color, image, audio, and video resources | In 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 icons | Icons 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 activity | Create 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 activity | Create 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 activity | Define 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 application | Use 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 app | Use: Intent LaunchBrowserIntent = new Intent(Intent.ACTION_VIEW, theUri); startActivity(LaunchBrowserIntent); |
Record audio or video | Create 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/android-3-sdk-programming-for-dummies-cheat-sheet.html
No comments:
Post a Comment