Android asynchronous design API

I am writing an Android library that is essentially asynchronous (waiting for events from a USB device connected to a micro USB port). Considering how Android packages implement asynchronous APIs, I found several different ways:

How do I create my own API? Are there any recommendations for using each kind of API?

+4
source share
1 answer

The main question is whether you will create an API that is synchronous or asynchronous.

Synchronous API

  • API /AsyncTask ( ) , .
  • , ,
  • , API, .

API

  • ( )
  • () - ( , ..).

API, :)

Android ( ), , API ( ..).

PendingIntent (, ). , , .

- . " ". , , parcelable, . - , "" -. , .

, Java- , Android.

+1

All Articles