Helloworld

Android provides its own HelloWorld app, which is the introduction to Android that most developers use. If you can’t remember how to create it, then you can find directions at http://developer.android.com/training/basics/firstapp/index.html. Listing 2-7 shows the code.

Listing 2-7 Android HelloWorld

package com.example.myfirstapp;import android.support.v7.app.ActionBarActivity;import android.support.v4.app.Fragment;import android.os.Bundle;import android.view.LayoutInflater;import android.view.Menu;import android.view.MenuItem;import android.view.View;import android.view.ViewGroup;public class MainActivity extends ActionBarActivity {  @Override  protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);                           // ...

Get Bulletproof Android™: Practical Advice for Building Secure Apps now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.