1 / 7

lec 07

lec 07. Graphics Animations Location Services (GPS) Translating Location to Address Translating Address to Location. Graphics resources in Android. PNG (Portable Network Graphics) is a very versatile format among the raterized formats Make/search for PNGs with transparent backgrounds.

fell
Download Presentation

lec 07

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. lec 07 • Graphics • Animations • Location Services (GPS) • Translating Location to Address • Translating Address to Location

  2. Graphics resources in Android . PNG (Portable Network Graphics) is a very versatile format among the raterized formats Make/search for PNGs with transparent backgrounds. Raster versus Vector Vector will render perfectly every time and scales infinitely. If you need to use buttons with fancy borders, use 9patch. Good resource is http://openclipart.org/ From this you can get/create most any graphic element you need.

  3. Use 9-Patch Steps to creating 9-patch image 1/ find a good png with a transparent background. 2/ open in image editor (Photoshop) and create at least a 1px tranparent margin along all sides. 3/ Issue the following command from command-line: draw9patch 4/ drag/open your png into this tool. 5/ Define registration marks; left and top define the scalable area, and the bottom and right define the content area.

  4. Scaling images Android drawable directory structure. drawable is the default directory. drawable-mdpi (medium) is usually the corresponding directory with the same assets drawable-ldpi (low) drawable-hdpi (high) drawable-xhdpi (extra-high) Android's recommended percentages: 75%, 100%, 150%, 200% where medium is the baseline When scaling your images, find the highest possible resolution and scale like this: 37.5%, 50%, 75%, 100% where xhdpi is the baseline

  5. Using Location Services in Android . You must generate a debug key. See video on how to do this. ~/content/lec07/22GenerateKey.webm Your key is dev-machine specific. If you're developing on a laptop and a desktop, you will need seperate keys for each. Window || Preferences || Android || Build to see where the key is stored. You don't have to, but it's easier if you externalize the key to a string.

  6. Using Location Services in Android . Translate from place description e.g. 'Millennium park' to location. Translate from location to map Overlays: extends ItemizedOverlay<OverlayItem>

  7. Context . In Android, Context is God. It give you direct access to application level calls such as startActivity and startService. Many components in Android indirectly extend the Context class, including Activity and Service, but you're better off accessing the ApplicationContext because it will never be null so long as the app is in memory. http://stackoverflow.com/questions/6854265/getapplicationcontext-getbasecontext-getapplication-getparent http://stackoverflow.com/questions/1026973/android-whats-the-difference-between-the-various-methods-to-get-a-context

More Related