Keep things simple. More features are not always a good thing. Often they are looking for what they can remove from their site.
Build and release. Don't think you understand your users. Release new features, see how it works out with the users. Then iterate.
He also had some ideas about building community via Podcasting and parties and such. Not everyone is a Podcaster methinks. Also, it seems like the launch party thing is really only gonna work in Silicon Valley. Probably not a great help if you live in Northern Wyoming, for example.
In regard to other things Digg, I was listening to a 3 week old This Week in Tech pod cast. Kevin stated that with 40 million unique visitors a month Digg has reached the limits of MySQL. They are planning to move their back end to the open source Cassandra database.
I think that is a nice little factoid to know. Once you hit 20 or 30 million uniques, you may have to start weighing your database options.A nice problem to have. :)
In the article Layout Animation, list_layout_controller is included in layout, main.xml. In the last article ListView and ListActivity, ListView is implemented as ListActivity, without XML file for layout. How can apply the LayoutAnimationController.
In this article, the same visual effect of Layout Animation will be applied on ListView and ListActivity.
A ListView is a View that shows items in a vertically scrolling list. The items are acquired from a ListAdapter.
In this exercise, I will show how to implement a ListView using ListActivity. The main activity (AndroidListView) call the ListActivity(AndroidListActivity) by startActivityForResult. AndroidListActivity have a ListView only, the selected item will be passed back to AndroidListView by means of Bundle.
_ Create a new Android Application named AndroidListView
- Modify main.xml to have a Button to start the ListActivity with ListView, and have a TextView to show the result from ListActivity.
/** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main);
private Button.OnClickListener SelectCountryButtonOnClickListener = new Button.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub Intent intent = new Intent(); intent.setClass(AndroidListView.this, AndroidListActivity.class);
startActivityForResult(intent, 0); } };
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { // TODO Auto-generated method stub super.onActivityResult(requestCode, resultCode, data); if (requestCode==0) { switch (resultCode) { case RESULT_OK: MyCountry.setText(data.getStringExtra("country")); break; case RESULT_CANCELED: break;
}
} }
}
- Create AndroidListActivity extends ListActivity
Right click com.exercise.AndroidListView, the package In the Project Windows on the left. Select New > Class >
Click Browser beside Superclass, select ListActivity. (May be you have to clear the content inside "Choose a type" box to make it appear in the "Matching items" list.
Notice that we don't need to load a layout (at least, not in this case, because we're using the whole screen for our list). Instead, we just call setListAdapter() (which automatically adds a ListView to the ListActivity), and provide it with an ArrayAdapter that binds a simple_list_item_1 layout item to each entry in the COUNTRIES array (added next). The next line of code adds a text filter to the ListView, so that when the user begins typing, the list will filter the entire view to display only the items that match the entry.
- Modify AndroidMainfest.xml to include the AndroidListActivity.
Layout Animation can be used to add visual effects on any controls derived from ViewGroup, such as ListView. ListView is a view that shows items in a vertically scrolling list. The items come from the ListAdapter associated with this view.
In this article, I will have a example to show how to implement a simple Layout Animation.
Create a Android Application named AndroidLayoutAnimation.
- Create a new folder named /anim under /res
- Create two xml file under /res/anim to handle the animation list_layout_controller.xml
- Modify AndroidLayoutAnimation.java to setContentView() using listlayout.xml, and SetupListView(). In order to show the effect, a button is used to restart the animation.
public class AndroidLayoutAnimation extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
loadScreen(); }
private Button.OnClickListener MyRestartButtonOnClickListener = new Button.OnClickListener(){
@Override public void onClick(View v) { // TODO Auto-generated method stub loadScreen(); } };
private void SetupListView() { String[] listItems = new String[] { "Hello!", "It's a Demo to use Layout Animation", "Is it Great?", "android-er.blogspot.com" };
ArrayAdapter<String> listItemAdapter = new ArrayAdapter<String>( this, android.R.layout.simple_list_item_1, listItems);
In the article Simulate Animation, using Runnable Thread, I described how to simulate animation using Runnable Thread. For sure, it's not a good practice. In this article I show how to implement animation using animation-list and AnimationDrawable.
The animation can be started and stopped by the two button, Start and Stop.
- Save the four graphics, used to form the animation of a rotating arrow, in the /res/drawable/ folder.
- Create a file named arrow_animation.xml in /res/drawable
public class AndroidAnimationDrawable extends Activity {
AnimationDrawable AniFrame;
/** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main);
Button.OnClickListener MyStartButtonOnClickListener = new Button.OnClickListener(){ @Override public void onClick(View v) { // TODO Auto-generated method stub AniFrame.start(); } };
Button.OnClickListener MyStopButtonOnClickListener = new Button.OnClickListener(){ @Override public void onClick(View v) { // TODO Auto-generated method stub AniFrame.stop(); } };
}
---------------------------------------- In the book of Professional Android Application Development (Wrox Programmer to Programmer) by Reto Meier, it's stated that:
At the time of going to print, there is a bug in the AnimationDrawable class. Currently, AnimationDrawable resources are not properly loaded until some time after an Activity�s onCreate method has completed. Current work-arounds use timers to force a delay before loading a frame-by-frame resource.
I have the same problem; if AniFrame.start() is called inside onCreate() immediately, the animation cannot start. That's why I add the buttons to start and stop the operation. ----------------------------------------
It's a Twitter Client post updated status using Twitter API.
There are three EditText in the application, for user name, password (hiden by password dots) and updated status. Submit to Twitter by pressing of the Submit button. If successful, a Toast with "OK" will be shown, otherwise "ERROR" will be shown.
- Before start; base64 is needed in the application, refer to the article Use base64 in Android to download and include it in the Build Path of the project.
/** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main);