echo-o & Android App Dev - BarCamp Saigon 1
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

echo-o & Android App Dev - BarCamp Saigon 1

on

  • 3,751 views

For BarCamp Saigon 1, Multinc describes their experiences developing an Android app for http://echo-o.com...

For BarCamp Saigon 1, Multinc describes their experiences developing an Android app for http://echo-o.com

Also see the accompanying presentation "iPhone & Android App Dev - BarCamp Saigon 1"

Statistics

Views

Total Views
3,751
Views on SlideShare
3,742
Embed Views
9

Actions

Likes
2
Downloads
114
Comments
0

3 Embeds 9

http://www.slideshare.net 7
http://www.linkedin.com 1
https://www.linkedin.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

echo-o & Android App Dev - BarCamp Saigon 1 Presentation Transcript

  • 1. by Tuan Tuong Dang @ Multinc with guidance from Huy Zing BarCamp Saigon 1 November 15, 2008
  • 2. echo-o
    • “ simple real-time feedback”
    • From:
    • To:
  • 3. echo-o architecture
    • Web Application
    • Multiple clients:
      • Web browser
      • Adobe AIR
      • iPhone mobile
      • Android mobile
  • 4. Android Mobile
  • 5. This presentation
    • Structure of an Android application
    • Building blocks of an Android application
    • User Interface of the echo-o application
  • 6.  
  • 7.  
  • 8. HelloWorld.java
    • public class HelloWorld extends Activity {
    • public void onCreate(Bundle instanceState) {
    • super.onCreate(instanceState);
    • TextView tv = new TextView(this);
    • tv.setText("Hello World!!!");
    • this.setContentView(tv);
    • }
    • }
  • 9.  
  • 10.  
  • 11. 4 Android Building Blocks
    • Activity
    • Service
    • BroadcastReceiver
    • ContentProvider
  • 12. Building Blocks for echo-o
    • Activity – to show screens and respond to user
    • Service – to create a re-usable sound object
    • BroadcastReceiver
    • ContentProvider
  • 13. Other APIs
    • Intent
    • Views
    • Notifications
  • 14. Other APIs for echo-o
    • Intent – messages such as invoking a sound
    • Views – display web pages
    • Notifications – send vibrate notifications
  • 15.  
  • 16. UI Screens
    • Each screen has views
  • 17. View Layouts
    • FrameLayout
    • LinearLayout
    • RelativeLayout
    • TableLayout
    • AbsoluteLayout
  • 18. View Components
    • Button
    • TextView
    • WebView – displays our web application
    • EditText
    • ListView
    • CheckBox
    • Radio
  • 19. WebView
    • Problem: JavaScript is disabled by default.
    • Solution:
      • browser.getSettings().setJavaScriptEnabled( true );
  • 20. WebView
    • Problem: Communication between Android app and web app:
    • Solutions:
      • Set up handler for JavaScript alerts/prompt/confirms:
        • browser. setWebChromeClient (new WebChromeConfirm());
        • private class WebChromeConfirm extends WebChromeClient {…}
      • Web app invokes method on native app:
        • MainActivity.java
          • AndroidManipulation am = new AndroidManipulation(this);
          • browser. addJavascriptInterface (am, “am");
        • WebApp.js:
          • am. doVibrate();
  • 21. WebView
    • Problem: Zoom picker is disabled by default
    • Solution:
        • LinearLayout zoomLayout = (LinearLayout)findViewById(R.id. basic_map_zoom );
        • settingWebView();
        • View zc = browser. getZoomControls ();
        • zoomLayout. addView (zc, new ViewGroup.LayoutParams(ViewGroup.LayoutParams. WRAP_CONTENT , ViewGroup.LayoutParams. WRAP_CONTENT ));
  • 22. WebView
    • Problem: clicking links are sent to system web browser.
    • Solution: clicking links stay in the WebView
        • browser. setWebViewClient (new Callback());
        • private class Callback extends WebViewClient {
          • public boolean shouldOverrideUrlLoading(WebView view, String url) {
            • loadUrl(url);
            • return(true);
          • }
        • }
  • 23. WebView
    • Problem: changing orientation resets emulator
    • Solution:
      • test on real mobile device
      • on emulator:
        • protected void onSaveInstanceState ( Bundle outState ) {
          • super.onSaveInstanceState(outState);
          • outState. putString ("address", txt.getText().toString());
        • }
        • ....
        • String address = savedInstanceState != null ? savedInstanceState. getString ("address") :
        • "http://www.google.com.vn";
        • loadUrl(address);
  • 24. http://multinc.com/ http://code.google.com/android/