Presentation is loading. Please wait.

Presentation is loading. Please wait.

UFCFX5-15-3Mobile Device Development Android Development SDKs and Publishing.

Similar presentations


Presentation on theme: "UFCFX5-15-3Mobile Device Development Android Development SDKs and Publishing."— Presentation transcript:

1 UFCFX5-15-3Mobile Device Development Android Development SDKs and Publishing

2 UFCFX5-15-3Mobile Device Development Agenda Create an Android Project with Eclipse User interface design Start Another Activity Saving and loading Data Access to website Building, Testing and Debugging Preparing marketing materials for publishing Publish app to Google play

3 UFCFX5-15-3Mobile Device Development Create a Project with Eclipse

4 UFCFX5-15-3Mobile Device Development Project Basic Setting Application name: Should be checked with Google play first. Can be changed after publishing Package name: Unique and permanent. Can not be changed after publishing Minimum required SDK: Should be as low as possible to support more devices. Target SDK: Should be the latest version of android or most popular android version

5 UFCFX5-15-3Mobile Device Development Android Manifest File Filename: AndroidManifest.xml Declaring permissions Declaring activity Declaring version code and number Declaring device filters

6 UFCFX5-15-3Mobile Device Development Design UI Using Graphical Layout  Drag & Drop  Visual Design  No coding is required

7 UFCFX5-15-3Mobile Device Development Supporting Multiple Screens Screen Size Metrics Physical screen size (10, 7, 5, 4, 3.5 inches ) Screen density in dpi (dots per inch): low, medium, high, and extra high Screen resolution Filter out devices (minimum screen size) Different layouts for different screen sizes Different bitmap drawables (e.g. icons) for different screen densities Different layouts for different screen orientation

8 UFCFX5-15-3Mobile Device Development Create Another Activity

9 UFCFX5-15-3Mobile Device Development Start Another Activity Triggers for starting Button pressed Hand gestures Key pressed HelpBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent; intent.putExtra("LanguageChoice",LangChoice); intent = new Intent(AnatomyQuizLite.this, HelpActivity.class); startActivity(intent); } });

10 UFCFX5-15-3Mobile Device Development Android storage spaces Internal storage Always available No permission needed Files saved here are accessible by only your app by default When the user uninstalls your app, the system removes all your app's files from internal storage. External storage (SD card or USB storage) It's NOT always available Writing permission must be declared It's world-readable, so files saved here may be read outside of your control. When the user uninstalls your app, the system removes your app's files from here only if you save them in the directory from getExternalFilesDir()

11 UFCFX5-15-3Mobile Device Development Write and read in internal storage Write a file FileOutputStream fOut = openFileOutput("test.txt", Context.MODE_PRIVATE); String str = "data"; fOut.write(str.getBytes()); fOut.close(); Read a file FileInputStream fis; fis = openFileInput("test.txt"); StringBuffer fileContent = new StringBuffer(""); byte[] buffer = new byte[1024]; while ((n = fis.read(buffer)) != -1) { fileContent.append(new String(buffer, 0, n)); } Fis.Close();

12 UFCFX5-15-3Mobile Device Development External Storage Directory Find the base directory File baseDir = Environment.getExternalStorageDirectory(); Create App data folder File StoreDir = new File (baseDir.getAbsolutePath() + "/AppName/"); if( !StoreDir.exists() ) StoreDir.mkdirs(); Create a filename with absolute data folder path File dataFile = new File(StoreDir, ”test.txt”);

13 UFCFX5-15-3Mobile Device Development Access to Website The simple way is to use Intent String text = “Android”; Intent intent = new Intent(Intent.ACTION_VIEW); String url = "http://en.wikipedia.org/w/index.php?search="; url += text; intent.setData(Uri.parse(url)); startActivity(intent); Use Webview webView = (WebView) findViewById(R.id.webView1); webView.getSettings().setJavaScriptEnabled(true); webView.loadUrl("http://www.google.com");

14 UFCFX5-15-3Mobile Device Development Building the app Use command prompt to build the app Export App as an unsigned apk file from Eclipse Create a signing key file using keytool keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000 Sign the apk file jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore my_application.apk alias_name Align the apk file zipalign -v 4 your_project_name-unaligned.apk your_project_name.apk

15 UFCFX5-15-3Mobile Device Development Testing the app Distribute App to test users Use ADB to install from PC to android devices adb -d install YOURAPK.apk Email the apk to test users Need to set permission for installing app from the unknown source Use Alfa or Beta option in Google developer console Tests using real devices Run through as many devices as possible (different manufacturer, different screen size, low-end and high-end devices) Memory consumption tests using DDMS Screen orientation test Phone call test

16 UFCFX5-15-3Mobile Device Development Preparing marketing materals Screenshots Use monitor.bat to capture screenshots from devices Device art generator (from Google) to warp app screen shot in real device artwork Can add promotion texts in the screen shot Description texts Short description with key features Use special characters as bullet points Include as many as keywords Include good user reviews

17 UFCFX5-15-3Mobile Device Development Publish app in Google Play Register as an individual developer A valid credit card for verification purpose One-off $25 registration fee Publish free and paid apps Set up a website for your app Facebook page is OK Need to be mobile compatible website Understand Google play policy No adult content No Spam keywords No fake reviews

18 UFCFX5-15-3Mobile Device Development Using Google Services Use Admob as advertisement platform Use Google Game service leaderboards Unlock achievements Use Google App licensing service Use multiple APK support Use Apk expansion files

19 UFCFX5-15-3Mobile Device Development Android Development Resources Official android development resource API guides Example projects Tutorials Technical questions Get answer from Google Watch for stackoverflow.com for answers XDA developer Android forum www.xda-developers.com

20 UFCFX5-15-3Mobile Device Development Publish other markets Amazon appstore Submit the android app without modification except links to Google play Majority devices are Kindle fire tablets (Kindle phone?) Allow price promotion Samsung apps Submit the android app without modification except links to Google play (before 1 st July, 2014) Have to rewrite some of codes in Samsung SDK. BlackBerry App World Accept android app but the app have to be resigned

21 UFCFX5-15-3Mobile Device Development Summary Eclipse have android project wizard and activity wizard to help developer to generate a skeleton android project. Developers have to consider different screen sizes for the design of user interface. Multiple UI layouts are encouraged for tablets and phones. Also if the app supports both portrait and landscape views, two different UI layouts should be used. Store private data in internal storage. But they will be eased if users uninstall the app. To make android users happy, you have to run through as many android devices as possible to test your app. The device list should include tablets and phones, devices without SD cards and devices have low memory and slow CPU.


Download ppt "UFCFX5-15-3Mobile Device Development Android Development SDKs and Publishing."

Similar presentations


Ads by Google