0% found this document useful (0 votes)
56 views23 pages

2 - Android Development App 1

The document provides an overview of the development process for an Android app. It discusses setting up tools, project structure including layouts, resources, code and configuration files. It explains how to attach layouts to Java code and pass variables between XML and Java. It also covers the Android activity lifecycle, debugging, device distribution, and publishing on Google Play.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views23 pages

2 - Android Development App 1

The document provides an overview of the development process for an Android app. It discusses setting up tools, project structure including layouts, resources, code and configuration files. It explains how to attach layouts to Java code and pass variables between XML and Java. It also covers the Android activity lifecycle, debugging, device distribution, and publishing on Google Play.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 23

Basis Data Klien Server

Pertemuan – 2
Development process for an Android app
Android
WHAT IS ANDROID?

 A Software platform and operating system for


mobile.
 Based on the Linux kernel.
 Android was found way back in 2003.
 It was developed in Palo Alto, California.
 Android was developed by the Andy Rubin,
Rich Miner, Nick Sears and Chris White.
Development
process for an
Android app
Setup - Tools
Set up AVD and Devices
Project Structure
App behavior in Java

Binary Assets

Resource and XML


layouts

Configuration Files
Layout in Android
 An XML‐based layout is a specification of the
various UI components (widgets) and the
relationships to each other –and to their
containers –all written in XML format.

[email protected] res/layout
Attaching Layouts to Java Code
 XML to Java
public class Main extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
Attaching Layouts to Java Code - 2
Main.java

public class Main extends Activity {


protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}

R.java

public static final class layout {


public static final int main=0x7f030000;
}
App behavior in Java
 An Activity is an application
component that provides a
screen with which users can
interact in order to do
something, such as dial the
phone, take a photo, send an
email, or view a map. Activity
 Each activity is given a window in which to
draw its user interface in xml layout.
Variable in Layout
 XML to XML

Main.xml
<TextView
android:id="@+id/TextView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world“
/>

Strings.xml
<resources>
<string name="app_name">AKDip</string>
<string name="action_settings">Settings</string>
<string name="hello_world">Hello world!</string>
</resources>
Variable in Activity from Layout
 XML to Java (Ex. TextView)
Main.java
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

TextView tv = (TextView) findViewById(R.id.TextView1);


tv.setText("Hello new World");
}

R.java
public static final class id {
public static final int TextView1=0x7f080003;
}
Variable in Activity from Layout
 XML to Java (Ex. Button)
Main.xml
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/tombol“
android:onClick=“saatTombolDitekan”
/>

Main.java
public void saatTombolDitekan(View v) {
Button bt = (Button) findViewById(R.id.button1);
bt.setText("Hello new World");
}
Android Activity
Lifecycle
 onCreate()  Called when the activity is first created.
This is where you should do all of your normal static
set up create views, bind data to lists, and so on.
 onStart()  Called just before the activity becomes
visible to the user.
 onRestart()  Called after the activity has been
stopped, just prior to it being started again.
 onResume()  Called just before the activity starts
interacting with the user.
 onPause()  Called when the system is about to start
resuming another activity.
 onStop()  Called when the activity is no longer
visible to the user.
 onDestroy()  Called before the activity is destroyed.

Source :
Debug and Testing

 ADB is a client server program that connects clients


on developer machine to devices/emulators to
facilitate development.
 An IDE like Eclipse handles this entire process for you.
Distribution of Devices

http://developer.android.com/about/dashboards/index.html
http://developer.android.com/guide/practices/screens_suppor
Publishing

1,4 million apps


Source : http://www.statista.com/statistics/266210/number-of-available-applications-in-
the-google-play-store/
Registration on Google Play

play.google.com/apps/publish
Thank you
Andika Sundawijaya
[email protected]

You might also like