Create Mobile App 2

untuk Screen Shoot dapat di akses : https://drive.google.com/file/d/1kKtj_WGCfJ0HX-GnPIQXrbzNZpjrplc6/view?usp=sharing

2.1 Create Start Activity
1.1
1.2 Buat Project seperti sebelumnya

Buatlah Relative Layout seperti exercise sebelumnya

Sesuaikan attribute seperti dibawah ini.

Tarik button ke dalam layout
Tekan Alt-Enter saat kursor ada di “Send” lalu extract dengan nama button_main

Pada relative_layout lakukan reformat code

1.3

Task 2. Create and launch the second activity
Disini kita akan membuat 2 layout yang saling berhubungan.

2.3 Define the layout for the second activity

2.4 Add an intent to the main activity

Task 3. Send data from the main activity to the second activity

3.2 Add a string to the main activity’s intent extras

3.3 Add a TextView to the second activity for the message

3.4 Modify the second activity to get the extras and display the message

ask 4. Return data back to the main activity
4.1 Add an EditText and a Button to the second activity layout

4.2 Create a response intent in the second activity

4.3 Add TextViews to the main activity layout to display the reply

4.4 Get the reply from the intent extra and display it

Hasil :

2.2: Activity Lifecycle and Instance Stat
Disini kita aka mengedit project Two Activity

1.3 Implement lifecycle callbacks in SecondActivity

1.4 Observe the log as the app runs

Task 2. Save and restore the activity instance state
2.1 Save the activity instance state with onSaveInstanceState()

2.2 Restore the activity instance state in onCreate()

2.3: Start Activities with Implicit Intents

Tambahkan resurve pada string.xml seperti dibawah.

Task 2. Implement “open website
2.1 Define the openWebsite method

Task 3. Implement “open location”
3.1 Define the openLocation method

Task 4. Implement share this text
4.1 Implement the shareText method

Task 5. Receive implicit intents
5.1 Create the project and layout

5.2 Modify the Android manifest to add an intent filter

5.3 Process the intent

Leave a Reply

Your email address will not be published. Required fields are marked *