ICT training on MOBILE
Application Development
(Android) with Java
Virtual Classroom
Adding new Activity
Activity: Layout + Java code
Java snippet to start new Activity
Start new Activity and pass value!
Send a bundle with data
Receive the bundle from the new Activity
Sharing with other Android Apps
(sorry iOS)
Share Text with other Apps
Source code
Create an application that can receive data
from other apps?
1 st
Step
Create an intent filter in Manifest
2 nd
Step
Capture intent in “onCreate” function
3 rd
Step
Handle captured data
Android Geolocation
1 st
Step
Add permissions in Manifest
2nd Step
Request Location Updates,
Implementing “LocationListener”
Public Interface
LocationListener
3rd Step
Override “onLocationChanged”
function
How to stop location tracking?
Custom Views
1st Step
Create graphics and save them in
your “res” folder
2nd Step
Create the appropriate xml resource
file and place it in “res” folder
3rd Step
In your main layout file insert the xml
file as the button’s “background”
attribute
draw9patch
How to beep and vibrate
Only for vibration: Request permission
Beep through ToneGenerator
Beep through RingtoneManager
Vibrate!
Android Play a video!
1st Step
Create a VideoView in your layout file
2nd Step
If the video is a network resource,
request the appropriate permission
3rd Step
Play the video file inside the
VideoView
Stop the video?
Play from a local resource?
String SrcPath = "/sdcard/Video/myvideo.mp4";