Statistics usability of mobile phones with Android - September 2011
(Our software)
1 | Samsung Galaxy S2 | 13.8% (1,232) |
2 | Samsung Galaxy S | 8.5% (762) |
3 | Samsung Galaxy Tab | 7.4% (659) |
4 | Samsung Galaxy Mini | 5.4% (483) |
5 | Samsung Galaxy S | 4.0% (356) |
6 | HTC Desire HD | 3.8% (341) |
7 | Samsung Galaxy Ace | 3.8% (339) |
8 | HTC Wildfire | 3.2% (286) |
9 | Samsung Galaxy Fit | 3.1% (274) |
10 | SEMC Xperia X10 | 2.1% (190) |
396LW NO topic_id
AD
Další témata ....(Topics)
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>
Rotate a bitmap Android source code.

public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(new SampleView(this));
}
private static class SampleView extends View {
// CONSTRUCTOR
public SampleView(Context context) {
super(context);
setFocusable(true);
}
@Override
protected void onDraw(Canvas canvas) {
Paint paint = new Paint();
canvas.drawColor(Color.YELLOW);
// Bitmap b = Bitmap.createBitmap(200, 200, Bitmap.Config.ARGB_8888);
// you need to insert a image flower_blue into res/drawable folder
Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.flower_blue);
Matrix mat = new Matrix();
mat.postRotate(90);
Bitmap bmpRotate = Bitmap.createBitmap(bmp, 0, 0,
bmp.getWidth(), bmp.getHeight(),
mat, true);
int h = bmp.getHeight();
canvas.drawBitmap(bmp, 10,10, paint);
canvas.drawBitmap(bmpRotate, 10,10 + h + 10, paint);
}
}
}

Dil 3. HeadlinesFragment.java
V 1. dílu jsme se něco dozvěděli od XML souborech
V 2. dílu jsme rozebrali MainActivity.java
V tomto dílu si rozebereme záludnosti v HeadlinesFragment.java souboru.
Používáme příklad i zip porojekt z https://developer.android.com/training/basics/fragments/creating.html Pozorně si jej nastudujte.
V 1. dílu jsme se něco dozvěděli od XML souborech
V 2. dílu jsme rozebrali MainActivity.java
V tomto dílu si rozebereme záludnosti v HeadlinesFragment.java souboru.
Používáme příklad i zip porojekt z https://developer.android.com/training/basics/fragments/creating.html Pozorně si jej nastudujte.
package com.example.android.fragments;
import android.app.Activity;
import android.os.Build;
import android.os.Bundle;
// pokud chceme aby byla aplikace spustitelná i v nižších verzích Androidu
import android.support.v4.app.ListFragment;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
// extends ListFragment důležité pro základní obsluhu ListView atd.
public class HeadlinesFragment extends ListFragment {
// zajistí zpětné odesílání zprav - zde zachytí kliknutí uživatele na položku
// v ListView - seznamu položek
OnHeadlineSelectedListener mCallback;
// pro odposlouchávání zpráv v ListView a odesílání do MainActivity.java
public interface OnHeadlineSelectedListener {
/**
funkce je volána onArticleSelected z HeadlinesFragment když uživatel
klikne na item v ListView - položku seznamu -
Tělo funkce je v MainActivity!!! Tam proběhnou potřebné úkony.
Například výměna fragmentů atd. */
public void onArticleSelected(int position);
}
/** Protože je HeadlinesFragment rozšířením (extends) ListFragment
používá funkci onCreate().
ArticleFragment extends Fragment bude používat onCreateView()
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Zde si pohlídáme verze Androidu a přiřadíme jim
// předdefinovanou šablonu XML souboru
// Je to důležité pokud chceme využívat více možností,
// které nové verze nabízejí
// například podbarvení vybrané položky seznamu
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;
// zde se vytovoří jednotlivé položky seznamu v ListView
// Pole vypadá takto:
// static String[] Headlines = {"Article One","Article Two"};
// položky tedy ponesou názvy ze String[] Headlines
// Teoreticky si menší pole položek můžete dát i sem pro jednodušší editaci
setListAdapter(new ArrayAdapter<String>(getActivity(), layout, Ipsum.Headlines));
}
@Override
public void onStart() {
super.onStart();
// Pokud se bude zobrazovat dual-panel
// (pro tablety, větší obrazovky)
// například je dobré
// když bude zvýrazněna vybraná položka setChoiceMode(ListView.CHOICE_MODE_SINGLE);
// Toto provádíme v onStart(), kdy máme přístup k listview
if (getFragmentManager().findFragmentById(R.id.article_fragment) != null) {
getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
}
}
// onAttach() bude asi deprecated, tak můžete vyzkoušet
/*
@Override
public void onAttach(Context context) {
super.onAttach(context);
Activity a;
if (context instanceof Activity){
a=(Activity) context;
}
}
*/
// nebo pohledat něco na inetu
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
// Zde přiřadíme odposlouchávání zprávy kliknutí na položku ListView
// a zpětnou vazbu s MainActivity.
// Pokud se to nepodaří, bude zaznamenáno a předáno dál chybové hlášení
try {
mCallback = (OnHeadlineSelectedListener) activity;
} catch (ClassCastException e) {
throw new ClassCastException(activity.toString()
+ " must implement OnHeadlineSelectedListener");
}
}
/** kliknuto na položku ListView */
@Override
public void onListItemClick(ListView l, View v, int position, long id) {
// long id se bude hodit například při obsluze sql.databází
// Upozorní - předá zprávu MainActivity.java, že uživatel
// klikl na položku a odešle i pozici v seznamu
mCallback.onArticleSelected(position);
// getListView().setItemChecked(position, true);
// má zajistit podbarvení
// - zvýraznění vybrané položky,
// ale mi to nefungovalo, tak jsem ještě znovu přidal,
// které je už v onStart() a už to funguje jak má
// Možná nějaká záludnost v mém telefonu :(
getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
getListView().setItemChecked(position, true);
}
}
Brand | Motorola |
Model (codename) | Droid Razr |
Price (cena, včetně DPH v KCZ) | 10800 / 06.2012 |
Display size in Inch (v palcích) | 4.3 |
Display-resolution | 540x960 |
Dotek-typ | capacitive |
CPU typ | TI 4430 |
CPU MHz | 1.2 GB |
CPU core | 2 |
L2 cache | |
RAM | 1024 |
ROM | 15600 |
GPU | SGX540 |
NenaMark2 Benchmark | |
GPU-GLBenchmark | 3299 |
Baterie mAh | 1780 |
Foto MPx | 8 |
Autofocus | AF |
Video | HD video 30 frames/s |
Official Android ICS | Google Android 2.3.5 (Gingerbread) |
CyanogenMod support | |
Dotek-prstů-max | 10 |
Display-ppi | 256 |
Display-retina | 79% |
Networks | |
Connectivity | GSM: 850/900/1800/1900 MHz, EDGE, GPRS 3G: 900/2100 MHz, HSDPA, HSUPA, HSPA+ Bluetooth: 4.0 (EDR, A2DP, FTP, PBAP, AVRCP) Wi-Fi: 802.11b/g/n PC: microUSB, USB 2.0, microHDMI Senzors: proximity, gyroskop, akcelerometr GPS: yes, A-GPS, digital compas |
Note | Super AMOLED Display |
Motorola Droid Razr image

If I trying
android-sdk_r22.6.2-windows.zip
adt-bundle-windows-x86_64-20140321.zip
and open xml layout graphic editor and xml layout file
memory continues to grow to crashes Eclipse
https://developer.android.com/sdk/index.html
I have to install old version adt-bundle-windows-x86-20131030.zip
what working fine.
I had to delete .metadata folder in workspace if I want open old version ADT
android-sdk_r22.6.2-windows.zip
adt-bundle-windows-x86_64-20140321.zip
and open xml layout graphic editor and xml layout file
memory continues to grow to crashes Eclipse
https://developer.android.com/sdk/index.html
I have to install old version adt-bundle-windows-x86-20131030.zip
what working fine.
I had to delete .metadata folder in workspace if I want open old version ADT
Editace: 2011-10-19 08:16:12
Počet článků v kategorii: 396
Url:statistics-usability-of-mobile-phones-with-android-september-2011