This version of the rendering library is more recent than
This version of the rendering library is more recent than your version of ADT plug-in. Please update ADT plug-in
Click on menu Help > Install New Software.
In the Work with field, Add: https://dl-ssl.google.com/android/eclipse/
Select: Developer Tools / Android Development Tools.
Click Next to complete the wizard.
If you have problem try download all sdk + eclipse in one pack , rename old folder for example Andorid_old, create new folder Android and unpack sdk + eclipse from this adress:
//developer.android.com/sdk/index.html
Click on menu Help > Install New Software.
In the Work with field, Add: https://dl-ssl.google.com/android/eclipse/
Select: Developer Tools / Android Development Tools.
Click Next to complete the wizard.
If you have problem try download all sdk + eclipse in one pack , rename old folder for example Andorid_old, create new folder Android and unpack sdk + eclipse from this adress:
//developer.android.com/sdk/index.html
396LW NO topic_id
AD
Další témata ....(Topics)
Read file from URL to array of byte and convert to UTF-8 String Android examle source code.
URL urlLoc = new URL("//myweb.com/myfile.html");
URLConnection conexion = urlLoc.openConnection();
conexion.setConnectTimeout(4000);
conexion.setReadTimeout(1000);
conexion.connect();
// downlod the file
InputStream input = new BufferedInputStream(urlLoc
.openStream());
StringBuffer responseBuffer = new StringBuffer();
byte[] byteArray = new byte[1024];
while (input.read(byteArray) != -1)
{
String res = new String(byteArray, "UTF-8");
responseBuffer.append(res);
byteArray = null;
byteArray = new byte[1024];
}
String response = responseBuffer.toString().trim();
ScrollTo(), getTop(), getBottom(), getLeft(), getRight(), ScrollView, LinearLayout Android Java xml example.
How get position of a View.
MainClass.java
main.xml
How get position of a View.
MainClass.java
/*
public void scrollTo (int x, int y)
Since: API Level 1
Set the scrolled position of your view. This will cause a call to onScrollChanged(int, int, int, int) and the view will be invalidated.
This version also clamps the scrolling to the bounds of our child.
Parameters
x the x position to scroll to
y the y position to scroll to
*/
// sroll to top of hscrollViewMain
ScrollView hscrollViewMain = (ScrollView)findViewById(R.id.scrollViewMain);
hscrollViewMain.scrollTo(0, 0); // scroll to application top
// get position of a View
EditText hEdit = (EditText)findViewById(R.id.username_edit);
int nY_Pos = hEdit.getTop(); // getBottom(); X_pos getLeft(); getRight();
// scroll to top of hEdit
hscrollViewMain.scrollTo(0,nY_Pos);
main.xml
<LinearLayout
xmlns:android="//schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ScrollView
android:id="@*id/scrollViewMain"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:paddingTop="5dip"
android:paddingBottom="13dip"
android:paddingLeft="20dip"
android:paddingRight="20dip">
<TextView
android:id="@+id/message"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dip" />
<TextView
android:textAppearance="?android:attr/textAppearanceSmall"
android:textStyle="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/login_activity_username_label" />
<EditText
android:id="@+id/username_edit"
android:singleLine="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:minWidth="250dip"
android:scrollHorizontally="true"
android:capitalize="none"
android:autoText="false"
android:inputType="textEmailAddress" />
</LinearLayout>
</ScrollView>
</LinearLayout>
How setup color coloring highlight highlighting syntax font size and family in Eclipse Java and XML editor Android example
Java editor
xml editor
xml editor double click in Preferences dialog on xml -> Editor -> Syntax coloring
[caption id="attachment_627" align="alignleft" width="297" caption="Eclipse editor syntax color settings"][/caption]
Java editor
- Go to Eclipse menu Window -> Preferences
- Doubleclick on Java
- Double click on Editor
- Select Java, Javadocs or Comments and setup color and font
- Font size and family change from Window->Preferences-> General->Appearance->Colors and Fonts
- Press OK for saving changes
xml editor
xml editor double click in Preferences dialog on xml -> Editor -> Syntax coloring
[caption id="attachment_627" align="alignleft" width="297" caption="Eclipse editor syntax color settings"][/caption]
Constructor SimpleCursorAdapter is deprecated.
If using api 11 and above, you can try add last parameter 0.
If using api 11 and above, you can try add last parameter 0.
Cursor cursor = managedQuery(...........,,,,);
// Specify the columns we want to display in the result
String[] from = new String[] { KEY_WORD,
KEY_DEFINITION };
// Specify the corresponding layout elements where we want the columns to go
int[] to = new int[] { R.id.word,
R.id.definition };
// deprecated
SimpleCursorAdapter words =
new SimpleCursorAdapter(this,
R.layout.result, cursor, from, to);
// working
SimpleCursorAdapter words =
new SimpleCursorAdapter(this,
R.layout.result, cursor, from, to, 0); // to, 0!!!!
//working in Fragment
SimpleCursorAdapter mAdapter = new SimpleCursorAdapter(getActivity(),
android.R.layout.simple_list_item_2, null,
new String[] { "name", "age" }, // cursor parameters
new int[] { android.R.id.text1, android.R.id.text2 }, 0);
Important: Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB
Example of usage:
int layout = Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB ?
android.R.layout.simple_list_item_activated_1 :
android.R.layout.simple_list_item_1;
getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
getListView().setItemChecked(position, true);
Example of usage:
public void updateList() {
Context ctx = getActivity();
Notes notes = new Notes(ctx);
String[] from = { Notes.COLUMN_TITLE };
int[] to = { android.R.id.text1 };
int layout = Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB ?
android.R.layout.simple_list_item_activated_1 : android.R.layout.simple_list_item_1;
ListAdapter adapter = new SimpleCursorAdapter(ctx,
layout, notes.getNotes(), from,
to, 0);
setListAdapter(adapter);
notes.close();
}
/..................
@Override
public void onListItemClick(ListView l, View v, int position, long id) {
// Set the item as checked to be highlighted when in two-pane layout
getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
getListView().setItemChecked(position, true);
}
Editace: 2014-02-15 20:14:44
Počet článků v kategorii: 396
Url:this-version-of-the-rendering-library-is-more-recent-than