Download presentation
Presentation is loading. Please wait.
Published byBeverly Mosley Modified over 8 years ago
1
Resources & Android Manifest Калин Кадиев Astea Solutions AD
2
Retrospection: Hello World setContentView(R.layout.main); The only code we see is setContentView(R.layout.main); Where is the “Hello” string? Obviously, go to R.java AUTO-GENERATED FILE. DO NOT MODIFY
3
Idea: Anything that isn't code should be separated from the code Goal: Easier support of different device configurations Schema: – Put your resources in /res – Android generates R.java compile-time – Access resources via the R.java Application resources
4
Resource types String: /res/values Drawable: /res/drawable – Simplest case: png, jpg or gif – General concept for a graphic that can be drawn to the screen
5
Resource types Layout: /res/layout – Defines the architecture for the UI in an Activity or a component of a UI – <RelativeLayout xmlns:android="..." android:layout_width="fill_parent" android:layout_width="fill_parent" android:layout_height="fill_parent" > android:layout_height="fill_parent" > <Button android:id="@+id/button" <Button android:id="@+id/button" android:layout_width="wrap_content" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_height="wrap_content" android:text="Hello, I am a Button" /> android:text="Hello, I am a Button" /></RelativeLayout>
6
Resource types Style Menu Animation Others...
7
Directory qualifiers Screen density: ldpi, mdpi, hdpi, … Orientation: port, land Locale: en, en-US, etc. Platform version: v Screen Size: small, normal, large, xlarge
8
Resources resolving Android represents unified access to your resources and automatically selects which resource to use, depending on the current device configuration.
9
Android Manifest Presents essential information about the application to the Android system. Names the application package. The package name serves as a unique identifier for the application. Specifies the versionCode. Used by the market to detect updates.
10
Android Manifest Describes (not necessarily) application components - activities, services, broadcast receivers, content providers Declares application permissions <uses-permission android:name= "android.permission.ACCESS_FINE_LOCATION"> Declares the minimum API level Lists the libraries linked against
11
Market filtering Screen size: Device features: Software libraries: Permissions: – If the permission is hardware-oriented and not stated in, the feature is considered required SDK:
12
Q&A + Feedback Questions? Feedback section: – Did you hear well? – Was there anything you didn’t understand? – What would you like changed in our next lecture?
13
Further reading Resources Providing resources Supporting multiple screens Android Manifest Market Filtering
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.