[android-developers] [Help] Can i get a OAuth token from AccountManger.getToken ?

2010-08-19 Thread Vincent Tsao
if i can, What is this value for authtokentype suppose to be for Google
OAuth token using AccountManager.getAuthToken?

-- 
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] Which type of token should i get if i want to get Google contacts?

2010-08-19 Thread Vincent Tsao
hi there,

i can get a auth token from AccountManager.get(context).getAuthToken
method,  what's the value for authTokenType should be if i want to get
Google contacts?

-- 
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] [Help] How can i get related email info through Google AuthSub token?

2010-08-18 Thread Vincent Tsao
hi there, i can get user Account token from Android AccountManager API, how
can i get the related email info from this AuthSub token? i've found  no
appropriate GData API so far

Why should i do this? i need to make sure the token and email are paired to
avoid a fake token which not related to the email account

-- 
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] Re: [Help] How can i get related email info through Google AuthSub token?

2010-08-18 Thread Vincent Tsao
any help?

-- 
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] Re: Modifying components on widget from activity

2010-07-12 Thread Vincent Tsao
i almost missing this great thread, Mark  Dirk, thank you

-- 
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] sqlite3 in adb not in 2.2?

2010-06-28 Thread Vincent Tsao
On Mon, May 24, 2010 at 7:41 AM, Mark Murphy mmur...@commonsware.comwrote:

 schwiz wrote:
  So I just watched the talk at Google I/O where they showed how to use
  sqlite3 in ADB to help debug your database.  I didn't know you could
  do that way cool.  So I was doing it on my nexus which is rooted and
  it was working fine.  Then I went ahead and installed 2.2 and now when
  I type sqlite3 in the shell it says sqlite3 not found  Any ideas?

 Well, it's in the 2.2 emulator image, for what that's worth.


i found it's too bad to check data  debug from my app

i can't check my data from my nexus one anymore, that's bad!



 --
 Mark Murphy (a Commons Guy)
 http://commonsware.com | http://github.com/commonsguy
 http://commonsware.com/blog | http://twitter.com/commonsguy

 Android Consulting: http://commonsware.com/consulting

 --
 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.comandroid-developers%2bunsubscr...@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

[android-developers] Re: sqlite3 in adb not in 2.2?

2010-06-27 Thread Vincent Tsao


On May 24, 7:41 am, Mark Murphy mmur...@commonsware.com wrote:
 schwiz wrote:
  So I just watched the talk at Google I/O where they showed how to use
 sqlite3in ADB to help debug your database.  I didn't know you could
  do that way cool.  So I was doing it on my nexus which is rooted and
  it was working fine.  

 Then I went ahead and installed 2.2 and now when I typesqlite3in the shell 
 it sayssqlite3notfound  Any ideas?

 Well, it's in the 2.2 emulator image, for what that's worth.

i found it's too bad to check data  debug from my app

i can't check my data from my nexus one anymore, that's bad!


 --Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy

 Android Consulting:http://commonsware.com/consulting

 --
 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 
 athttp://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


[android-developers] [Help] how to place item in GridView

2010-05-26 Thread Vincent Tsao
i have four item in a GridView, named One, Two, Three, and Four. All these
items set into a GridView will be looked like this:

[image: 1.png]

but, i wish these items display as blow: One placed in the First row. Two,
Three and Four item placed in the Second row

[image: 2.png]


any idea how to implement this? 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=en2.png1.png

Re: [android-developers] [Help] how to place item in GridView

2010-05-26 Thread Vincent Tsao
Hi, Mark, thanks a lot.

Using RelativeLayout, or nested LinearLayouts, i need hardcode for the
display and event for each item, which i really hated, GridView provides me
smooth APIs to meet my needs, BTW, if i have 3*N items someday, my problem
is not exist any more.

so, i find this tricky way, one general speaking, use holder item to fill in
GridView, then make those holder items invisiable:

[image: 3.png]


Finnaly, that's working!

Sigh~~, a weird requirement and a really tricky solution :)

On Thu, May 27, 2010 at 12:00 AM, Mark Murphy mmur...@commonsware.comwrote:

 Vincent Tsao wrote:
  i have four item in a GridView, named One, Two, Three, and Four. All
  these items set into a GridView will be looked like this:
 
  1.png
 
  but, i wish these items display as blow: One placed in the First row.
  Two, Three and Four item placed in the Second row
 
  2.png
 
 
  any idea how to implement this? thanks

 Don't use a GridView. Use RelativeLayout, or nested LinearLayouts.

 --
 Mark Murphy (a Commons Guy)
 http://commonsware.com | http://github.com/commonsguy
 http://commonsware.com/blog | http://twitter.com/commonsguy

 Warescription: Three Android Books, Plus Updates, One Low Price!

 --
 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.comandroid-developers%2bunsubscr...@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=en3.png

[android-developers] [Help] Anybody run Chrometophone in Android 2.2 Emulator successfully?

2010-05-23 Thread Vincent Tsao
i found Chrometophone here: http://code.google.com/p/chrometophone/.

I'm trying to setup this project in Android 2.2 Emulator, but i can't setup
a Google Account in Emulator, so i can't Resister Device. anybody run this
project in emulator successfully? Any instructions?

-- 
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] Re: [Help] Activity pause timeout for HistoryRecord -- Any idea how does this happen ?

2010-05-12 Thread Vincent Tsao
well , i see what' happens, render ListView with CursorAdapter cost too
much time, i need improve the performance of Activity B, that's all

-- 
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] Re: [Help] how to draw multiple lines in Edittext?

2010-05-11 Thread Vincent Tsao
On Mon, May 10, 2010 at 9:59 PM, social hub shubem...@gmail.com wrote:

 What exactly is your problem here . getting line count 18 when u filled
 textbox with 18 lines?


not a problem but a tricky solution. y, in this solution , i fill 18  empty
lines so getLinecount will return me 18


 On Sat, May 8, 2010 at 12:53 AM, Vincent Tsao caojunvinc...@gmail.comwrote:

 @Soical Hub: thanks for your help, your suggestion inspired me a lot

 i finally find this way to get padding: *getCompoundPaddingTop()*, and it
 works fine now

 what' more, i find another tricky way to meet my requirement:

 *Step 1: fill in the EditText with 18 'empty' line rows*

 StringBuilder sb = new StringBuilder();
  for (int i = 0; i  18; i++) {
  sb.append(\n);
  }

 * this.setText(sb.toString());*


 *Step 2: draw those 18 lines

 *
 *  *  @Override

 protected void onDraw(Canvas canvas) {
 canvas.drawColor(paperColor);
 * int count = getLineCount(); // that's the tricky part, now
 count will return 18*
  Rect r = mRect;

  for (int i = 0; i  count; i++) {
  int baseline = getLineBounds(i, r);

  // Draw ruled lines
  canvas.drawLine(r.left, baseline + 1, r.right, baseline + 1,

  linePaint);

  canvas.save();
  }
  super.onDraw(canvas);
  canvas.restore();**
 *  *}

 but i don't like this tricky way personally :)


  --
 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.comandroid-developers%2bunsubscr...@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.comandroid-developers%2bunsubscr...@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

[android-developers] [Help] Activity pause timeout for HistoryRecord -- Any idea how does this happen ?

2010-05-11 Thread Vincent Tsao
i'm start a new Activity B from Activity A, and find launch Activiy B is
very slow, cost over 3000 Milliseconds, and when i click back to Activity
A, then i found this log below:

*05-11 15:19:30.201: WARN/ActivityManager(79): Activity pause timeout for
HistoryRecord{43aaedc8 com.example.android/.ActivityB}*

Activity B only contains a ListView with CursorAdapter, Any idea how does
this happen? this performance is unacceptable

-- 
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] Re: timeout for HistoryRecord

2010-05-11 Thread Vincent Tsao
hi, Anzi, any progress here?  i have the same problem

-- 
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] [Help] how to draw multiple lines in Edittext?

2010-05-07 Thread Vincent Tsao
i have a customized LinkedEditText extends from EditText, and override the
onDraw method as below:

protected void onDraw(Canvas canvas) {
canvas.drawColor(paperColor);

int count = getLineCount();
int height = this.getMeasuredHeight();
int line_height = this.getLineHeight();
int page_size = height / line_height + 1;

if (count  page_size) {
count = page_size;
}

for (int i = 1; i  count; i++) {
int posY = i * line_height;

canvas.drawLine(0, posY, getRight(), posY, linePaint);
canvas.save();

}

  super.onDraw(canvas);
  canvas.restore();
}

here is what this customized EdtiText looks like:

[image: new_note_1.png]


as you can see, the text line-height didn't match the lines which i draw.

but AK notes App did it perfect:

[image: ak_note_1.png]


any idea what' wrong did i do? 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=ennew_note_1.pngak_note_1.png

[android-developers] Re: [Help] how to draw multiple lines in Edittext?

2010-05-07 Thread Vincent Tsao
any help?



-- 
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] Re: [Help] how to draw multiple lines in Edittext?

2010-05-07 Thread Vincent Tsao
On Fri, May 7, 2010 at 9:45 PM, social hub shubem...@gmail.com wrote:

 I believe you should include the height of your title bar and status bar as
 well. If you account for one of them i guess it will look right


hi, thanks for your reply.

so getMeasuredHeight() return me the whole view height, which means
getMeasuredHeight() = statusbar + title bar + my edit text?

-- 
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] Re: [Help] how to draw multiple lines in Edittext?

2010-05-07 Thread Vincent Tsao
It remind me of considering some margin space, so i change my code as below:

protected void onDraw(Canvas canvas) {
canvas.drawColor(paperColor);

int count = getLineCount();
int height = this.getMeasuredHeight();
int line_height = this.getLineHeight();
int page_size = height / line_height + 1;

if (count  page_size) {
count = page_size;
}

   * int posY = 5; // i guess the margin-top may be 5 px :)*
for (int i = 1; i  count; i++) {
*posY +=  line_height;*

canvas.drawLine(0, posY, getRight(), posY, linePaint);
canvas.save();

}

  super.onDraw(canvas);
  canvas.restore();
}

finally it looks right, so i'm sure there is a margin space between my
EditText  and the default view , but i have no idea about how to get this
height? so i hard code it 5 px

any suggestion?

-- 
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] Re: [Help] how to draw multiple lines in Edittext?

2010-05-07 Thread Vincent Tsao
 @Soical Hub: thanks for your help, your suggestion inspired me a lot

i finally find this way to get padding: *getCompoundPaddingTop()*, and it
works fine now

what' more, i find another tricky way to meet my requirement:

*Step 1: fill in the EditText with 18 'empty' line rows*

StringBuilder sb = new StringBuilder();
 for (int i = 0; i  18; i++) {
 sb.append(\n);
 }

* this.setText(sb.toString());*


*Step 2: draw those 18 lines

*
*  *  @Override
protected void onDraw(Canvas canvas) {
canvas.drawColor(paperColor);
* int count = getLineCount(); // that's the tricky part, now count
will return 18*
 Rect r = mRect;

 for (int i = 0; i  count; i++) {
 int baseline = getLineBounds(i, r);

 // Draw ruled lines
 canvas.drawLine(r.left, baseline + 1, r.right, baseline + 1,
 linePaint);

 canvas.save();
 }
 super.onDraw(canvas);
 canvas.restore();**
*  *}

but i don't like this tricky way personally :)

-- 
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] how to handle the Dpad event in headview/footview of listview?

2010-05-06 Thread Vincent Tsao
one more question, why mFootView.setOnClickListener  not working? am i doing
sth wrong?

On Thu, May 6, 2010 at 2:13 PM, Second Dancer seconddan...@gmail.comwrote:

 That is the right way and still the smart way, unless you don't use
 listview

 On May 6, 2010 3:58 AM, Vincent Tsao caojunvinc...@gmail.com wrote:

 i have add a footview in listview with this code:
   mListView.addFooterView(mFootView);

 and also Register a callback to be invoked when this mFootView is clicked
 with code below:

 mFootView.setOnClickListener(new OnClickListener() {
 @Override
 public void onClick(View v) {
   // my code
 }
  });

 after this, when i press down dpad, there is no response, so i Register a
 callback to be invoked when a key is pressed in this mFootView. with code
 below:

   mHiddenFolders.setOnKeyListener(new OnKeyListener(){

 @Override
 public boolean onKey(View v, int keyCode, KeyEvent event) {
 // my code
Log.v(onKey, test);
 return  true;
 }

 });

 unfortunately, still nothing happened :(

 After some attempt, i found this ugly way:

 @Override
 public void onItemClick(AdapterView? parent, View view, int position,
 long id) {
 // TODO Auto-generated method stub

 if (id == -1) {
 if (position == 0) {
* // when click a header view*
 } else {
*// when click a footer view*
 }
 } else {
* // when click other normal row*
 }
 }

 finally, it works, but i'm wondering if there is a smart way to do this?


  --
 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.comandroid-developers%2bunsubscr...@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.comandroid-developers%2bunsubscr...@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

[android-developers] how to handle the Dpad event in headview/footview of listview?

2010-05-05 Thread Vincent Tsao
i have add a footview in listview with this code:
  mListView.addFooterView(mFootView);

and also Register a callback to be invoked when this mFootView is clicked
with code below:

mFootView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
  // my code
}
 });

after this, when i press down dpad, there is no response, so i Register a
callback to be invoked when a key is pressed in this mFootView. with code
below:

  mHiddenFolders.setOnKeyListener(new OnKeyListener(){

@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
// my code
   Log.v(onKey, test);
return  true;
}

});

unfortunately, still nothing happened :(

After some attempt, i found this ugly way:

@Override
public void onItemClick(AdapterView? parent, View view, int position,
long id) {
// TODO Auto-generated method stub

if (id == -1) {
if (position == 0) {
   * // when click a header view*
} else {
   *// when click a footer view*
}
} else {
   * // when click other normal row*
}
}

finally, it works, but i'm wondering if there is a smart way to do this?

-- 
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] [Help] How to get thumbnail picture from HTC Hero?

2010-05-03 Thread Vincent Tsao
i'm trying to fetch a  thumbnail with picture URI using these code below:

long id = ContentUris.parseId(selectedImageURI);
String[] projection = { MediaStore.Images.Thumbnails.DATA };
Cursor c =
Images.Thumbnails.queryMiniThumbnail(getContentResolver(),
id, Images.Thumbnails.MINI_KIND, projection);

unfortunately, it's always return me the null cursor. finally, i found HTC
hero never generate picture thumbnail under \sdcard\DCIM\.thumbnails,  but
only create a picture under this folder: \sdcard\DCIM\100MEDIA, which
means i can only get the full size picture. What's am i supposed to do?
create a thumbnail by myself?

-- 
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] Re: [Help] How to get thumbnail picture from HTC Hero?

2010-05-03 Thread Vincent Tsao
any help?

-- 
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] Re: [Help] How to get thumbnail picture from HTC Hero?

2010-05-03 Thread Vincent Tsao
On Mon, May 3, 2010 at 9:55 PM, Streets Of Boston
flyingdutc...@gmail.comwrote:

 create a thumbnail by myself?
 Yes.
 I found that thumbnails are not always generated.


hi, thanks for your reply

generate thumbnail by myself this action will cost more time comparing
with get thumbnail by using API, i think this is bad. i've no idea why HTC
hero do that. here is discussion which make me frustrate:
http://code.google.com/p/android/issues/detail?id=1480

-- 
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] [Help] How to get current UTC time?

2010-04-28 Thread Vincent Tsao
As you know, i can use System.currentTimeMillis() to fetch current local
time, but how to convert local time to UTC time?

the code below, i can get the timezone, utc_bias also can be got

Time mSavedTime = new Time();
mSavedTime.set(System.currentTimeMillis());
TimeZone mMyTimeZone = TimeZone.getTimeZone(mSavedTime.timezone);
int utc_bias = mMyTimeZone.getOffset(local_time);

my problem is i can't determine how to use this utc_bias:  added or minus to
current local time  to get UTC time?

-- 
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] ListView with multiple layouts formats in it

2010-04-28 Thread Vincent Tsao
hi, noid, this article may help you,

Separating Lists with Headers in Android 0.9: http://diigo.com/0anhm

-- 
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] Re: [Help] How to get current UTC time?

2010-04-28 Thread Vincent Tsao
On Wed, Apr 28, 2010 at 3:57 PM, String sterling.ud...@googlemail.comwrote:

 On Apr 28, 7:31 am, Vincent Tsao caojunvinc...@gmail.com wrote:

  As you know, i can use System.currentTimeMillis() to fetch current local
  time, but how to convert local time to UTC time?

 Are you sure that currentTimeMillis() gives you local time? It's
 documented as the current system time in milliseconds since January
 1, 1970 00:00:00 UTC. From that description, I'd expect it to return
 a raw millisecond count; there's no timezone offset involved. If
 anything, it's going to be UTC, but in truth, it isn't inherently in
 *any* time zone.

 It all depends on what you're wanting to do with the timestamp. We
 probably need more information to guide you here.

 String


hi String,  i have misunderstand this description return the local system
time in milliseconds in doc. and ask this stupid question, sorry for that.
thanks for your response





 --
 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.comandroid-developers%2bunsubscr...@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

Re: [android-developers] Re: In which case should i use content provider?

2010-03-16 Thread Vincent Tsao
thanks, that's helps

On Tue, Mar 16, 2010 at 12:09 PM, Makas Tzavellas makas.tzavel...@gmail.com
 wrote:

 Hi Vincent,

 Glad to help :)

 If you are using the same permission for both read and write in the
 provider tag. You could also use the permission attribute.

 For example,

 provider
 android:name=.provider.myProvider 
 android:permission=com.example.project.permission

 More info can be found here
 http://developer.android.com/guide/topics/manifest/provider-element.html

 On Tue, Mar 16, 2010 at 10:43 AM, Vincent Tsao caojunvinc...@gmail.comwrote:

 Hi Makas, that what i exactly want, thanks a lot, here is my
 understanding, all in AndroidManifest.xml:


1. permission android:name=com.example.project.permission
android:protectionLevel=signature/
2. user-permission android:name=com.example.project.permission
3. provider
android:name=.provider.myProvider 
 android:readPermission=com.example.project.permission
android:writePermission=com.example.project.permission


 On Tue, Mar 16, 2010 at 1:46 AM, Makas Tzavellas 
 makas.tzavel...@gmail.com wrote:

 Hi Vincent,

 Do you mean you want to prevent other applications to access to your
 ContentProvider except for your own applications? Can't say that I
 understand your question 100%. So I apologize if I am not answering
 your question correctly.

 You can probably declare your own permission in the
 AndroidManifest.xml and set the protectionLevel attribute to
 signature. And set the read and write permission in your provider
 tag to use the permission that you have declared. You app that needs
 access to the ContentProvider however will need to declare that is
 uses that permission as well in the AndroidManifest.xml.

 You can find out more info here
 http://developer.android.com/guide/topics/security/security.html.

 Makas

 On Mar 15, 10:25 pm, Vincent Tsao caojunvinc...@gmail.com wrote:
  hi there, how should i use content provider without share app data
 between
  other app?

 --
 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.comandroid-developers%2bunsubscr...@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.comandroid-developers%2bunsubscr...@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.comandroid-developers%2bunsubscr...@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

[android-developers] In which case should i use content provider?

2010-03-15 Thread Vincent Tsao
hi there, how should i use content provider without share app data between
other app?

-- 
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] Re: In which case should i use content provider?

2010-03-15 Thread Vincent Tsao
Hi Makas, that what i exactly want, thanks a lot, here is my understanding,
all in AndroidManifest.xml:


   1. permission android:name=com.example.project.permission
   android:protectionLevel=signature/
   2. user-permission android:name=com.example.project.permission
   3. provider
   android:name=.provider.myProvider
android:readPermission=com.example.project.permission
   android:writePermission=com.example.project.permission


On Tue, Mar 16, 2010 at 1:46 AM, Makas Tzavellas
makas.tzavel...@gmail.comwrote:

 Hi Vincent,

 Do you mean you want to prevent other applications to access to your
 ContentProvider except for your own applications? Can't say that I
 understand your question 100%. So I apologize if I am not answering
 your question correctly.

 You can probably declare your own permission in the
 AndroidManifest.xml and set the protectionLevel attribute to
 signature. And set the read and write permission in your provider
 tag to use the permission that you have declared. You app that needs
 access to the ContentProvider however will need to declare that is
 uses that permission as well in the AndroidManifest.xml.

 You can find out more info here
 http://developer.android.com/guide/topics/security/security.html.

 Makas

 On Mar 15, 10:25 pm, Vincent Tsao caojunvinc...@gmail.com wrote:
  hi there, how should i use content provider without share app data
 between
  other app?

 --
 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.comandroid-developers%2bunsubscr...@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

[android-developers] How to display list of images in ListView in android?

2009-05-21 Thread Vincent Tsao

i would be retrieving values from sqlite database and have to display
it in a list view...So how should i pass the images out from the
database into the list view(in fact, i only save the image uri in
db).. I am able to save and retrieve images individually and display
it on the screen.But how do i pass a bitmap and display it in a list
view. can you help me with some sample codes please...
--~--~-~--~~~---~--~~
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] Re: How to display list of images in ListView in android?

2009-05-21 Thread Vincent Tsao
nevermind, i have found the solution, here is a good example to bind the
SimpleCursorAdapter to a ListView :
 http://ambiguiti.es/2009/04/making-custom-rows-in-android-listviews/

On Thu, May 21, 2009 at 5:01 PM, Vincent Tsao caojunvinc...@gmail.comwrote:

 i'd like to create a new adapter which extends SimpleCursorAdapter, any
 sample code to help?


 On Thu, May 21, 2009 at 4:57 PM, Vincent Tsao caojunvinc...@gmail.comwrote:


 i would be retrieving values from sqlite database and have to display
 it in a list view...So how should i pass the images out from the
 database into the list view(in fact, i only save the image uri in
 db).. I am able to save and retrieve images individually and display
 it on the screen.But how do i pass a bitmap and display it in a list
 view. can you help me with some sample codes please...
 



--~--~-~--~~~---~--~~
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] Re: How to create a simple list of names, with personal image for each row

2009-05-21 Thread Vincent Tsao
hi, this sample tutorial may help you
http://stackoverflow.com/questions/459729/how-to-display-list-of-images-in-listview-in-android/892643#892643

On Thu, May 21, 2009 at 11:36 PM, Morelli Giuseppe
peppe.more...@gmail.comwrote:


 Hi guys,
 I'm trying to create a simple list for my app extending the
 ListActivity Class.
 All names the names I want to display are stored in an ArrayList, and
 I use ArrayAdapter to link each element of the array with a row in the
 list view. This is the code to instatiate the ArrayAdapter:

 ArrayList listItems = new ArrayListString();
 ArrayAdapter aa = new ArrayAdapterString(this, R.layout.singlerow,
 listItems);

 where R.layout.singlerow is:

 ?xml version=1.0 encoding=utf-8?

 TextView android:id=@+id/textInfo
xmlns:android=http://schemas.android.com/apk/res/android;
android:layout_width=fill_parent
 android:layout_height=wrap_content
 /TextView

 and my main.xml is:

 LinearLayout xmlns:android=http://schemas.android.com/apk/res/
 android
android:id=@+id/mainLinearLayout
 android:layout_width=fill_parent
android:layout_height=wrap_content android:padding=10px
ListView android:id=@android:id/list
 android:orientation=horizontal
android:layout_width=fill_parent
 android:layout_height=fill_parent
/ListView

 /LinearLayout

 Now my problem is: how can I add an image for each item in the list?
 I've tried a lot of solution, but all are not working. Please help me,
 I'm becoming craz!

 Thank you guys.

 


--~--~-~--~~~---~--~~
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] How to make this prompt menu after capture picture?

2009-05-19 Thread Vincent Tsao

hi,  there is native app in G1 named Camera , after i take a photo,
there is a prompt menu pop-up. Would somebody tell me how to implement
this prompt ?

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---