Skip to main content

Posts

Showing posts from 2013

Simple understand about Android ninepatch

This is the well formed tutorial about Android ninepatch, noted from "http://radleymarx.com/blog/simple-guide-to-9-patch/"  asically, 9-patch uses png transparency to do an advanced form of  9-slice  or  scale9 . The guides are straight, 1-pixel black lines drawn on the edge of your image that define the scaling and fill of your image. By naming your image file  name.9.png , Android will recognize the  9.png format and use the black guides to scale and fill your bitmaps. Here’s a basic guide map: As you can see, you have guides on each side of your image. The TOP and LEFT guides are for scaling your image (i.e. 9-slice), while the RIGHT and BOTTOM guides define the fill area. The black guide lines are cut-off/removed from your image – they won’t show in the app.  Guides must only be one pixel wide, so if you want a 48×48 button, your png will actually be 50×50. Anything thicker than one pixel will remain part of your image. (My examples have 4-pixel wide guides for

Launch android application within Unity app.

In Unity android application(called application A), you want to launch other android app(application B). I had tried to follow some entries and try :  List<ApplicationInfo> packages =  getPackageManager() .getInstalledApplications(PackageManager. GET_META_DATA ); for  (ApplicationInfo packageInfo : packages) { if (packageNameToOpen.equals(packageInfo. packageName )){ try { Intent intent =  new  Intent(); intent.putExtra(key, value); intent.setComponent( new  ComponentName(packageName,activityName)); UnityPlayer. currentActivity .startActivity(intent); } catch (Exception e){ } Android manages its items in "tasks" and "activity stack". If you normally call new activity as above, the activity of other app would be put in to same task of the current applications, which means you are not openning new application. You can see an example of opening mail client, the mail client allow you to call mail activity and it is put in to your curren