AP Lab Record S-5.pdf - Week \u2013 1 Create Compile and Run Hello Android App Step 1 Create a new Android Application Step 2:Create Project in workspace

AP Lab Record S-5.pdf - Week u2013 1 Create Compile and...

This preview shows page 1 - 6 out of 42 pages.

Week 1: Create, Compile and Run Hello Android App. Step 1: Create a new Android Application. Step 2:Create Project in workspace. Step 3: Create launcher_icon.
Background image
Background image
** MainActivity.java **:packagecom.example.hello123app;//import android.support.v7.app.ActionBarActivity;importandroid.app.Activity;importandroid.os.Bundle;importandroid.view.Menu;publicclassMainActivity extendsActivity {@OverrideprotectedvoidonCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);}@OverridepublicbooleanonCreateOptionsMenu(Menu menu) {// Inflate the menu; this adds items to the action bar if it is present.// main === activity_main getMenuInflater().inflate(R.menu.main/* if R.menu.main doesn't work try R.menu.activity_main */, menu);returntrue;}}Step 6: Create a new virtual device.
Background image
Step 7: Run Hello123App on AVD.
Background image
Background image
Image of page 6

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture