Mengatasi screen freeze pada milestone

by Rangga Warsito » Wed, 06 Apr 2011 23:54:09 GMT


Sponsored Links
 saya butuh bantuan teman teman nih..maklum masih pemula..Milestone saya baru
upgrade ke froyo tapi belum di root melalui situs motorola..
setelah di ugrade screennya sering freexe bagaimana mengatasinya...trims


Rangga

-- 
===============



Re: Mengatasi screen freeze pada milestone

by Rangga Warsito » Tue, 12 Apr 2011 00:00:28 GMT


 udah dicoba dan berhasil nggak freeze..thank bro..

2011/4/7 satrio <tukang.distrib...@gmail.com>



-- 
===============


Sponsored Links


Re: Mengatasi screen freeze pada milestone

by Imad » Sat, 16 Apr 2011 10:04:38 GMT


 Wah mantabs...

Tanda2 milestone asia apa yah?

*milestone with Cyanogen 6.1.2*




-- 
"



Re: Mengatasi screen freeze pada milestone

by satrio » Sat, 16 Apr 2011 12:05:38 GMT


 Masuk ke setting > about phone
Lihat firmware configurationnya, ada tulisan asia :)




-- 
"



Other Threads

1. problem with Search suggestions

I am trying to implement search suggestions in my app in the lines of
Searchable Dictionary, except that my data comes from a Sqlite
Database.

Everything seems to be working except the suggestions. I created a
sample animal database with these values
 {"Lion", "Tiger", "Elephant", "Deer", "Kangaroo"}

Now when I start typing and click on submit button it works fine.

example typing 't' and hitting search returns the list with Tiger and
Elephant. But when showing search suggestions it seems to get the
correct number of items being returned as it shows those many rows but
it does not populate them. When I click on any of the rows I see that
its not passing selectionArgs. It is being null.

What might be causing this issue?
Here is my Database class
====================DATABASE===================
package com.achie.gs1;

public class SampleDatabase {


        private static final String DATABASE_NAME = "zoodatabase.db";
        private static final String ANIMALS_TABLE = "animals";
        private static final int DATABASE_VERSION = 2;

        private final ZooOpenHelper mDatabaseOpenHelper;
        private static final HashMap<String, String> mColumnMap =
buildColumnMap();

        public static final String ANIMAL_NAME = "name";

        public SampleDatabase(Context context) {
                mDatabaseOpenHelper = new ZooOpenHelper(context);
        }

        private static HashMap<String, String> buildColumnMap() {
                HashMap<String, String> map = new HashMap<String, String>();
                map.put(ANIMAL_NAME, ANIMAL_NAME);
                map.put(BaseColumns._ID, "rowid AS "+BaseColumns._ID);
                map.put(SearchManager.SUGGEST_COLUMN_INTENT_DATA_ID, "rowid AS
"+SearchManager.SUGGEST_COLUMN_INTENT_DATA_ID);
                map.put(SearchManager.SUGGEST_COLUMN_SHORTCUT_ID, "rowid AS
"+SearchManager.SUGGEST_COLUMN_SHORTCUT_ID);

                return map;
        }

        public Cursor getAnimal(String rowId, String[] columns) {
                String selection = "rowid = ?";
                String[] selectionArgs = new String[] {rowId};
                return query(selection, selectionArgs, columns);
        }

        public Cursor getAnimalMatches(String query, String[] columns) {
                String selection = ANIMAL_NAME + " LIKE ?";
                String[] selectionArgs = new String[] {"%"+query+"%"};
                return query(selection, selectionArgs, columns);
        }

        private Cursor query(String selection, String[] selectionArgs,
String[] columns) {
                SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
                qb.setTables(ANIMALS_TABLE);
                qb.setProjectionMap(mColumnMap);

                Cursor cursor = 
qb.query(mDatabaseOpenHelper.getReadableDatabase(),
columns, selection, selectionArgs, null, null, null);
                if(cursor == null) {
                        return null;
                } else if (!cursor.moveToFirst()) {
                        cursor.close();
                        return null;
                }
                return cursor;
        }

        private static class ZooOpenHelper extends SQLiteOpenHelper {

                private SQLiteDatabase mDatabase;
                private static final String CREATE_ANIMALS_TABLE = "CREATE TABLE
"+ANIMALS_TABLE+
                        " (_id integer primary key autoincrement, 
"+ANIMAL_NAME+" text not
null);";
                private static final String[] ANIMALS = new String[] {"Lion",
"Tiger", "Elephant", "Deer", "Kangaroo"};

                public ZooOpenHelper(Context context) {
                        super(context, DATABASE_NAME, null, DATABASE_VERSION);
                }

                public void onCreate(SQLiteDatabase db) {
                        mDatabase = db;
                        mDatabase.execSQL(CREATE_ANIMALS_TABLE);
                        loadDatabase();
                }

                public void onUpgrade(SQLiteDatabase db, int oldVersion, int
newVersion) {}

                private void loadDatabase() {
                        new Thread(new Runnable() {
                                @Override
                                public void run() {
                                        loadAnimals();
                                }
                        }).start();
                }

                private void loadAnimals() {
                        for (int i=0; i<ANIMALS.length; i++) {
                                ContentValues initialValues = new 
ContentValues();
                                initialValues.put("name", ANIMALS[i]);
                                mDatabase.insert(ANIMALS_TABLE, null, 
initialValues);
                        }
                }
        }

}
=================================
Here is my content provider
============PROVIDER=============
package com.achie.gs1;

public class SampleProvider extends ContentProvider{

        public static String AUTHORITY = "com.achie.gs1.SampleProvider";
        public static final Uri CONTENT_URI = Uri.parse("content://"+AUTHORITY
+"/animals");

        public static final String ANIMALS_MIME_TYPE =
ContentResolver.CURSOR_DIR_BASE_TYPE+"/vnd.achie.gs1.animal";
        public static final String ANIMAL_ITEM_MIME_TYPE =
ContentResolver.CURSOR_ITEM_BASE_TYPE+"/vnd.achie.gs1.animal";

        private SampleDatabase mDatabase;

        private static final int GET_ANIMALS = 0;
        private static final int GET_ANIMAL_ITEM = 1;
        private static final int ANIMAL_SUGGEST = 2;
        private static final int SHORTCUT_REFRESH = 3;

        private static final UriMatcher sUriMatcher = buildUriMatcher();

        private static UriMatcher buildUriMatcher() {
                UriMatcher matcher = new UriMatcher(UriMatcher.NO_MATCH);
                // Get animals
                matcher.addURI(AUTHORITY, "animals", GET_ANIMALS);
                matcher.addURI(AUTHORITY, "animals/#", GET_ANIMAL_ITEM);
                // To get suggestions
                matcher.addURI(AUTHORITY, SearchManager.SUGGEST_URI_PATH_QUERY,
ANIMAL_SUGGEST);
                matcher.addURI(AUTHORITY, SearchManager.SUGGEST_URI_PATH_QUERY 
+ "/
*", ANIMAL_SUGGEST);

                matcher.addURI(AUTHORITY, 
SearchManager.SUGGEST_URI_PATH_SHORTCUT,
SHORTCUT_REFRESH);
                matcher.addURI(AUTHORITY, 
SearchManager.SUGGEST_URI_PATH_SHORTCUT+"/
*", SHORTCUT_REFRESH);

                return matcher;
        }

        @Override
        public boolean onCreate() {
                mDatabase = new SampleDatabase(getContext());
                return true;
        }

        @Override
        public Cursor query(Uri uri, String[] projection, String selection,
String[] selectionArgs, String sortOrder) {
                switch(sUriMatcher.match(uri)) {
                        case ANIMAL_SUGGEST:
                                if (selectionArgs == null){
                                        throw new IllegalArgumentException(" 
selectionArgs must be
provided for the uri for suggestion at a:\n "+uri);
                                }
                                return searchAnimals(selectionArgs[0]);
                        case GET_ANIMALS:
                                if (selectionArgs == null){
                                        throw new IllegalArgumentException(" 
selectionArgs must be
provided for the uri for searching animals at a:\n "+uri);
                                }
                                return searchAnimals(selectionArgs[0]);
                        case GET_ANIMAL_ITEM:
                                return getAnimal(uri);
                        case SHORTCUT_REFRESH:
                                return refreshShortcut(uri);
                        default:
                                throw new IllegalArgumentException("Unknown Uri 
at a: "+uri);
                }
        }

        @Override
        public String getType(Uri uri) {
                switch (sUriMatcher.match(uri)) {
                        case GET_ANIMALS:
                                return ANIMALS_MIME_TYPE;
                        case GET_ANIMAL_ITEM:
                                return ANIMAL_ITEM_MIME_TYPE;
                        case ANIMAL_SUGGEST:
                                return SearchManager.SUGGEST_MIME_TYPE;
                        case SHORTCUT_REFRESH:
                                return SearchManager.SHORTCUT_MIME_TYPE;
                        default:
                                throw new IllegalArgumentException("unknown Url 
"+uri);
                }
        }

        private Cursor refreshShortcut(Uri uri) {
                String rowId = uri.getLastPathSegment();
                String[] columns = new String[] {
                                BaseColumns._ID,
                                SampleDatabase.ANIMAL_NAME,
                                SearchManager.SUGGEST_COLUMN_SHORTCUT_ID,
                                SearchManager.SUGGEST_COLUMN_INTENT_DATA_ID
                };
                return mDatabase.getAnimal(rowId, columns);
        }

        private Cursor searchAnimals(String query) {
                query = query.toLowerCase();
                String[] columns = new String[] {BaseColumns._ID,
SampleDatabase.ANIMAL_NAME};
                return mDatabase.getAnimalMatches(query, columns);
        }

        private Cursor getAnimal(Uri uri) {
                String rowId = uri.getLastPathSegment();
                String[] columns = new String[] {SampleDatabase.ANIMAL_NAME};
                return mDatabase.getAnimal(rowId, columns);
        }

        public int delete(Uri uri, String selection, String[] selectionArgs)
{return 0;}
        public Uri insert(Uri uri, ContentValues values) {return null;}
        public int update(Uri uri, ContentValues values, String selection,
String[] selectionArgs) { return 0;     }
}
=================================
Thank you,

-- 

2. Rotate bitmap in opengl

I am trying to rotate a bitmap in OpenGL. I have searched around and
come up with this


    public void drawTexture(Texture texture, int index, float x, float
y, float angle)
    {
        int[] ids = texture.getTextureIds();

        if (ids != null)
        {
            surface.glEnable(GL10.GL_TEXTURE_2D);

            surface.glBindTexture(GL10.GL_TEXTURE_2D, ids[index]);

            // Draw using the DrawTexture extension.
            int drawWidth = texture.getDrawWidth();
            int drawHeight = texture.getDrawHeight();

            surface.glPushMatrix();

            surface.glLoadIdentity();

            surface.glRotatef(angle, 0.0f, 0.0f, 1.0f);

            ((GL11Ext) surface).glDrawTexfOES(x, screenHeight -
drawHeight - y, 0, drawWidth, drawHeight);

            surface.glPopMatrix();

            surface.glDisable(GL10.GL_TEXTURE_2D);

        }
    }

Drawing the bitmaps indicated with the "ids" works fine but no
rotation happens. I am no expert at openGL. Is is possible I need to
set some sort of mode prior to the rotation?

-- 

3. myLocationOverlay - customizing the compass position on screen?

4. Creating Sliding Drawer in new look

5. Align Custom Dialog at the bottom of the screen

6. Google analytics install referrer problem

7. You are invited to join Talk2Droid beta test