Imagine for example that you have a twitter app (I honestly dont use twitter, so my example may be bad, but I think its something enough people use to understand where I am going with it.). This twitter app has a few key "core" concepts. Posting, Change Follow status, Change settings etc. It may be obvious to some, but these would be ideal candidates to be activities. Activities which may consist of one or more Views being displayed. How exactly does the application entry points have anything to do with this? Using intent filters etc, I can allow any of these activities to be launched from other apps, or directly from launcher itself as exactly that... a well defined process. Multiple activities dont have to mean multiple entry points, but when you think of exposing New Tweet functionality to other apps, you expose the activity in your activity filter.
Intent intent = new Intent(); intent.setClassName("com.mycompany.someapp", "com.mycompany.someapp.Tweet"); intent.putExtra("com.mycompany.someapp.TweetMessage", "Hello world!"); startActivity(intent);
Which loosely translates to the pseudo code:
Open Tweet activity setting TweetMessage to "Hello World" (which I can retrieve and use later
A brief post, but hopefully may ease the transition from development in other languages
0 comments:
Post a Comment