140 likes | 237 Views
Android laşdırdıqlarımızdansınızmı ?. Rajab Davudov. Agenda. Eclipse, ADT and Android SDK APK file Fundamentals Activity Service Content Provider Broadcast Receiver Intent Hello World Fake Login App Play-Back Service. Eclipse + ADT + Android SDK.
E N D
Androidlaşdırdıqlarımızdansınızmı ? Rajab Davudov
Agenda • Eclipse, ADT and Android SDK • APK file • Fundamentals • Activity • Service • Content Provider • Broadcast Receiver • Intent • Hello World • Fake Login App • Play-Back Service
Eclipse + ADT + Android SDK • Download Eclipse IDE for Java Developers from http://eclipse.org/downloads/ • Menu [Help/Install New Software] add ADT site https://dl-ssl.google.com/android/eclipse/ • Download SDK • Tools • Android Platforms 4.0, 3.2, … ,2.3.3,2.2, … • Extras
APK File • AndroidManifest.xml • Activity, Service etc. list • Permissions and Features • classes.dex • Dalvikbytecodes • resources.arsc • Information about resources • res/ • Resource Files
Activity • An Activity is an application component that provides a screen with which users can interact in order to do something, such as dial the phone, take a photo, send an email, or view a map • Each time a new activity starts, the previous activity is stopped, but the system preserves the activity in a stack (the "back stack"). • There are several callback methods that an activity might receive, due to a change in its state—whether the system is creating it, stopping it, resuming it, or destroying it • You must declare your activity in the manifest file in order for it to be accessible to the system. • You can start another activity by calling startActivity(), passing it an Intent that describes the activity you want to start.
Service • A Service is an application component that can perform long-running operations in the background and does not provide a user interface. • Once started, a service can run in the background indefinitely, even if the component that started it is destroyed. • A bound service offers a client-server interface that allows components to interact with the service, send requests, get results, and even do so across processes with interprocess communication (IPC). • onStartCommand() and onBind() • Like activities (and other components), you must declare all services in your application's manifest file.
Content Provider • Content providers store and retrieve data and make it accessible to all applications. They're the only way to share data across applications; there's no common storage area that all Android packages can access. • How a content provider actually stores its data under the covers is up to its designer. But all content providers implement a common interface for querying the provider and returning results — as well as for adding, altering, and deleting data. • Each content provider exposes a public URI (wrapped as a Uri object) that uniquely identifies its data set. android.provider.Contacts.Phones.CONTENT_URI • Abstract methods • query() • insert() • update() • delete() • getType() • onCreate()
Broadcast Receiver • A broadcast receiver is a component that responds to system-wide broadcast announcements. Many broadcasts originate from the system—for example, a broadcast announcing that the screen has turned off, the battery is low, or a picture was captured. • Although broadcast receivers don't display a user interface, they may create a status bar notification to alert the user when a broadcast event occurs.
Intent • Three of the core components of an application — activities, services, and broadcast receivers — are activated through messages, called intents. • The intent itself, an Intent object, is a passive data structure holding an abstract description of an operation to be performed. • Contains • Component Name • Action • Data • Extras • Category • Flags
Practice Apps • Hello World • Fake Login App • Play-Back Service
Rajab Davudov Senior Developer at Azerfon radjab@gmail.com https://market.android.com/developer?pub=RADJAB http://gplus.to/radjab http://www.fb.me/rajab.davudov http://www.linkedin.com/in/radjab Market QR Code