- xml file
- java
- layout resources
-
UI Layout
- Create layout (LinearLayout, RelativeLayout, GridLayout) and widget (eg: Button, EditText, TextView, ListView, ScrollView)
- LinearLayout: (1) Need to specify orientation (vertical or horizontal) (2) layout_weight: "0". How this feature is used to differentiate our words and server words
- ListView
- TextView and Button
-
Implement functionalities of those UI widgets
-
ListView
- ListViewAdapter
- Create a new Adapter class extending ListAdapter
- Override some methods: getItemId, getView, etc.
- File in internal memory to store messages history
- ListViewAdapter
-
Listener
- Button: setOnClickListener
- Edit: addTextChangedListener
-
File in and out
- File
- FileInputStream
- ObjectInputStream
-
ClearMessageHistoryButton
- Delete the file and mMessages ArrayList
-
SendMessageButton
- OkHttp include the two jar files
- Send request and define the callback method
-
Start: onCreate() -> onStart() -> onResume()
-
Change configuration: onResume()
-
Pause (suspend / black screen): onPause()
-
When paused: if something unexpected happens (memory runs out, etc) onStop() onDestroyed()
- Add Internet Permission
-
