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

echo-o & Android App Dev - BarCamp Saigon 1

on

  • 3,645 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,645
Views on SlideShare
3,636
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 echo-o & Android App Dev - BarCamp Saigon 1 Presentation Transcript

    • by Tuan Tuong Dang @ Multinc with guidance from Huy Zing BarCamp Saigon 1 November 15, 2008
    • echo-o
      • “ simple real-time feedback”
      • From:
      • To:
    • echo-o architecture
      • Web Application
      • Multiple clients:
        • Web browser
        • Adobe AIR
        • iPhone mobile
        • Android mobile
    • Android Mobile
    • This presentation
      • Structure of an Android application
      • Building blocks of an Android application
      • User Interface of the echo-o application
    •  
    •  
    • 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);
      • }
      • }
    •  
    •  
    • 4 Android Building Blocks
      • Activity
      • Service
      • BroadcastReceiver
      • ContentProvider
    • Building Blocks for echo-o
      • Activity – to show screens and respond to user
      • Service – to create a re-usable sound object
      • BroadcastReceiver
      • ContentProvider
    • Other APIs
      • Intent
      • Views
      • Notifications
    • Other APIs for echo-o
      • Intent – messages such as invoking a sound
      • Views – display web pages
      • Notifications – send vibrate notifications
    •  
    • UI Screens
      • Each screen has views
    • View Layouts
      • FrameLayout
      • LinearLayout
      • RelativeLayout
      • TableLayout
      • AbsoluteLayout
    • View Components
      • Button
      • TextView
      • WebView – displays our web application
      • EditText
      • ListView
      • CheckBox
      • Radio
    • WebView
      • Problem: JavaScript is disabled by default.
      • Solution:
        • browser.getSettings().setJavaScriptEnabled( true );
    • 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();
    • 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 ));
    • 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);
            • }
          • }
    • 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);
    • http://multinc.com/ http://code.google.com/android/