SlideShare a Scribd company logo
viWave Study Group
Introduction to Google Android Development
              Chap. 23~Chap.29
                     Ted Chien
                       #7151
               ted.chien@viwav.com
               Supervisory Engineer
                  viWave Co. Ltd.
Agenda
• Designing the Obvious

• Resource and Internationalization

• Orientation

• Adapter

• Spinner

• Signing Application Key

• Publish to Android Market
Designing the Obvious
    Make It Simple and Easy-to-Use
 Only provides features that users need.

 Match user behaviors.

 Help users to get advanced.

 Easy to recover from mistakes.

 Consistence UI elements.
Resources and
Internationalization
Resources
All resource files are in /res folder.
Default folders for different resources:
     Values: res/values/<filename>.xml
     Layout: res/layout/<filename>.xml
     Drawables: res/drawable/<filename>.png

What if we want to have customized
resources for different situations?
Resources
Resources can be used for different or specified
situations by setting different qualifiers in folder
name:
  Mobile Country Code and Mobile Network Code.
  Language Code and Region Code.
  Screen types, dimensions, densities and orientations.
  Touch screen types.
  Keyboard states and types.
  Navigation control types.
  SDK version.


Possible resource folder name:
  res/layout-zh-rTW-large-port-mdpi-finger-qwerty-dpad-
  480x320/main.xml
Localization
Default: res/values/string.xml

If we need other languages:
  res/values-<language-code>-r<region-code>/string.xml
  Language code (ISO-639): en, ja, zh,...
  Region code (ISO-3166): US, UK, CN, TW,....

Example:
  Chinese (Taiwan): res/values-zh-rTW/string.xml
  Chinese (PRC): res/values-zh-rCN/string.xml
Change UI Locale
Change by UI:
Menu -> Settings -> Locale & Text -> Select Locale
Change by Code:
Resources res = getResources();

Configuration config = res.getConfiguration();

config.locale = Locale.TRADITIONAL_CHINESE; // or Locale.TAIWAN;

DisplayMetrics dm = res.getDisplayMetrics();

res.updateConfiguration(config, dm);
Writing code for different
                Locales
Resources res = getResources();

Configuration config = res.getConfiguration();

if (config.locale == Locale.TRADITIONAL_CHINESE) {

       // do something related to Traditional Chinese;

}
Screen Layout and Orientation
Orientation         Navigation
  Portrait: port      notouch
  Landscape: land     dpad
  Square: square      trackball
                      wheel
Touch Screen Type
  notouch           Resolution
  finger              320x240 (QVGA)
  stylus              320x480 (HVGA)
                      400x800
Text Input            400x854
  nokeys
  qwerty
  12key (numbers)
Screen Layout and Orientation

Sample: T-Mobile G1
  Normal: port-finger-trackball-320x480
  Slide out the keyboard: land-finger-qwerty-trackball-320x480

When screen orientation is changed, activity will be re-created
because device configuration is changed.
  Solution:
      Use SharedPreferences to keep settings in onPause() / onStop().
Screen Layout and Orientation

How to fix the screen orientation?
  AndroidManifest.xml
     Add android:screenOrientation value to <activity> tag.
     Values: portrait, landscape, sensor.
  In code:
     Import android.content.pm.ActivityInfo;
     Call setRequestedOrientation(
        ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE )
     or
        setRequestedOrientation(
               ActivityInfo.SCREEN_ORIENTATION_PORTRAIT ) in
     activity.
Adapter
Act as an bridge between AdapterView and the data for the
view.

Provides access to different types of data via single interface
to the view.

Types
   ArrayAdapter
   SimpleAdapter (read array from XML file)
   CursorAdapter (read array from content provider)
ArrayAdapter
How to Define String Array?
By code

static final String[] strArray = new String[] {

     “item1”,

     “item2”,

     …

};
ArrayAdapter<CharSequence> adapter_string = new
ArrayAdapter<String>(this, android.R.layout.simple_list_item,
strArray);
ArrayAdapter
  How to define string array?
By XML
res/values/string.xml
   <resource>
     <string-array name=“strArray”>
              <item>1st</item>
              ….
    </string-array>
  </resource>
Code:
   ArrayAdapter<CharSequence> adapter_string =
      ArrayAdapter.createFromResource( this, R.array.strArray,
      andorid.R.layout.simple_list_item);
Spinner
Spinner is like pull-down menu.

How to add a Spinner?
   Layout XML
      Add Spinner control.
      Set android:drawSelectorOnTop=“true”.
      Set android:prompt with title string id.
   Code
      Call getViewbyId() to get the view and cast to Spinner.
      Create ArrayAdapter instance to prepare the data.
      Call ArrayAdapter.setDropDownViewResource() to make the resource
      of the Drop-Down view.
      Set the data adapter to the Spinner control.
Spinner
How to select an item in Spinner?
    private Spinner.OnItemSelectedListener select = new
    Spinner.OnItemSelectedListener() {
       public void onItemSelected(AdapterView parent, View v, int position, long id)
    {
                   // something selected.
       }
       public void onNothingSelected(AdapterView parent) {
                   // nothing selected.
       }
    }
Call setOnItemSelectedListener(select) to set the listener to the Spinner control so it
    can listen to user behaviors.
After selection, use Spinner.getSelectedItemPosition() to get the selected count.
Select item by code: Spinner.setSelection().

Sample: API Demo - Spinner
Signing Application Key
Things to Know
All applications must be signed.

We can use self-signed certificates to sign applications.

Must sign application with private key before releasing the
application.

System will check certificate’s expiration date at install time.

Signing tool: Keytool and Jarsigner, all in JDK.

After application is signed, we can use zipalign tool to
optimize the apk file.
Signing Strategy
Sign all applications with the same certification, throughout
the lifespan of the applications (25 years suggested).

Reasons:
  Users can upgrade application seamlessly.
      New certification would require new package name, system would
      consider your AP as an new one.
  APs can run in the same process, and will be treated as single AP.
  APs can share code/data with each other.

If AP will be released to Android Market, the valid date of
the certification must be later than October 22, 2033.
Signing the Application
Export the unsigned       We can do this by using
APK.                      the Export Wizard in
                          Eclipse!
Obtain the signing key.
                          We can also do this by
Signing the key.          exporting signed APK in
                          Package Explorer in
Verifying the key.
                          Eclipse!
Install the Application

Publish the Application
Checking List in
           AndroidManifest.xml
• Version defined correctly?
   – android:versionCode
   – android:versionName

• Activities defined correctly?

• Permissions defined correctly?

• SDK version defined correctly?
   – android:minSDKVersion
   – android:targetSDKVersion (optional)
   – android:maxSDKVersion (optional)
Publish to Android
      Market
Methods to Release
               Applications
• Publish to Android Market.

• Publish to 3rd-Party Market.
  – SlideMe: http://www.slideme.org
  – Camangi Market (for Camangi
    WebStation):http://www.camangimarket.com/
  – FET Smart Market: http://www.smartapp.tw
  – ChinaMobile Mobile Market: http://www.mmarket.com
  – AndAppStore: http://andappstore.com

• Put it on our own website for download.
How Android Market Works?

• Just upload signed Program.apk to Android Market and click
  on Publish, users will see the application to download
  immediately.

• Revenue Sharing:
  – Paid AP Developer: 70%
  – Operators and e-Commerce Providers: 30%

• Users can refund paid application in 24 hours.
How to Register for Android
            Market?
• Registration Fee: USD 25 for lifetime.

• Where to register for Android Market?
  – http://market.android.com/publish

• Must have Google account.

• Must pay the registration fee via Google Checkout.

• Must use international cell phone number.
How to Upload AP to Android
          Market?
• Must upload Release mode and signed APK file.

• Can publish through different locales, countries, operators,
  and categories.
Managing AP on Android
             Market
• We can see how many applications we have published.

• We can also see how many downloads and ratings of our
  applications on Android Market.

• We can view user comments on our applications through 3rd-
  Party website:
  – Cyket: http://www.cyket.com
  – aTrackDog: http://atrackdog.a0soft.com
  – Android Stats: http://androidstats.com/ranking/applications
Q&A
Thank You!

More Related Content

Similar to viWave Study Group - Introduction to Google Android Development - Chapter 23 ~ Chapter 29

Android App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structureAndroid App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structure
Vijay Rastogi
 
Getting started with android programming
Getting started with android programmingGetting started with android programming
Getting started with android programming
PERKYTORIALS
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android Apps
Gil Irizarry
 
Training Session 2 - Day 2
Training Session 2 - Day 2Training Session 2 - Day 2
Training Session 2 - Day 2
Vivek Bhusal
 
Part 2 android application development 101
Part 2 android application development 101Part 2 android application development 101
Part 2 android application development 101
Michael Angelo Rivera
 
Android_Bootcamp_PPT_GDSC_ITS_Engineering
Android_Bootcamp_PPT_GDSC_ITS_EngineeringAndroid_Bootcamp_PPT_GDSC_ITS_Engineering
Android_Bootcamp_PPT_GDSC_ITS_Engineering
ShivanshSeth6
 
Discover Data That Matters- Deep dive into WSO2 Analytics
Discover Data That Matters- Deep dive into WSO2 AnalyticsDiscover Data That Matters- Deep dive into WSO2 Analytics
Discover Data That Matters- Deep dive into WSO2 Analytics
Sriskandarajah Suhothayan
 
React native: building shared components for Android and iOS
React native: building shared components for Android and iOSReact native: building shared components for Android and iOS
React native: building shared components for Android and iOS
Calum Gathergood
 
Android Applications Development: A Quick Start Guide
Android Applications Development: A Quick Start GuideAndroid Applications Development: A Quick Start Guide
Android Applications Development: A Quick Start Guide
Sergii Zhuk
 
android level 3
android level 3android level 3
android level 3
DevMix
 
PPT Companion to Android
PPT Companion to AndroidPPT Companion to Android
PPT Companion to Android
Dharani Kumar Madduri
 
Android Introduction
Android IntroductionAndroid Introduction
Android Introduction
saivvit
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspective
Gunjan Kumar
 
How We Built the Private AppExchange App (Apex, Visualforce, RWD)
How We Built the Private AppExchange App (Apex, Visualforce, RWD)How We Built the Private AppExchange App (Apex, Visualforce, RWD)
How We Built the Private AppExchange App (Apex, Visualforce, RWD)
Salesforce Developers
 
Mobile application development
Mobile application developmentMobile application development
Mobile application development
umesh patil
 
Java Meetup - 12-03-15 - Android Development Workshop
Java Meetup - 12-03-15 - Android Development WorkshopJava Meetup - 12-03-15 - Android Development Workshop
Java Meetup - 12-03-15 - Android Development Workshop
Kasun Dananjaya Delgolla
 
Synapseindia android application development tutorial
Synapseindia android application development tutorialSynapseindia android application development tutorial
Synapseindia android application development tutorial
Synapseindiappsdevelopment
 
Synapseindia android apps development tutorial
Synapseindia android apps  development tutorialSynapseindia android apps  development tutorial
Synapseindia android apps development tutorial
Synapseindiappsdevelopment
 
Android Intro
Android IntroAndroid Intro
Android Intro
Justin Grammens
 

Similar to viWave Study Group - Introduction to Google Android Development - Chapter 23 ~ Chapter 29 (20)

Android App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structureAndroid App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structure
 
Android_PDF
Android_PDFAndroid_PDF
Android_PDF
 
Getting started with android programming
Getting started with android programmingGetting started with android programming
Getting started with android programming
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android Apps
 
Training Session 2 - Day 2
Training Session 2 - Day 2Training Session 2 - Day 2
Training Session 2 - Day 2
 
Part 2 android application development 101
Part 2 android application development 101Part 2 android application development 101
Part 2 android application development 101
 
Android_Bootcamp_PPT_GDSC_ITS_Engineering
Android_Bootcamp_PPT_GDSC_ITS_EngineeringAndroid_Bootcamp_PPT_GDSC_ITS_Engineering
Android_Bootcamp_PPT_GDSC_ITS_Engineering
 
Discover Data That Matters- Deep dive into WSO2 Analytics
Discover Data That Matters- Deep dive into WSO2 AnalyticsDiscover Data That Matters- Deep dive into WSO2 Analytics
Discover Data That Matters- Deep dive into WSO2 Analytics
 
React native: building shared components for Android and iOS
React native: building shared components for Android and iOSReact native: building shared components for Android and iOS
React native: building shared components for Android and iOS
 
Android Applications Development: A Quick Start Guide
Android Applications Development: A Quick Start GuideAndroid Applications Development: A Quick Start Guide
Android Applications Development: A Quick Start Guide
 
android level 3
android level 3android level 3
android level 3
 
PPT Companion to Android
PPT Companion to AndroidPPT Companion to Android
PPT Companion to Android
 
Android Introduction
Android IntroductionAndroid Introduction
Android Introduction
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspective
 
How We Built the Private AppExchange App (Apex, Visualforce, RWD)
How We Built the Private AppExchange App (Apex, Visualforce, RWD)How We Built the Private AppExchange App (Apex, Visualforce, RWD)
How We Built the Private AppExchange App (Apex, Visualforce, RWD)
 
Mobile application development
Mobile application developmentMobile application development
Mobile application development
 
Java Meetup - 12-03-15 - Android Development Workshop
Java Meetup - 12-03-15 - Android Development WorkshopJava Meetup - 12-03-15 - Android Development Workshop
Java Meetup - 12-03-15 - Android Development Workshop
 
Synapseindia android application development tutorial
Synapseindia android application development tutorialSynapseindia android application development tutorial
Synapseindia android application development tutorial
 
Synapseindia android apps development tutorial
Synapseindia android apps  development tutorialSynapseindia android apps  development tutorial
Synapseindia android apps development tutorial
 
Android Intro
Android IntroAndroid Intro
Android Intro
 

Recently uploaded

State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 

Recently uploaded (20)

State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 

viWave Study Group - Introduction to Google Android Development - Chapter 23 ~ Chapter 29

  • 1. viWave Study Group Introduction to Google Android Development Chap. 23~Chap.29 Ted Chien #7151 ted.chien@viwav.com Supervisory Engineer viWave Co. Ltd.
  • 2. Agenda • Designing the Obvious • Resource and Internationalization • Orientation • Adapter • Spinner • Signing Application Key • Publish to Android Market
  • 3. Designing the Obvious Make It Simple and Easy-to-Use  Only provides features that users need.  Match user behaviors.  Help users to get advanced.  Easy to recover from mistakes.  Consistence UI elements.
  • 5. Resources All resource files are in /res folder. Default folders for different resources: Values: res/values/<filename>.xml Layout: res/layout/<filename>.xml Drawables: res/drawable/<filename>.png What if we want to have customized resources for different situations?
  • 6. Resources Resources can be used for different or specified situations by setting different qualifiers in folder name: Mobile Country Code and Mobile Network Code. Language Code and Region Code. Screen types, dimensions, densities and orientations. Touch screen types. Keyboard states and types. Navigation control types. SDK version. Possible resource folder name: res/layout-zh-rTW-large-port-mdpi-finger-qwerty-dpad- 480x320/main.xml
  • 7. Localization Default: res/values/string.xml If we need other languages: res/values-<language-code>-r<region-code>/string.xml Language code (ISO-639): en, ja, zh,... Region code (ISO-3166): US, UK, CN, TW,.... Example: Chinese (Taiwan): res/values-zh-rTW/string.xml Chinese (PRC): res/values-zh-rCN/string.xml
  • 8. Change UI Locale Change by UI: Menu -> Settings -> Locale & Text -> Select Locale Change by Code: Resources res = getResources(); Configuration config = res.getConfiguration(); config.locale = Locale.TRADITIONAL_CHINESE; // or Locale.TAIWAN; DisplayMetrics dm = res.getDisplayMetrics(); res.updateConfiguration(config, dm);
  • 9. Writing code for different Locales Resources res = getResources(); Configuration config = res.getConfiguration(); if (config.locale == Locale.TRADITIONAL_CHINESE) { // do something related to Traditional Chinese; }
  • 10. Screen Layout and Orientation Orientation Navigation Portrait: port notouch Landscape: land dpad Square: square trackball wheel Touch Screen Type notouch Resolution finger 320x240 (QVGA) stylus 320x480 (HVGA) 400x800 Text Input 400x854 nokeys qwerty 12key (numbers)
  • 11. Screen Layout and Orientation Sample: T-Mobile G1 Normal: port-finger-trackball-320x480 Slide out the keyboard: land-finger-qwerty-trackball-320x480 When screen orientation is changed, activity will be re-created because device configuration is changed. Solution: Use SharedPreferences to keep settings in onPause() / onStop().
  • 12. Screen Layout and Orientation How to fix the screen orientation? AndroidManifest.xml Add android:screenOrientation value to <activity> tag. Values: portrait, landscape, sensor. In code: Import android.content.pm.ActivityInfo; Call setRequestedOrientation( ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE ) or setRequestedOrientation( ActivityInfo.SCREEN_ORIENTATION_PORTRAIT ) in activity.
  • 13. Adapter Act as an bridge between AdapterView and the data for the view. Provides access to different types of data via single interface to the view. Types ArrayAdapter SimpleAdapter (read array from XML file) CursorAdapter (read array from content provider)
  • 14. ArrayAdapter How to Define String Array? By code static final String[] strArray = new String[] { “item1”, “item2”, … }; ArrayAdapter<CharSequence> adapter_string = new ArrayAdapter<String>(this, android.R.layout.simple_list_item, strArray);
  • 15. ArrayAdapter How to define string array? By XML res/values/string.xml <resource> <string-array name=“strArray”> <item>1st</item> …. </string-array> </resource> Code: ArrayAdapter<CharSequence> adapter_string = ArrayAdapter.createFromResource( this, R.array.strArray, andorid.R.layout.simple_list_item);
  • 16. Spinner Spinner is like pull-down menu. How to add a Spinner? Layout XML Add Spinner control. Set android:drawSelectorOnTop=“true”. Set android:prompt with title string id. Code Call getViewbyId() to get the view and cast to Spinner. Create ArrayAdapter instance to prepare the data. Call ArrayAdapter.setDropDownViewResource() to make the resource of the Drop-Down view. Set the data adapter to the Spinner control.
  • 17. Spinner How to select an item in Spinner? private Spinner.OnItemSelectedListener select = new Spinner.OnItemSelectedListener() { public void onItemSelected(AdapterView parent, View v, int position, long id) { // something selected. } public void onNothingSelected(AdapterView parent) { // nothing selected. } } Call setOnItemSelectedListener(select) to set the listener to the Spinner control so it can listen to user behaviors. After selection, use Spinner.getSelectedItemPosition() to get the selected count. Select item by code: Spinner.setSelection(). Sample: API Demo - Spinner
  • 19. Things to Know All applications must be signed. We can use self-signed certificates to sign applications. Must sign application with private key before releasing the application. System will check certificate’s expiration date at install time. Signing tool: Keytool and Jarsigner, all in JDK. After application is signed, we can use zipalign tool to optimize the apk file.
  • 20. Signing Strategy Sign all applications with the same certification, throughout the lifespan of the applications (25 years suggested). Reasons: Users can upgrade application seamlessly. New certification would require new package name, system would consider your AP as an new one. APs can run in the same process, and will be treated as single AP. APs can share code/data with each other. If AP will be released to Android Market, the valid date of the certification must be later than October 22, 2033.
  • 21. Signing the Application Export the unsigned We can do this by using APK. the Export Wizard in Eclipse! Obtain the signing key. We can also do this by Signing the key. exporting signed APK in Package Explorer in Verifying the key. Eclipse! Install the Application Publish the Application
  • 22. Checking List in AndroidManifest.xml • Version defined correctly? – android:versionCode – android:versionName • Activities defined correctly? • Permissions defined correctly? • SDK version defined correctly? – android:minSDKVersion – android:targetSDKVersion (optional) – android:maxSDKVersion (optional)
  • 24. Methods to Release Applications • Publish to Android Market. • Publish to 3rd-Party Market. – SlideMe: http://www.slideme.org – Camangi Market (for Camangi WebStation):http://www.camangimarket.com/ – FET Smart Market: http://www.smartapp.tw – ChinaMobile Mobile Market: http://www.mmarket.com – AndAppStore: http://andappstore.com • Put it on our own website for download.
  • 25. How Android Market Works? • Just upload signed Program.apk to Android Market and click on Publish, users will see the application to download immediately. • Revenue Sharing: – Paid AP Developer: 70% – Operators and e-Commerce Providers: 30% • Users can refund paid application in 24 hours.
  • 26. How to Register for Android Market? • Registration Fee: USD 25 for lifetime. • Where to register for Android Market? – http://market.android.com/publish • Must have Google account. • Must pay the registration fee via Google Checkout. • Must use international cell phone number.
  • 27. How to Upload AP to Android Market? • Must upload Release mode and signed APK file. • Can publish through different locales, countries, operators, and categories.
  • 28. Managing AP on Android Market • We can see how many applications we have published. • We can also see how many downloads and ratings of our applications on Android Market. • We can view user comments on our applications through 3rd- Party website: – Cyket: http://www.cyket.com – aTrackDog: http://atrackdog.a0soft.com – Android Stats: http://androidstats.com/ranking/applications
  • 29. Q&A

Editor's Notes

  1. User might not need to see the features he/she never used in the application, so gasolin only implement aBMI for metric unit.