SlideShare a Scribd company logo
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/

More Related Content

PDF
Tom Germeau: Mobile Apps: Finding the balance between performance and flexibi...
PDF
Support Design Library
PDF
Material design for everyone
PPT
Rakuraku Contact Network Award Presentation
PPT
Jimmmy
PDF
iPhone App Dev Overview - Mobile Dev Camp Vietnam 1
PPT
Improving IT Education In Vietnam
PPT
iPhone & Android App Dev - BarCamp Saigon 1
Tom Germeau: Mobile Apps: Finding the balance between performance and flexibi...
Support Design Library
Material design for everyone
Rakuraku Contact Network Award Presentation
Jimmmy
iPhone App Dev Overview - Mobile Dev Camp Vietnam 1
Improving IT Education In Vietnam
iPhone & Android App Dev - BarCamp Saigon 1

Similar to echo-o & Android App Dev - BarCamp Saigon 1 (20)

PPT
Developing Applications for WebOS
PPT
iLabs Toolbox Javashare 2008
ODP
Non Conventional Android Programming En
ODP
Non Conventional Android Programming (English)
PDF
Federico Lox Lucignano, War of the worlds web or native both
PDF
Building an app across 11 arabic countries
PDF
Hybrid application development
PDF
Android Survival Guide - Two years of software development
PDF
Android web service client
PPT
Developing apps on Maemo with Nokia Web Runtime
PPT
Native Mobile Application Using Java Script
PDF
Advantages and limitations of PhoneGap for sensor processing
PDF
The WebView Role in Hybrid Applications
PPTX
4G LTE Presentation from O\'Reilly Android Open Confereence
PPTX
Make Mobile Apps Quickly
PDF
The Enterprise Dilemma: Native vs. Web
ZIP
Titanium @ Minnebar
PPT
Getting started
PDF
HTML5 vs Native Android: Smart Enterprises for the Future
PPTX
Holland9 Android Workshop Hogeschool Rotterdam
 
Developing Applications for WebOS
iLabs Toolbox Javashare 2008
Non Conventional Android Programming En
Non Conventional Android Programming (English)
Federico Lox Lucignano, War of the worlds web or native both
Building an app across 11 arabic countries
Hybrid application development
Android Survival Guide - Two years of software development
Android web service client
Developing apps on Maemo with Nokia Web Runtime
Native Mobile Application Using Java Script
Advantages and limitations of PhoneGap for sensor processing
The WebView Role in Hybrid Applications
4G LTE Presentation from O\'Reilly Android Open Confereence
Make Mobile Apps Quickly
The Enterprise Dilemma: Native vs. Web
Titanium @ Minnebar
Getting started
HTML5 vs Native Android: Smart Enterprises for the Future
Holland9 Android Workshop Hogeschool Rotterdam
 
Ad

Recently uploaded (20)

PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
sap open course for s4hana steps from ECC to s4
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Cloud computing and distributed systems.
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Spectroscopy.pptx food analysis technology
PDF
Machine learning based COVID-19 study performance prediction
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Programs and apps: productivity, graphics, security and other tools
20250228 LYD VKU AI Blended-Learning.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
sap open course for s4hana steps from ECC to s4
The AUB Centre for AI in Media Proposal.docx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Cloud computing and distributed systems.
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Building Integrated photovoltaic BIPV_UPV.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Empathic Computing: Creating Shared Understanding
Spectroscopy.pptx food analysis technology
Machine learning based COVID-19 study performance prediction
Network Security Unit 5.pdf for BCA BBA.
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Ad

echo-o & Android App Dev - BarCamp Saigon 1

  • 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
  • 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);