Development environment has long been installed, has not been done. Today is a record here, but also a supervision of their own.
Development environment:
Win7 System, the official website download Adt-bundle-windows, contains the eclipse and the Android SDK, did not use Android Studio mainly consider the current most people use or eclipse, encountered a problem is better solved.
1, using the Sdkmaneger installation API each version is quite slow.
You can actually download or copy the corresponding version of the file and drag it directly to the Sdk/platforms directory. or set up a proxy server in tools->options to install or update it using an open source image station in a domestic university or institution.
2, EditText is not found when using layout layouts
Eclipse uses the Android 4.4W version of API 20 by default, which is available to wearable devices without edittext.
Change a lower version, (General mobile app, according to the user group's attributes, select the appropriate version)
3,onclicklistener cannot is resolved to a type
Btn_login.setonclicklistener (New Onclicklistener () { @Override public void OnClick (View v) { //TODO auto-generated method Stub toast.maketext (Loginactivity.this, "Login Successful", Toast.length_short). Show (); });
The above error occurred because the "Onclicklistener" interface was moved to the view class after the Android version was upgraded.
Workaround: Change "new Onclicklistener" to "new View.onclicklistener", or use Eclipse to automatically import all related Java packages with shortcut keys: "Ctrl+shift+o"
Import Android.view.View.OnClickListener;
4,progressbar will occupy the location of the layout
If you want to use ProgressBar to do loading status display, it might not be ideal for simple layout implementations. Here do not delve into the ProgressBar of the application of the scene, just a simple solution to my problem.
In LinearLayout and Relativelayout, when the ProgressBar is visible, it occupies space in the layout and squeezes the normal control position. Using Framelayout can be achieved, but more complex.
, the button is squeezed to the next line. The simple implementation of masking loading can be done with ProgressDialog, a few lines of code.
ProgressDialog Progress_dialog = new ProgressDialog (mainactivity.this);pd _login.setmessage ("Loading ...");PD _ Login.show ();
Feel the Android version problem, more chaotic, any heavy and long way, sleep.
Beginners Learn Android 1: New entry encounters with some little pits