[android-developers] root permission

2010-06-12 Thread amsale zelalem
Hello all,
I have got an htc hero device and would like to install my apk on it. it 
successfully installs my apk but without the database it is using. my database 
is populated prior to running the application, so it runs ok on the emulator. 
but i couldn't load my data on the real device and the apk is displaying forse 
close error.
can anyone please help me how to load my data on the data folder of the device 
including every detailed steps?
please it is very urgent that I need to present it the coming week 
thanks



  

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] permission denied on devce

2010-06-05 Thread amsale zelalem
Hello guys, I have developed and tested my app on the emulator, and now want to 
install it on my HTC device.
the apk installs successfully, however my database is not going with it.
I have created my database using sqliteman browser b/c I have to insert a bulk 
data before the app starts.
I have four tables in my db and call each in different activities and created 
all on the sqliteman. after the data is inserted I pull back the db onto the 
data folder of the emulator.
it works perfect on the emulator but failed on the device.
when I try to pull my db on the real device, it shows access denied problem
Please can anyone help me out?
it is very urgent
thanks 



  

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Need Help--- Regarding Creating Database and Tables

2010-04-28 Thread amsale zelalem
thank you so  much for the posted solution. it is of great help for me.
I want to ask you though some more questions.
1.  I would like to populate my tables statically(before even the app is 
launched) may be reading from a file onto the db. How can I do it?
2. I would like to add texts written in languages different from english. How 
can I do this too?
Please I am really in need of these two things and quick response would be 
appreciated.
thank you in advance

--- On Mon, 4/19/10, Liviu Ungureanu smartli...@gmail.com wrote:


From: Liviu Ungureanu smartli...@gmail.com
Subject: Re: [android-developers] Need Help--- Regarding Creating Database and 
Tables
To: android-developers@googlegroups.com
Date: Monday, April 19, 2010, 12:42 PM


Hi!


 I use this method to work with database:


 // this is my DatabaseManager class



package com.liviu.app.nearbyplace.data;


import java.util.ArrayList;


import com.liviu.app.nearbyplace.util.Constants;


import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;




public class DatabaseManager {

//data
private String TAG = DatabaseManager;
private SQLiteDatabase db;
private Context context;

public DatabaseManager(Context ctx) {

Log.e(TAG, DatabaseManager Constructor);
context = ctx;

openAndCreateDatabase();
closeDatabaseManager();
}

public boolean openAndCreateDatabase(){
try{

db = context.openOrCreateDatabase(Constants.DATABASE_NAME, 
Context.MODE_PRIVATE, null);
Log.e(TAG,Database is ready!);


                        // here I create my tables: 
db.execSQL(Constants.CREATE_SAVED_ITEMS_TABLE);  
db.execSQL(Constants.CREATE_HISTORY_TABLE);

return true;
}
catch (SQLException e){
Log.e(TAG,ERROR at accesing database!);
Log.e(TAG,e.toString());
return false;
} 
catch (IllegalStateException e) {
e.printStackTrace();
Log.e(TAG, database is not closed in openAndCreateDatabase());
closeDatabaseManager();
return false;
}
}

public boolean openDatabase(){

if(db != null  db.isOpen())
db.close();
try{
db = context.openOrCreateDatabase(Constants.DATABASE_NAME,Context.MODE_PRIVATE, 
null); 
return true;
}
catch (SQLException e){
Log.e(TAG,ERROR at accesing database!);
Log.e(TAG,e.toString());
return false;
}
catch (IllegalStateException e) {
e.printStackTrace();
Log.e(TAG, database is not closed in openDatabase());
closeDatabaseManager();
return openDatabase();
}

}

public void closeDatabaseManager(){

if(db.isOpen())
db.close();
else
Log.e(TAG,Database is not open!);
}


public boolean insertToHistory(String when, String what, int count) {
ContentValues values = new ContentValues(3);

values.put(Constants.DATE_FIELD, when);
values.put(Constants.ITEM_TITLE_FIELD, what);
values.put(Constants.ITEM_RESULTS_COUNT_FIELD, count);

long affectedRows = 0;
try{
affectedRows = db.insertOrThrow(Constants.TABLE_HISTORY, null, values);
Log.e(TAG, affectedRows:  + affectedRows);
if(affectedRows != -1)
return true;
else
return false;
}
catch (SQLException e) {
Log.e(TAG, nu am inserat in baza de date  + what +  count:  + count);
e.printStackTrace();
return false;
}
}


public ArrayListHistoryItem getSuggestions() {
Log.e(TAG, getSuggestions());
HistoryItem hItem;
ArrayListHistoryItem  suggestions;
String[] sProjection = new String[]{distinct  + Constants.ITEM_TITLE_FIELD, 
Constants.ITEM_RESULTS_COUNT_FIELD};
Cursor   cSuggestions   = db.query(Constants.TABLE_HISTORY,
 sProjection, 
 null, 
 null, 
 null, 
 null,
 null); 
if(cSuggestions == null){
Log.e(TAG, cSuggestions is null);
return null;
}

int numRows = cSuggestions.getCount();
suggestions = new ArrayListHistoryItem(numRows);
cSuggestions.moveToFirst(); 

for(int i = 0; i  numRows; i++){
hItem = new HistoryItem(cSuggestions.getString(0), cSuggestions.getInt(1)); 
suggestions.add(hItem);
Log.e(TAG, Suggestion:  + cSuggestions.getString(0) +  results count:  + 
cSuggestions.getInt(1));
cSuggestions.moveToNext();
}

Log.e(TAG, suggestions count:  + suggestions.size());
return suggestions;
} 

public String[] getSuggestionsAsArray() {
Log.e(TAG, getSuggestions());
String[]  suggestions;
String[] sProjection = new String[]{ distinct  + Constants.ITEM_TITLE_FIELD, 
Constants.ITEM_RESULTS_COUNT_FIELD };
Cursor   cSuggestions   = db.query(Constants.TABLE_HISTORY,
 sProjection, 
 null, 
 null, 
 null, 
 null,
 null); 
if(cSuggestions == null){
Log.e(TAG, cSuggestions is null);
return null;
}

int numRows = cSuggestions.getCount();
suggestions = new String[numRows];
cSuggestions.moveToFirst(); 

for(int i = 0; i  numRows; i++){ 
suggestions[i] = cSuggestions.getString(0);
Log.e(TAG, Suggestion:  + cSuggestions.getString(0) +  results count:  + 
cSuggestions.getInt(1));
cSuggestions.moveToNext();
}

Log.e(TAG, suggestions count:  + suggestions.length);
return suggestions;
}


public ArrayListString getHistoryDates() {
ArrayListString datesList;
int  numRows;
String[]  datesProjection   

Re: [android-developers] Re: screen flickering in GLSurfaceView

2010-03-18 Thread amsale zelalem
thank you so much for ur precious advice. that is what we were looking for

--- On Thu, 3/18/10, Andres Colubri andres.colu...@gmail.com wrote:

From: Andres Colubri andres.colu...@gmail.com
Subject: Re: [android-developers] Re: screen flickering in GLSurfaceView
To: android-developers@googlegroups.com
Date: Thursday, March 18, 2010, 6:46 AM


 What happens in your case is the following (as far as i can tell). In
 the first onDrawFrame() call you render some elements to the initially
 black back buffer. The front buffer is also black. Now you leave
 onDrawFrame() and the back buffer gets presented while the front
 buffer becomes your new back buffer. But the new back buffer does not
 contain the elements you just rendered! So you render your new
 elements to a completely black back buffer this time so the final
 image is not a composition of the first onDrawFrame and the second
 one. As the buffers are constantly swaped they never have the same
 content as half of the elements is in one buffer and the others are in
 the other buffer.
   
Thanks for the explanation, this makes the source of the problem perfectly 
clear.

 There might be a way to disable double buffering in the GLSurfaceView
 if you use that.   
That would be nice, I wonder if it is possible to do at all... After a quick 
look at the source code of GLSurfaceView, it seems to me that the double 
buffering is hard coded into the EglHelper class.

 Otherwise you will need to use EGL directly to setup
 your OpenGL surface without double buffering. 
I'd like to avoid this, since it basically means implementing my own 
GLSurfaceView...

 On the other hand i wonder why you don't compose your complete scene in a 
 single
 onDrawFrame call.
   
Because the goal is to have an interactive drawing application controlled by 
the user input (brushes strokes, etc).

-- You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en



  

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en