echo-o & Android App Dev - BarCamp Saigon 1

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    1 Favorite

    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/

    + huyzinghuyzing, 12 months ago

    custom

    1156 views, 1 favs, 0 embeds more stats

    For BarCamp Saigon 1, Multinc describes their exper more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1156
      • 1156 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 78
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories