[android-developers] Android 10/11 : surfaceFlinger / RenderEngine evolutions: need help

2023-04-11 Thread Vincent Arvis
Hello
I want to port an image enhancement after the composition is done by 
Surface Flinger, and before the final HWC rendering.
Up to Android 10, the renderEngine class provided fluch() and close() 
functions.
So we called our full screen image enhancement , then we asked the 
renderEngine to finalize thanks to flush and close.
These functions have disappeared from Android 11 because deprecated.

Version used 
: 
https://cs.android.com/android/platform/superproject/+/android-11.0.0_r4:frameworks/native/services/surfaceflinger/

What I don't understand is how can I read what the RenderEngine does (even 
in RenderEngine.h/cpp)

Thanks a lot to share some ideas ??
Best
Vincent

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/40bf8b37-1da3-4a36-881b-208817b8a762n%40googlegroups.com.


[android-developers] Android admob test ad unit returns no fill error

2018-02-26 Thread Vincent D
Hello,

Rewarded video test unit (ca-app-pub-3940256099942544/5224354917) always 
returns noFill for package com.edupad.messenger

Step to reproduce: 
 1. Download example project 
https://github.com/googleads/googleads-mobile-android-examples/releases/download/5.1/Java_RewardedVideoExample_AdMob.zip
 2. Rename package to com.edupad.messenger
 3. Build and start the app

If I rename the package to com.edupad.messenger.beta it work properly. 

Regards,
Vincent

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/eec01cc4-e91b-49e9-81cf-377064f39f8b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Periodic Sync not working.

2016-04-16 Thread Vincent Wassenaar
Well after trying to figure out the same problem I found a few things.
First of all the time is in seconds so now you sync every 3600 seconds. Try 
30 or so.

Secondly make sure the AUTHORITY is equal to the one provided in the 
authenticator.xml AND the syncadapter.xml

Hope this works for you :)

On Wednesday, March 9, 2016 at 9:09:29 AM UTC+1, Marc Tigges wrote:
>
> Im using SyncAdapter for some server client synchronization. In the official 
> developer guide 
> 
>  it 
> is mentioned that there are different methods to trigger a sync.
>
> *1 Run the Sync Adapter When Server Data Changes*
>
> You simply call:
>
> ContentResolver.requestSync(ACCOUNT, AUTHORITY, null);
>
> When server data changes (on GCM for example).
>
> *2 Run the Sync Adapter When Content Provider Data Changes*
>
> Simply use a ContentObserver
>
> public class TableObserver extends ContentObserver {
> @Override
> public void onChange(boolean selfChange) {
> onChange(selfChange, null);
> }
>
> @Override
> public void onChange(boolean selfChange, Uri changeUri) {
> ContentResolver.requestSync(ACCOUNT, AUTHORITY, null);
> }
> }
>
> *3 Run the Sync Adapter After a Network Message*
>
> Do the following:
>
> ContentResolver.setSyncAutomatically(ACCOUNT, AUTHORITY, true)
>
> Now everytime when there is an open TCP/IP connection the SyncAdapter is 
> triggered to perform the sync.
>
> *4 Run the Sync Adapter Periodically*
>
> This is for me the important and interesting part. For that you simply 
> have to do this (at least this is written in the developers guide):
>
> public static final long SECONDS_PER_MINUTE = 60L;
> public static final long SYNC_INTERVAL_IN_MINUTES = 60L;
> public static final long SYNC_INTERVAL = SYNC_INTERVAL_IN_MINUTES * 
> SECONDS_PER_MINUTE;
> 
> ContentResolver.addPeriodicSync(
> ACCOUNT,
> AUTHORITY,
> Bundle.EMPTY,
> SYNC_INTERVAL);
>
> *Now to the problem*
>
> Solution 1, 2 and 3 are working perfectly as they should. The periodical 
> sync does not. If i just do what is descriped under point 4 the 
> synchronization is never triggered (yes i did enable the auomatic 
> synchronisation in the system settings of my android device). 
>
> If i do the following:
>
> ContentResolver.setIsSyncable(account, ContentProviderMeasure.AUTHORITY, 1
> );
> ContentResolver.setSyncAutomatically(account, ContentProviderMeasure.
> AUTHORITY, true);
> ContentResolver.addPeriodicSync(account, ContentProviderMeasure.AUTHORITY, 
> new Bundle(), 3600);
>
>
> The SyncAdapter sync refresh is called every minute (it should be every 
> hour / 3600 seconds = 1 hour). If i do the following:
>
> ContentResolver.setIsSyncable(account, ContentProviderMeasure.AUTHORITY, 1
> );
> ContentResolver.addPeriodicSync(account, ContentProviderMeasure.AUTHORITY, 
> new Bundle(), 3600);
>
> The sync is only triggered once at creation time and after that never 
> again. Yes, as i mentioned already, the automatic sync in the android 
> devices settings is enabled.
> Triggering the sync manually for my app in the android device settings 
> accountmanager is working fine. 
>
> *So why does the periodic sync does not work?*
>
> I tested on Nexus 4 with Android 6.0, On Galaxy Ace with Android 4.4 and 
> on Galaxy S3 Mini with Android 4.1. All devices are not syncing 
> periodically.
> I also posted my question on Stackoverflow: 
> http://stackoverflow.com/questions/35879056/sync-not-triggered-as-mentioned-in-developer-guide
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/82782a91-0619-40b5-956d-7cb56b5c76fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] app hanging

2016-03-06 Thread Alfred Vincent
I recently made an app using Android studio and it's getting hang when I 
installed it in my phone which is running in Android marshmallow. Any solutions 
please ?

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/cffcc59f-b878-430e-9f93-01e05992f21d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Issue with ContentProvider streaming data to other apps

2014-07-21 Thread Vincent
Hello,

In my app the user can select files and open them in the appropriate app (using 
an ACTION_VIEW intent). I need to do some work on the data before giving it to 
the other app. So I'm using a streaming solution : I've implemented a 
ContentProvider that implements openTypedAssetFile and writeDataToPipe (this 
method fills the output ParcelFileDescriptor created by openPipeHelper).

This works : I can open .pdf files, .txt files etc. The streaming seems 
correct. I can open images usings 3-party apps. However when I open an image 
using the Gallery, it doesn't work (Gallery shows a black screen), and I get 
the following exception :

fail to open myfile.jpg
UriImage(21890): java.io.FileNotFoundException: Not a whole file
I had a look at the Gallery source (here) and I could see that the exception is 
thrown here :

try {
if (MIME_TYPE_JPEG.equalsIgnoreCase(mContentType)) {
InputStream is = mApplication.getContentResolver()
.openInputStream(mUri);
mRotation = Exif.getOrientation(is);
Utils.closeSilently(is);
}
**mFileDescriptor = mApplication.getContentResolver()
.openFileDescriptor(mUri, r);**
if (jc.isCancelled()) return STATE_INIT;
return STATE_DOWNLOADED;
} catch (FileNotFoundException e) {
Log.w(TAG, fail to open:  + mUri, e);
return STATE_ERROR;
}
However, once in the Gallery app, if I select Set as wallpaper, then I can 
see my image, it is then well streamed. So the problem appears when Gallery 
opens.

After a deeper look (in the ContentResolver code etc.) I couldn't understand 
why it behaves this way. It seems that Gallery does not support streaming 
files. Is that right ? Do you have any idea ? I really lost with that right now.

Thanks

Vincent

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Open Groupon app from a caller app.

2012-08-02 Thread Vincent Senese
I have written an app that opens up a Groupon URL via the web-browser.  is 
there anyway I could OPEN a groupon App if it is installed on the andoid 
os, and lanch the app to show the deal page.  

I do not know anyway to do this, or if it's possible but if someone can 
confirm this is not possible, or if it is possible point me in the correct 
location, I'd appreciate it.

-- 
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 a toast after 10 seconds from starting Asynctask

2012-08-02 Thread Vincent Senese
I think you can do this.

(CountDownTimer) cdt = new CountDownTimer(0, 1000) {

 public void onTick(long millisUntilFinished) {
   //  mTextField.setText(seconds remaining:  + millisUntilFinished / 
1000);
 }

 public void onFinish() {
 //mTextField.setText(done!);
 }
  }.start();

// at the end of your thread call 
cdt.stop(); //

On Tuesday, July 31, 2012 7:46:49 AM UTC-5, Narendra Singh Rathore wrote:

 Hi all, please suggest me how to execute something after 10 seconds from 
 the start of AsyncTask.
 I have used AsyncTask for different purpose. But, now I want to update my 
 UI after 10 seconds.
 Or to show a toast after specific time.

 I actually want to perform some other task after 10 seconds, while the 
 original task is running 


 please let me know how to do this.?

 Thank you all.
 NSR


-- 
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] Connection over data network

2012-05-21 Thread Vincent
Hi,

I'm having some problems connecting to the data network (3G
connection). I added the internet permission and can access it when
using a WIFI connection. When using the data connection of the phone
network it somehow seems that I can access the URL's I'm calling. Any
ideas, do I need to add other permissions to the manifest ?

For your information, I'm using the DefaultHttpClient in combination
with an HttpPost to access my server (JSON request).

Any help/suggestion is welcome.

Greetings,

Vincent

-- 
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] Volume limit

2012-05-15 Thread Vincent
Hello everyone, I wonder how can I increase the limit of the volume of
the device?It's an app like anaudiphone, so I need to increase the
volume of the device more its limit.

-- 
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] about ZoomButtons in android 4.0

2012-04-10 Thread Vincent Zhao
I have a problem that the method :
 getZoomButtonsController in android.webkit.webview is not defined in
android 4.0. how can I get the instance of ZoomButtonsController in
android 4.0? thanks a lot

-- 
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 assign color resources to preferences in Preference Activity?

2012-01-09 Thread Vincent
Hi,

I want to store some preferences related to colors and these preferences 
will be used by some activities.

What I need are background color and foreground color preferences, in the 
preferences.xml file:

PreferenceScreen
PreferenceCategory

Preference
android:key=foreground_color
?how ot set value here? /

Preference
android:key=background_color
?how ot set value here? /

/PreferenceCategory
/PreferenceScreen



And in the preference activity, I want to change these preferences (I know 
how to get input from users, so just list the code for changing 
preferences):

addPreferencesFromResource(R.xml.preferences);

// get preferences and editor
preferences = PreferenceManager.getDefaultSharedPreferences(this);
editor = preferences.edit();

Preference mBackcolor = (Preference) 
findPreference(background_color);
Preference mForecolor = (Preference) 
findPreference(foreground_color);
editor.// ?? how to set color here?


Finally, I need get these color preferences in activities, it would be 
something like:

SharedPreferences preferences = 
PreferenceManager.getDefaultSharedPreferences(this);
int COLOR_BACKGROUND = preferences.get// ? how to get color from 
SharedPreferences?
int COLOR_FOREGROUND = preferences.get// ?



I'm new to Preference Activity, I can now use it to change Strings.
I want to know if it is possible to change color preferences, and if yes, 
how?




-- 
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 assign color resources to preferences in Preference Activity?

2012-01-09 Thread Vincent
Great, figured it out. thanks a lot

-- 
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 Sliding Drawer push a existing layout when showing?

2011-12-14 Thread Vincent
Hi,

I have a relative layout and a sliding drawer in a frame layout, it works 
fine, I can pull out the drawer and it shows on the top of the relative 
layout.

However, now I want to make the sliding drawer push the relative layout 
when showing.

I've searched on google and the android dev ref, only got a not well 
answered thread : 
http://stackoverflow.com/questions/8209740/how-to-make-slidingdrawer-push-existing-layouts-when-showing

Below is my Layout xml file, could you give me any hint?

Android API Level: 13 Honeycomb
--

?xml version=1.0 encoding=utf-8?
FrameLayout xmlns:android=http://schemas.android.com/apk/res/android;
android:id=@+id/frameLayout_landscape
android:layout_width=wrap_content
android:layout_height=match_parent 

RelativeLayout
android:id=@+id/screen_landscape
android:layout_width=match_parent
android:layout_height=match_parent
android:orientation=vertical 

RelativeLayout
android:id=@+id/layout_landscape
android:layout_width=match_parent
android:layout_height=match_parent
android:layout_alignParentLeft=true
android:layout_alignParentTop=true
android:orientation=vertical 

ImageView
android:id=@+id/imageView_screen_landscape
android:layout_width=match_parent
android:layout_height=match_parent
android:layout_alignParentTop=true /

Button
android:id=@+id/button_left_landscape
android:layout_width=420px
android:layout_height=52px
android:layout_alignParentBottom=true
android:layout_alignParentLeft=true
android:layout_marginBottom=15px
android:layout_marginLeft=50px
android:background=@android:color/transparent /

Button
android:id=@+id/button_right_landscape
android:layout_width=400px
android:layout_height=52px
android:layout_alignParentBottom=true
android:layout_alignParentRight=true
android:layout_marginBottom=15px
android:layout_marginRight=110px
android:background=@android:color/transparent /

Button
android:id=@+id/button_up_landscape
android:layout_width=60px
android:layout_height=60px
android:layout_alignParentRight=true
android:layout_marginRight=30px
android:layout_marginTop=150px
android:background=@android:color/transparent /

Button
android:id=@+id/button_down_landscape
android:layout_width=60px
android:layout_height=60px
android:layout_alignParentRight=true
android:layout_marginRight=30px
android:layout_marginTop=475px
android:background=@android:color/transparent /
/RelativeLayout
/RelativeLayout

SlidingDrawer
android:id=@+id/slidingDrawer_landscape
android:layout_width=wrap_content
android:layout_height=wrap_content
android:content=@+id/content_landscape
android:handle=@+id/handle_landscape
android:orientation=horizontal
android:topOffset=800px

Button
android:id=@+id/handle_landscape
android:layout_width=100px
android:layout_height=270px
android:background=@android:color/transparent
android:text=/

LinearLayout
android:id=@+id/content_landscape
android:layout_width=match_parent
android:layout_height=match_parent
android:orientation=horizontal 

TableLayout
android:id=@+id/tableLayout_landscape
android:layout_width=wrap_content
android:layout_height=wrap_content
android:orientation=vertical
android:layout_marginTop=200px 

TableRow
android:id=@+id/tableRow1_landscape
android:layout_width=wrap_content
android:layout_height=wrap_content 

Button
android:id=@+id/button_numpad_1_landscape
android:layout_width=70px
android:layout_height=70px
android:layout_column=6
android:text=1
android:textColor=@color/red
android:textSize=35px
android:textStyle=bold /

Button
android:id=@+id/button_numpad_2_landscape
android:layout_width=70px
android:layout_height=70px

Re: [android-developers] How to make Sliding Drawer push a existing layout when showing?

2011-12-14 Thread Vincent
Thanks for your reply.

Is there any other way to do such things?

-- 
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 make Sliding Drawer push a existing layout when showing?

2011-12-14 Thread Vincent
Apologise for ambiguous question.

You said there's no way do to that with SlidingDrawer, I am wondering if 
I can get the animation with other widget/layout/view.

What I want are: 
   when I slide a numpad from the right side, the current match_parent 
layout becomes smaller. 
   when I push the numpad back, the layout becomes match_parent again.


-- 
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 make Sliding Drawer push a existing layout when showing?

2011-12-14 Thread Vincent
I figured out how to use OnDrawerOpenListener and OnDrawerCloseListener to 
implement the animation.
 
   SlidingDrawer drawer = (SlidingDrawer) 
findViewById(R.id.slidingDrawer1);
drawer.setOnDrawerOpenListener(new OnDrawerOpenListener() {
public void onDrawerOpened() {
ImageView image = (ImageView) findViewById(R.id.imageView1);
LinearLayout.LayoutParams layoutParams = new 
LinearLayout.LayoutParams(500, 500);
image.setLayoutParams(layoutParams);
}
});

drawer.setOnDrawerCloseListener(new OnDrawerCloseListener() {
public void onDrawerClosed() {
ImageView image = (ImageView) findViewById(R.id.imageView1);
LinearLayout.LayoutParams layoutParams = new 
LinearLayout.LayoutParams(700, 700);
image.setLayoutParams(layoutParams);
}
});


However, I want the image changes its size in a gradient way, and its size 
depends on the position of the drawer's handler button.

-- 
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 make Sliding Drawer push a existing layout when showing?

2011-12-14 Thread Vincent
Another thing is how to change a button's attributes at run time.

say, for example, I have four buttons in a relative layout (as the code 
showed in my first post).
After the slidingdrawer opened, I am able to change the relative layout in 
this way:

SlidingDrawer drawer = (SlidingDrawer) 
findViewById(R.id.slidingDrawer_landscape);
drawer.setOnDrawerOpenListener(new OnDrawerOpenListener() {
public void onDrawerOpened() {
RelativeLayout layout = (RelativeLayout) 
findViewById(R.id.screen_landscape);
layout.setLayoutParams(new FrameLayout.LayoutParams
 (900, LayoutParams.MATCH_PARENT));
}
}

But how can I change the attributes of the buttons (width, height and 
margins)?

-- 
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] Can Android do waitForResponse?

2011-12-07 Thread Vincent
Thanks a lot for your reply.

I am also thinking about doing this in a asynchronous way.

However, I'm quite new to Android (about two weeks) and the only Bluetooth 
sample I've seen is the official BluetoothChat application.
So if possible could you give me a little bit more detailed guide (directly 
or links)?

I want to send a command to a device, then receive data from it, then send 
another command... 
but the only way I can think is the BluetoothChat way :(

-- 
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] Can Android do waitForResponse?

2011-12-07 Thread Vincent
Thank you. 

I created a global variable int N and a boolean FLAG 

and use a method to initiate

void function() {
N = 0;
FLAG_COMMAND = true;
mService.write(command((byte) N));
}



private final Handler mHandler = new Handler()
 {
 @Override
 public void handleMessage(Message msg) { 
 switch (msg.what) { 
case MESSAGE_READ:
byte[]readBuf = (byte[]) msg.obj;

Packet rPacket = new Packet(readBuf);

if (FLAG_COMMAND  N = 10) {
if (rPacket.isValid()) {
doSomething(rPacket);
N++;
} else {
N--;
}
mService.write(command((byte) N));
} else if (N = 10) {
FLAG_COMMAND = false;
N = 0;
}
break;
  }
 }
}


Now it works, but the code is dirty and inefficient, I want to know how to 
do it in a *normal* way, but not Trying to shoehorn the synchronous model 
into the asynchronous model.

-- 
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] Can Android do waitForResponse?

2011-12-07 Thread Vincent
Yes, you are right, it is not inefficient, my fault. 

The activity has a button, after clicked, it will *call* function(). 

However, the code I posted last time is wrong (see the N-- part), I've 
changed the code a little bit:


case MESSAGE_READ:
byte[]readBuf = (byte[]) msg.obj;


Packet rPacket = new Packet(readBuf);

if (FLAG_COMMAND   N = 10) {
if (rPacket.isValid()) {
dosomething(rPacket);
N++;
} 
mSerinusService.write(command((byte) N));
} else if (FLAG_COMMAND  N = 10) {
FLAG_COMMAND = false;
N = 0;
}
break;

When the activity receives some data, it will check if FLAG_COMMAND is true 
and if N is less than 10 (which means the task hasn't been done).
  If yes, then check if the data received is valid
 if yes, do something with the data, and N++, then write a command(N) 
to the outputStream.

 if no, write command(N) (N hasn't been changed in this case) to the 
outputStream again.

And if N has reached 10, set FLAG_COMMAND to false and reset N.



But it doesn't work...I think there is some logic mistake in my code. 







-- 
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] Can Android do waitForResponse?

2011-12-07 Thread Vincent
FLAG_COMMAND, thank you for pointing out that.

-- 
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] Can Android do waitForResponse?

2011-12-07 Thread Vincent
figured it out, a small mistake in the isValid() method.

I learned how you write asynchronous code from you, thanks a lot. And 
please forgive my foolishness :)

-- 
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] Problem with handler

2011-12-06 Thread Vincent
Hi,

I am currently developing a project which needs to write/read data via
bluetooth.
I met a werid problem when I try to use a handler to deal with the
information back from the service I created.



When I put a breakpoint after  bytes = mmInStream.read(buffer);
 ( in ConnectedThread.run() )
I can see the content in the buffer is:

[2, 0, 8, 3, -15, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 12, 30, 99, 0, 99, 127,
99, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
119, 30, 12, 103, 0, 119, 70, 103, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 51, 12, 111, 0, 127, 22, 111,
51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
107, 51, 12, 123, 0, 107, 30, 123, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 63, 12, 115, 0, 99, 22, 115, 51,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 51,
12, 99, 0, 99, 70, 99, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 99, 51, 30, 99, 0, 99, 127, 99, 63, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -23, 4, many
0s...]

and the bytes = 248.
These are what I expected.

However, in the hanlder, the content of readBuf becomes:
[99, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 99, 51, 30, 99, 0, 99, 127, 99, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -23, 4, 0, 0, 0, 0, 0, 0, 107, 51,
12, 123, 0, 107, 30, 123, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 99, 63, 12, 115, 0, 99, 22, 115, 51, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 51, 12, 99,
0, 99, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, ...many 0s...]



The werid thing is, if the bytes = mmInStream.read(buffer); reads
[2, 0, 8, 3, 31, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 4, ...many 0s...],
(bytes = 38 in this case)
then the handler can get the correct content.


I cannot figure out why, I think it is a handler mistake, any hint?



API Level: 13

The source code is based on the BluetoothChat sample, if needed, I can
provide more detailed code.

Service
private class ConnectedThread extends Thread {
private final BluetoothSocket mmSocket;
private final InputStream mmInStream;
private final OutputStream mmOutStream;


public ConnectedThread(BluetoothSocket socket) {
Log.d(TAG, create ConnectedThread);
mmSocket = socket;
InputStream tmpIn = null;
OutputStream tmpOut = null;

// Get the BluetoothSocket input and output streams
try {
tmpIn = socket.getInputStream();
tmpOut = socket.getOutputStream();
} catch (IOException e) {
Log.e(TAG, temp sockets not created, e);
}

mmInStream = tmpIn;
mmOutStream = tmpOut;
}

public void run() {
Log.i(TAG, BEGIN mConnectedThread);
byte[] buffer = new byte[1024];
int bytes;

// Keep listening to the InputStream while connected
while (true) {
try {

// Read from the InputStream
bytes = mmInStream.read(buffer);

// Send the obtained bytes to the UI 
Activity

mHandler.obtainMessage(ControlActivity.MESSAGE_READ, bytes, -1,
buffer).sendToTarget();
} catch (IOException e) {
Log.e(TAG, disconnected, e);
connectionLost();
break;
}
}
}
 ...
  }


--handler in Activity
class--
private final Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
...
case MESSAGE_READ:
byte[] readBuf = (byte[]) msg.obj;
...
}
}
}

-- 
You received this message because you are 

[android-developers] Re: How to draw pixels?

2011-12-06 Thread Vincent
I've read through the references related to graphics, and found that there 
are methods like Bitmap.setPixel() and Bitmap.setPixels(). Now the probelm 
is solved, thanks for your hints.

-- 
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] Can Android do waitForResponse?

2011-12-06 Thread Vincent
Hi,

I am developing an application to communicate with a device via bluetooth.
Same as the BluetoothChat sample, my application makes a service object, 
and call service.connect() to get a connectedThread for data transmission.

and I have a command method, which takes an integer as its parameter.

the problem is, sometimes, that device returns invalid data.
So when I want to execute the command with ten different parameter, I need 
to do something like :

for (i = 0; i  10; i++) {
myService.write(command(i));  
packet = *waitForResponse*(myService);

if (packet is valid) {
do something;
} else {
i--;
}   
}


My program is using handler to deal messages, e.g. when the connectedThread 
read some data, it will 

mHandler.obtainMessage(ControlActivity.MESSAGE_READ, -1, -1, data)
 .sendToTarget(); 

And there is a handler in my Activity class to deal with these messages.

How can I do something like *waitForResponse* on Android? 
or Is there any other way to meet my requirement?



API Level: 13

-- 
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 create a bitmap from binary data?

2011-12-05 Thread Vincent
Hi,

I want to create images from binary data.

e.g.
If the binary data is:

0110 1110 0011 1010
1000 0001 1011  1100
0110 1101   
0100 0011 1001 0011


which is store in 4*4 bytes
{
6 14  3  10
8  1  11 12
6 13 15  0
4  3   9   3
}

I want to create a image(might be bitmap) from the binary data,

if 1, draw a black pixel, if 0, draw a white pixel
so the image would be
 .. ...   ... .
.  .. 
 .. .. .
 ....  .  ..

And I will receive new data and refresh the image frequently.

Could you give me some hints/suggestions?




Android 3.2 (API Level 13)

-- 
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 bitmap from binary data?

2011-12-05 Thread Vincent
Thanks a lot

On Dec 6, 1:51 am, Streets Of Boston flyingdutc...@gmail.com wrote:
 http://developer.android.com/reference/android/graphics/BitmapFactory...

-- 
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 draw pixels?

2011-12-04 Thread Vincent
Yes, that is what I want. Just don't know how to feed it the binary
data. I am quite new to android, could you give me some detailed
hints?

On Dec 4, 6:19 pm, Doug beafd...@gmail.com wrote:
 Sounds like you just need to create your own subclass of View, feed it
 the binary data to draw as that data becomes available, and put your
 logic below into the onDraw method using the drawing primitive of the
 Canvas object it receives.

 Doug

 On Dec 3, 6:30 pm, Vincent renws1...@gmail.com wrote:







  Thanks for replying, I think I didn't describe my needs clearly.
  What I want are:
  1. Use 30 bytes to represent one line
  2. One byte has 8 bits, each bit to represent one pixel.
  3. So one line has 240 (30x8) pixels.
  4. If a bit's value is 0, set a pixel to black
  5. If 1, set a pixel to white
  6. I have 120 lines to draw.
  7. I need to update each line very often.

  So, not if one bit is 0, then draw a black line.

  And for expanding the encoding, could you give any hint?

  Thank you.

  On Dec 4, 12:28 pm, James Black planiturth...@gmail.com wrote:

   You will need to expand the encoding you have and then it would seem the
   best approach is to have a white background, then just draw a line 
   (http://stackoverflow.com/questions/3616676/how-to-draw-a-line-in-android)
   for the black lines, so, you would need to find the start of the current
   line segment, see how many pixels in that segment, then draw the line, 
   then
   skip over the white ones (that would be like drawing a white line) and 
   draw
   the next black line segment.

   On Sat, Dec 3, 2011 at 7:34 PM, Vincent renws1...@gmail.com wrote:
Hi,

I want to draw an image from bytes. E.g. I have a byte 0010,  a
black pixel for a 0, a white pixel for a 1, then I need draw an 8
pixels line black white white white white black white black white on
the screen.

I have about 3000 bytes (30 bytes per line)to draw an image, and I
need to update the image frequently.

Could you give any suggestion? Is Bitmap.createBitmap from colors
array applicable?

Android 3.2

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

   --
   I know that you believe you understand what you think I said, but I'm not
   sure you realize that what you heard is not what I meant.
   - Robert McCloskey

-- 
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 draw pixels?

2011-12-03 Thread Vincent
Hi,

I want to draw an image from bytes. E.g. I have a byte 0010,  a
black pixel for a 0, a white pixel for a 1, then I need draw an 8
pixels line black white white white white black white black white on
the screen.

I have about 3000 bytes (30 bytes per line)to draw an image, and I
need to update the image frequently.

Could you give any suggestion? Is Bitmap.createBitmap from colors
array applicable?



Android 3.2

-- 
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 draw pixels?

2011-12-03 Thread Vincent

Thanks for replying, I think I didn't describe my needs clearly.
What I want are:
1. Use 30 bytes to represent one line
2. One byte has 8 bits, each bit to represent one pixel.
3. So one line has 240 (30x8) pixels.
4. If a bit's value is 0, set a pixel to black
5. If 1, set a pixel to white
6. I have 120 lines to draw.
7. I need to update each line very often.

So, not if one bit is 0, then draw a black line.

And for expanding the encoding, could you give any hint?


Thank you.



On Dec 4, 12:28 pm, James Black planiturth...@gmail.com wrote:
 You will need to expand the encoding you have and then it would seem the
 best approach is to have a white background, then just draw a line 
 (http://stackoverflow.com/questions/3616676/how-to-draw-a-line-in-android)
 for the black lines, so, you would need to find the start of the current
 line segment, see how many pixels in that segment, then draw the line, then
 skip over the white ones (that would be like drawing a white line) and draw
 the next black line segment.









 On Sat, Dec 3, 2011 at 7:34 PM, Vincent renws1...@gmail.com wrote:
  Hi,

  I want to draw an image from bytes. E.g. I have a byte 0010,  a
  black pixel for a 0, a white pixel for a 1, then I need draw an 8
  pixels line black white white white white black white black white on
  the screen.

  I have about 3000 bytes (30 bytes per line)to draw an image, and I
  need to update the image frequently.

  Could you give any suggestion? Is Bitmap.createBitmap from colors
  array applicable?

  Android 3.2

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

 --
 I know that you believe you understand what you think I said, but I'm not
 sure you realize that what you heard is not what I meant.
 - Robert McCloskey

-- 
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] Layout problem related to RelativeView and ListView

2011-12-01 Thread Vincent
Hi,

I'm trying to make a layout that contains a List and a button.
To make the button on the bottom, I'm using

 android:layout_alignParentBottom=true
 android:gravity=center|bottom

in a RelativeView


It works fine when the list is short, however, once the length of the
list beyond the screen's length, the list will be hided by the button
(as the link pic shows).


What I want are:
1. Keep the button on bottom
2. Keep the list above the button
3. Use relative position to keep the program's flexibility

Could you give some suggestions?


API Level = 13
Hardware: ASUS Eee PAD Transformer

http://tinypic.com/r/10qcf1d/5

-- 
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 remove the logcat's prompt box of ADT 14

2011-11-14 Thread Vincent
I guess you already found it, in case you didn't:
Window - Preferences - Android - Logcat - Uncheck the box
´Display logcat view when there are messages from an application in
the workspace'.


On Oct 21, 2:25 am, Carl yyy...@gmail.com wrote:
 Hi,
  I updated to ADT 14 and SDK about android 4.0, but there is a prompt
 box of logcat, but i don't like it, is there anyway to remove it or
 not display it? I found eclipse---preference--logcat, but I could not
 find anyplace that can hidden this?

 thanks very much

-- 
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] Changing the calendar for an existing event (Issue #10486)

2011-06-27 Thread Jeff Vincent
Is there a way to escalate this somehow?  Others besides myself are seeing 
this issue and it is highly annoying.  I just got an update a week or two to 
Android 2.3 (Gingerbread) on my EVO 4G and there is STILL no way to 
recategorize an existing appointment to a different calendar.
 
I see no activity from any developers regarding this issue and will gladly 
offer any help I can provide.  I'd try to fix it myself but haven't had the 
bandwidth to get bootstrapped to even know where the problem is.
 
http://code.google.com/p/android/issues/detail?id=10486
 
Thanks!!
 
Jeff

-- 
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] Intent filter to catch links from SMS doesn't work

2011-01-26 Thread Vincent
Hi all,

I actually already asked this question on StackOverflow but I didn't
get any answer that could help me solve the problem.
Here is the thing.

What I want to do is to define a URI like myapp://some_data in a
intent filter. And when this kind of URI is met in a SMS or email,
clicking on it would open myapp.
I found on StackOverflow the way to do it. Here is my code:

intent-filter
action android:name=android.intent.action.VIEW/action
category android:name=android.intent.category.DEFAULT/
category
category android:name=android.intent.category.BROWSABLE/
category
data android:scheme=myapp/data
/intent-filter

However it does not work. Actually, if I have such a link in a SMS, it
is not clickable...so of course clicking on it does nothing.
If instead of android:scheme=myapp I am using android:scheme=http
it does work. When I click on the link, Android asks the user whether
to open it with Browser or myapp and it simply works because the link
is clickable (http web adress is always clickable).

What should I do to make my link myapp://some_data clickable in a SMS/
email ? As the intent filter works with http, I guess it can work with
myapp as a scheme.

Thanks a lot.

Vincent

-- 
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] Proguard integration with Google Adsense cause error.

2011-01-05 Thread Vincent
Hi, I just download the latest Android SDK (r08) to use Proguard.
But, I get the following error when exporting apk.

 Proguard returned with error code 1. See console
   You should check if you need to specify additional program
jars.
 Unexpected error while performing partial evaluation:
   Class   = [com/google/ads/AFMAUtil]
   Method  = [c([B[B)[B]
   Exception   = [java.lang.ArrayIndexOutOfBoundsException] (-1)
 java.lang.ArrayIndexOutOfBoundsException: -1

When I remove the codes which call Google Adsense function, I don't
get any error.
If somebody know the way to fix this error, please help me out!

Thanks in advance!!

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

[android-developers] Re: 2.2 Camera Orientation Problem

2010-07-19 Thread Vincent
Dave Sparks

Thank you very much for your response.
I didn't aware of the new api.
It solved my problem.

Thanks!!

Vincent


On Jul 16, 5:56 am, Dave Sparks davidspa...@android.com wrote:
 See android.hardware.Camera.setDisplayOrientation (int degrees)

 This is the approved way to set the camera orientation as of V2.2.
 Please note that this only works for still images, videos will still
 record in landscape orientation.

 On Jul 15, 5:00 am, Vincent y.ikeda.asa...@gmail.com wrote:



  Hi,

  In my camera application, I use the following code to change the
  screen orientation.

  Parameters params = mCamera.getParameters();
  params.set(orientation, portrait);

  It worked for the most of devices.
  However, after updating my NexusOne to2.2, the above code does not
  work!!
  Is there any other way to change the orientation?

  The only way to change the orientation is to change the orientation of
  an Activity.
  setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
  But, I don't want to do this because I have other controls like Text
  or Button on Screen.

  If somebody knows the solution for this, please help me!!

-- 
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] Is It possible to have memory leaks when android apps exit.

2010-07-16 Thread Vincent
Hi,

I have a question about memory leaks.
My tester told me a condition.
He runs my app 100 times, and monitor the memory capacity.
Then he says my app has memory leaks.

My question:
Is it possible to have memroy leaks when app alread terminated.

OS memory management of Android should release the memory of
terminated process normally.

Thanks in advance.

-- 
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] 2.2 Camera Orientation Problem

2010-07-15 Thread Vincent
Hi,

In my camera application, I use the following code to change the
screen orientation.

Parameters params = mCamera.getParameters();
params.set(orientation, portrait);

It worked for the most of devices.
However, after updating my NexusOne to 2.2, the above code does not
work!!
Is there any other way to change the orientation?

The only way to change the orientation is to change the orientation of
an Activity.
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
But, I don't want to do this because I have other controls like Text
or Button on Screen.

If somebody knows the solution for this, please help me!!

-- 
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] MapView crushes in satellite mode if android:anydensity is set true

2010-05-21 Thread Vincent
Hi,

On Android 1.6 WVGA device, a map view in satellite mode crushes when
the map zoom-in too much if I specify android:anyDensity=true in the
manifest file.
But, if I set android:anyDensity=false, then the map does not crush.

I want my app to support a multiple densities and also do not want to
make the map crush.
Is there any way to do this?

I tried to control zoom level of the map, but getMaxZoomLevel() method
in satellite mode does not return a correct value.
Please help me out!!

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

[android-developers] Re: (To Google devs)Using the IM plugin class

2010-03-28 Thread Hugo Vincent
Have there been any updates to (the roadmap for) IM since this
message?

Hugo

On Mar 28 2009, 12:13 am, Dianne Hackborn hack...@android.com wrote:
 This isn't currently supported in the SDK.  I don't know what plans there
 are to have it in the SDK, if any.  Certainly we aren't going to have
 anything in the SDK that requires you get a shared user ID with a system
 package.

 On Fri, Mar 27, 2009 at 3:49 PM, Colin crgod...@gmail.com wrote:

  I would like to use the IM plugin class thats included in the Android
  source, but it is not SDK friendly. I am happy to submit the revisions
  required, but I don't really know what to change. It requires access
  to the non-api android.im tree and UID sharing with android.uid.im.
  I'm stumped, but I'd really like to implement this. Is it better to
  just to submit an official revision?

 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support.  All such questions should be posted on public
 forums, where I and others can see and answer them.

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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words REMOVE ME as the subject.


[android-developers] Camera Questions: 1) Raw Bayer data, 2) NDK camera access

2010-03-22 Thread Hugo Vincent
Hi,

I'm interested in making some photography apps, and have two questions
about the current camera support in the SDK and NDK.

First, is it possible to get raw Bayer data from the camera sensor
(before any kind of demosaicing, color space conversions, noise
reduction etc)? Specifically on the Nexus One, but ideally in a
portable way. How about raw RGB pixel data (again, before noise
reduction, JPEG compression and so on)?

Second, is it possible to access the camera from the NDK for high
performance signal processing (using NEON instructions etc)?

Thanks,
Hugo

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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words REMOVE ME as the subject.


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] Please share the info about the problem app is not visible on Android Market

2010-03-16 Thread Vincent
Hi, All.

The end of last year, there were discussions about the problem
regarding to the visibility of apps on Android Market.

App Not showing up on Verizon DROID Phones
http://groups.google.com/group/android-developers/browse_thread/thread/6324add11decee78/ad4c75a4cd595046?lnk=gstq=not+visible+on+Droid#ad4c75a4cd595046

Our app is not visible on market for some devices
http://groups.google.com/group/android-developers/browse_thread/thread/c4dbe8574ae12812/a6bd96106988be9e?lnk=gstq=Market+HTC#a6bd96106988be9e

HTC Hero, missing applications from Market after firmware update
http://groups.google.com/group/android-developers/browse_thread/thread/fd299f64638391e1


From my understanding, if the app is copy protected, it is not
visible on HTC Hero and Droid Eris.

Does someone get any updated news?
The other devices are OK?

Please share the information because my users reported me that they
cannot see my app from MyTouch.
I would like to clarify which devices are fine and which are not.

Thanks in advance...

-- 
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] Re: Apps, Market and MyTouch 3G 3.5mm.

2010-03-14 Thread Vincent
hi,

Does anybody figure out what the problem is?
I've got the same problem.
My users using MyTouch told me that they can't see my app on the
market...
I have no idea what the problem is...

On Feb 26, 10:43 pm, BlackLight blacklight1...@gmail.com wrote:
 Hello.

 I've got several messages from my users. All of them hasMyTouch3G
 3.5mm and they cannot find my app in theMarket(even search shows
 nothing found). Users with G1, Droid, Hero can find and download
 app.

 ?xml version=1.0 encoding=utf-8?
 manifest xmlns:android=http://schemas.android.com/apk/res/android;
       package=com.someapp
       android:versionCode=1
       android:versionName=1.0

     uses-sdk android:minSdkVersion=3 /

     uses-permission android:name=android.permission.VIBRATE /
     uses-permission android:name=android.permission.RECORD_AUDIO /
     uses-permission
 android:name=android.permission.READ_PHONE_STATE /
     uses-permission android:name=android.permission.INTERNET /
     uses-permission android:name=android.permission.WAKE_LOCK /

     application android:icon=@drawable/icon android:label=@string/
 app_name
 ...

 Is something wrong with AndroidManifest.xml?

-- 
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] Is it possible to change background color of Preference

2010-02-16 Thread Vincent
Hi,

Does anybody know how to change the background color of Preference
(PreferenceCategory, EditTextPreference ...) ?

I wanna do like this:
PreferenceCategory android:title=title_test
android:background=@color/testColor
But this doesn't work...
I searched these by using google, but couldn't find any right
answer...

Also, I couldn't find any way to change other layouts. (e.g. text
color, size and style of preference title or summary)
Is there no way to customize the layout of Preferences?
It'll be great if somebody can help me out.

thanks in advance!

-- 
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: Is it possible to change background color of Preference

2010-02-16 Thread Vincent
Bob, joebowbeer, skink

Thanks so much for your help!!
I successfully managed to change the layout of preference.

As joebowbeer wrote, I changed the top-level background image and
listview setting in my code like below.
 
getWindow().setBackgroundDrawableResource(R.drawable.my_background);
getListView().setBackgroundColor(Color.TRANSPARENT);
getListView().setCacheColorHint(Color.TRANSPARENT);

Then, I supplied the custom layout to the android:layout attribute in
xml in order to change other child preferences as Bob stated.
PreferenceScreen xmlns:android=http://schemas.android.com/apk/
res/android
PreferenceCategory android:title=test_title
android:layout=@xml/preference_category
EditTextPreference
android:key=edit_key
android:title=edit_title
android:summary=edit_summary
android:layout=@xml/preference
/
/PreferenceCategory
/PreferenceScreen


Thank you very much!!


On Feb 17, 8:09 am, skink psk...@gmail.com wrote:
 On Feb 16, 10:51 pm, joebowbeer joe.bowb...@gmail.com wrote:





  Something like this:

  public class MyPreferenceActivity extends PreferenceActivity {

      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);

  getWindow().setBackgroundDrawableResource(R.drawable.my_background);
          getListView().setBackgroundColor(Color.TRANSPARENT);
          getListView().setCacheColorHint(Color.TRANSPARENT);
          getPreferenceManager().setSharedPreferencesName(my_prefs);
          addPreferencesFromResource(R.xml.my_preferences);
      }

  I'm not sure if the listView changes are necessary or advisable.

  Joe

  On Feb 16, 3:33 am, Vincent y.ikeda.asa...@gmail.com wrote:

   Hi,

   Does anybody know how to change the background color of Preference
   (PreferenceCategory, EditTextPreference ...) ?

   I wanna do like this:
   PreferenceCategory android:title=title_test
   android:background=@color/testColor
   But this doesn't work...
   I searched these by using google, but couldn't find any right
   answer...

   Also, I couldn't find any way to change other layouts. (e.g. text
   color, size and style of preference title or summary)
   Is there no way to customize the layout of Preferences?
   It'll be great if somebody can help me out.

   thanks in advance!

 i'm afraid it works only for top-level preferences.

 if you have inner ScreenPreferences it won't work as ScreenPreferences
 use Dialogs in order to show their child Preferences

 pskink

-- 
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 catch map zoom in/out event for Android 1.5

2010-01-15 Thread Vincent
To JP

Thanks for your reply!!
I didn't think of your idea!!

As you wrote, I managed to capture zoom in/out manipulation in onDraw
() method.
---onDraw method---
   tempZoom = mapView.getZoomLevel();
   if (tempZoom != mZoomLevel) {
   bla bla bla
   }
   mZoomLevel = tempZoom;


Thank you very much!!

Vincent

On Jan 15, 2:34 pm, JP joachim.pfeif...@gmail.com wrote:
 I can't give you a direct answer but the following might help: Create
 an overlay to capture zoom level, canvas dimensions and map center
 when the overridden Overlay.onDraw() is called. This is universal in
 the sense that it will also capture users (or your app) manipulating
 the app outside of the zoom controls.

 On Jan 13, 9:43 pm, Vincent y.ikeda.asa...@gmail.com wrote:



  Hi,
  Does anybody know how to catch the map zoom in/out event for Android
  1.5?

  Before Android 1.5, I can use ZoomControls which has a
  setOnZoomInClickListener().
  In order to get zoom controls, I can write like this:
      ZoomControls mZoom = (ZoomControls) mMapView.getZoomControls();

  But, since 1.5, the mMapView.getZoomControls() is deprecated.
  Instead of this, the documentation suggests using
  mMapView.setBuiltInZoomControls.

  Since 1.6, I can use ZoomButtonsController, which has a set
  OnZoomListener().
  In order to get zoom button controls, I can write like this:
     ZoomButtonsController mZoom = (ZoomButtonsController)
  mMapView.getZoomButtonsController().setOnZoomListener(this);

  So, how can I get map zoom in/out event without using
  mMapView.getZoomControls() for Android 1.5 ?

  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] Set ringtone from raw resource?

2009-11-15 Thread Bryan Vincent
So I'm having a hard time setting a ringtone from a raw resource. My
code is below. Any help would be much appreciated.

RingtoneManager.setActualDefaultRingtoneUri(getApplicationContext(),
RingtoneManager.TYPE_NOTIFICATION, Uri.parse(android.resource://
net.thebosskey.gijoepsasoundboard/ + this.resource));

However, when I play back the default notification sound using the
line below, it is not my sound.
RingtoneManager.getRingtone(getApplicationContext(),
RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)).play
();

I know the uri for my sound is correct because the following line
plays it:
RingtoneManager.getRingtone(getApplicationContext(), Uri.parse
(android.resource://net.thebosskey.gijoepsasoundboard/ +
this.resource)).play();

What am I doing wrong?

-- 
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] Got 12 Google Wave invitations to use, let me know if you need

2009-11-09 Thread Vincent Chan
Hi,send me one.Thanks!
Vincent Chan


On Tue, Nov 10, 2009 at 00:12, dave dayong...@gmail.com wrote:

 Hi all,

 I just got 12 Google Wave invitations to use, please let me know if
 you need one.

 Cheers.

 Dave

 --
 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: Android 1.6 SDK is here!

2009-09-15 Thread Vincent Chan
[?]
Vincent Chan


On Wed, Sep 16, 2009 at 10:18, Xavier Ducrohet x...@android.com wrote:


 A last minute mix-up had us upload the wrong SDK packages :(

 The only difference is the lack of TTS language files and of the
 Accessibility apps (TalkBack, SoundBack and KickBack)

 If you don't care about this you can keep using your 1.6 SDK. If you
 care about these features, I've just uploaded the correct archives.

 We apologize for the inconvenience.

 Xav

 On Tue, Sep 15, 2009 at 3:22 PM, Xavier Ducrohet x...@android.com wrote:
 
 http://android-developers.blogspot.com/2009/09/android-16-sdk-is-here.html
 
  Enjoy!
  --
  Xavier Ducrohet
  Android Developer Tools Engineer
  Google Inc.
 



 --
 Xavier Ducrohet
 Android Developer Tools Engineer
 Google Inc.

 


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

inline: 328.png

[android-developers] Re: PORTING BROWSER ON ANDROID

2009-06-16 Thread Vincent

What about write a native-c web browser? rending on framebuffer ..?
I just say say.. :)

On 6月15日, 下午4时50分, Vinay R Rao vinayrrao1...@gmail.com wrote:
 Hi all,

 Is it possible to integrate gecko rendering engine on to android?
 I want to port any open source web browser on to android. Can anyone
 please help me on this?

 Can you Please suggest me which open source browser to port on
 ANDROID.

 Waiting for your replies.

 Thank You,
 Regards,
 Vinay

--~--~-~--~~~---~--~~
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] About how to modify the frameworks/base/Android.mk

2009-06-09 Thread vincent Kor
Hi, All:

I modified the codes in Frameworks/base directory, but the codes depend on
another my own library named A,  so How should I modify the mk file to
meet this so that I can compile the code successfully?



Thanks a lot for your help in advance!!

Vincent

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



[android-developers] Re: Android 2d Shooter Game AirAttack Follow My Blog!

2009-05-09 Thread Vincent Chan
Open Source?

Vincent Chan


On Sun, May 10, 2009 at 03:06, TjerkW tje...@gmail.com wrote:


 Hello Everybody!

 For anyone that is interested in following the development of my
 Android Game: AirAttack,
 i have started a blog where you can follow the development:

 http://airattackandroid.wordpress.com

 So if you are interested, check it out!
 You can also follow me on twitter:
 http://www.twitter.com/tjerkw

 Greetings!
 


--~--~-~--~~~---~--~~
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 could add a new src folder into android src for compiling?

2009-04-09 Thread Vincent Chan
You could do this very easily in eclipse.
Just go to the project properties and choose java build path view.In the
source tab add a folder that you want to set as souce folder.
Is zte developing android phones?
I come from china ,too.

Vincent Chan


On Thu, Apr 9, 2009 at 4:17 PM, chengli chen.l...@zte.com.cn wrote:


 I want to add a new src folder to android project,but there are so
 many file android.mk,so are my src folder.I have no ideas how these
 makefiles are connected with each other while compiling, how could I
 do ?
 


--~--~-~--~~~---~--~~
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] About RadioInfo.java

2009-04-07 Thread Vincent Chen

Dear Sir,

I found RadioInfo.java in Android source code
Is this a application in Setting? And how to use it? I can't find any
icon.

Vincent

--~--~-~--~~~---~--~~
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 dismiss the AlertDialog without buttons after clicking on any item in the Alert Dialog

2009-03-16 Thread vincent Kor
help me !!  Really appreciate your help !!!

Vincent


 Hi, All:

 from the reference of SDK,  AlertDialog information as below.

I want to create an alert dialog without any buttons, but there are
 3 items(radio), then i hope to dismiss the dialog after i click any item in
 the dialog,  how should i dismiss the dialog ?


 Really appreciate your help !!

 Vincent


 --
  public 
 AlertDialog.Builderhttp://developer.android.com/reference/android/app/AlertDialog.Builder.html
 setSingleChoiceItems 
 (CharSequence[]http://developer.android.com/reference/java/lang/CharSequence.htmlitems,
  int checkedItem,
 DialogInterface.OnClickListenerhttp://developer.android.com/reference/android/content/DialogInterface.OnClickListener.htmllistener)

 Set a list of items to be displayed in the dialog as the content, you will
 be notified of the selected item via the supplied listener. The list will
 have a check mark displayed to the right of the text for the checked item.
 Clicking on an item in the list will not dismiss the dialog. Clicking on a
 button will dismiss the dialog.
  Parametersitems the items to be displayed. checkedItem specifies
 which item is checked. If -1 no items are checked. listener

 notified when an item on the list is clicked. The dialog will not be
 dismissed when an item is clicked. It will only be dismissed if clicked on a
 button, *if no buttons are supplied it's up to the user to dismiss *


--~--~-~--~~~---~--~~
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 dismiss the AlertDialog without buttons after clicking on any item in the Alert Dialog

2009-03-15 Thread vincent Kor
Hi, All:

from the reference of SDK,  AlertDialog information as below.

I want to create a dialog but i don't want to have any buttons in the
dialog, then i hope to dismiss the dialog after i click any item in the
dialog,  how should i dismiss the dialog ?

When the user click the back button, it will dismiss the dialog.  so i
need to send the key message in hard code ? is there any other way??

Really appreciate your help !!

Vincent


--
 public 
AlertDialog.Builderhttp://developer.android.com/reference/android/app/AlertDialog.Builder.html
setSingleChoiceItems
(CharSequence[]http://developer.android.com/reference/java/lang/CharSequence.htmlitems,
int checkedItem,
DialogInterface.OnClickListenerhttp://developer.android.com/reference/android/content/DialogInterface.OnClickListener.htmllistener)

Set a list of items to be displayed in the dialog as the content, you will
be notified of the selected item via the supplied listener. The list will
have a check mark displayed to the right of the text for the checked item.
Clicking on an item in the list will not dismiss the dialog. Clicking on a
button will dismiss the dialog.
 Parametersitems the items to be displayed. checkedItem specifies which
item is checked. If -1 no items are checked. listener

notified when an item on the list is clicked. The dialog will not be
dismissed when an item is clicked. It will only be dismissed if clicked on a
button, *if no buttons are supplied it's up to the user to dismiss *

--~--~-~--~~~---~--~~
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 dismiss the single select dialog in AlertDialog

2009-03-14 Thread vincent Kor
Thanks for your reminding me of that. JBQ.


 Hi, All:

from the reference of SDK,  AlertDialog information as below.

I want to create a dialog but i don't want to have any buttons in the
dialog, then i hope to dismiss the dialog after i click any item in the
dialog,  how should i dismiss the dialog ?

When the user click the back button, it will dismiss the dialog.  so i
need to send the key message in hard code ? is there any other way??

Thanks a lot for your help.

Vincent


--
 public 
AlertDialog.Builderhttp://developer.android.com/reference/android/app/AlertDialog.Builder.html
setSingleChoiceItems
(CharSequence[]http://developer.android.com/reference/java/lang/CharSequence.htmlitems,
int checkedItem,
DialogInterface.OnClickListenerhttp://developer.android.com/reference/android/content/DialogInterface.OnClickListener.htmllistener)

Set a list of items to be displayed in the dialog as the content, you will
be notified of the selected item via the supplied listener. The list will
have a check mark displayed to the right of the text for the checked item.
Clicking on an item in the list will not dismiss the dialog. Clicking on a
button will dismiss the dialog.
 Parameters items the items to be displayed. checkedItem specifies which
item is checked. If -1 no items are checked. listener

notified when an item on the list is clicked. The dialog will not be
dismissed when an item is clicked. It will only be dismissed if clicked on a
button, *if no buttons are supplied it's up to the user to dismiss the
dialog. *

**

--~--~-~--~~~---~--~~
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 dismiss the single select dialog in AlertDialog

2009-03-14 Thread vincent Kor
Hi, All:

from the reference of SDK,  AlertDialog information as below.

I want to create a dialog but i don't want to have any buttons in the
dialog, then i hope to dismiss the dialog after i click any item in the
dialog,  how should i dismiss the dialog ?

When the user click the back button, it will dismiss the dialog.  so i
need to send the key message in hard code ? is there any other way??

Thanks a lot for your help.

Vincent


--
 public 
AlertDialog.Builderhttp://developer.android.com/reference/android/app/AlertDialog.Builder.html
setSingleChoiceItems
(CharSequence[]http://developer.android.com/reference/java/lang/CharSequence.htmlitems,
int checkedItem,
DialogInterface.OnClickListenerhttp://developer.android.com/reference/android/content/DialogInterface.OnClickListener.htmllistener)

Set a list of items to be displayed in the dialog as the content, you will
be notified of the selected item via the supplied listener. The list will
have a check mark displayed to the right of the text for the checked item.
Clicking on an item in the list will not dismiss the dialog. Clicking on a
button will dismiss the dialog.
 Parametersitems the items to be displayed. checkedItem specifies which
item is checked. If -1 no items are checked. listener

notified when an item on the list is clicked. The dialog will not be
dismissed when an item is clicked. It will only be dismissed if clicked on a
button, *if no buttons are supplied it's up to the user to dismiss the
dialog. *

**

-

--~--~-~--~~~---~--~~
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] http-proxy does not work on emulator when i use the build of master branch with cupcake changes

2009-01-07 Thread Li Wei (Vincent)

Hi,
I made a full build of the latest master branch(including cupcake
changes), and then make sdk and run emulator with -http-proxy option
under tools directory(also have -vm to specify android virtual
machine). but seems I cannot access to internet behind proxy, is there
anyone else ran into the same problem?


thanks a lot.

--~--~-~--~~~---~--~~
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: Has anybody received an android dev phone in the US yet?

2008-12-19 Thread Vincent C.

I got my at today morning!! :-)

On Dec 17, 11:40 am, Vincent C. mephisto@gmail.com wrote:
 I placed my order at 12/11. Still not get my phone. :-(

 Now my tracking number shows Pending Shippment.
 What kind of NUMBER it is?! (even with wrong spell... XD)

 Hope can get my phone this week...

 -Vincent

 On Dec 17, 5:04 am, Bob C bcopel...@gmail.com wrote:

  Ordered mine on 12/8 (in the evening).  Order screen still says
  ordered.  Sent an email without response on 12/16, and tracking by
  reference didn't work -- until today, 12/17.  Now tracking works and
  shows that it will be delivered on 12/18.  I ordered Fedex 2-day.
--~--~-~--~~~---~--~~
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: Has anybody received an android dev phone in the US yet?

2008-12-17 Thread Vincent C.

I placed my order at 12/11. Still not get my phone. :-(

Now my tracking number shows Pending Shippment.
What kind of NUMBER it is?! (even with wrong spell... XD)

Hope can get my phone this week...

-Vincent

On Dec 17, 5:04 am, Bob C bcopel...@gmail.com wrote:
 Ordered mine on 12/8 (in the evening).  Order screen still says
 ordered.  Sent an email without response on 12/16, and tracking by
 reference didn't work -- until today, 12/17.  Now tracking works and
 shows that it will be delivered on 12/18.  I ordered Fedex 2-day.

--~--~-~--~~~---~--~~
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: send attachment to gmail

2008-04-03 Thread Vincent BARAT

Hello,

I get the same error (see below).
Have you found a fix for that? I really cannot figure out how to fix this!

ERROR/SendMail(5424): IOException while sending message
ERROR/SendMail(5424): javax.mail.MessagingException: IOException while sending 
message;
ERROR/SendMail(5424):   nested exception is:
ERROR/SendMail(5424): javax.activation.UnsupportedDataTypeException: no 
object DCH for MIME type multipart/mixed; 
ERROR/SendMail(5424): boundary==_Part_0_1075087160.1207214436435
ERROR/SendMail(5424): at 
com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:676)
ERROR/SendMail(5424): at javax.mail.Transport.send0(Transport.java:189)
ERROR/SendMail(5424): at javax.mail.Transport.send(Transport.java:118)
ERROR/SendMail(5424): at 
com.vbarat.tests.sendmail.SMTPSender.sendMail(SMTPSender.java:91)
ERROR/SendMail(5424): at 
com.vbarat.tests.sendmail.SendMail$1.onClick(SendMail.java:43)
ERROR/SendMail(5424): at android.view.View.performClick(View.java:1857)
ERROR/SendMail(5424): at android.view.View.onKeyUp(View.java:2872)
ERROR/SendMail(5424): at android.widget.TextView.onKeyUp(TextView.java:1989)
ERROR/SendMail(5424): at android.view.KeyEvent.dispatch(KeyEvent.java:495)
ERROR/SendMail(5424): at android.view.View.dispatchKeyEvent(View.java:2689)
ERROR/SendMail(5424): at 
android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:531)
ERROR/SendMail(5424): at 
android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:531)
ERROR/SendMail(5424): at 
android.widget.ScrollView.dispatchKeyEvent(ScrollView.java:85)
ERROR/SendMail(5424): at 
android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:531)
ERROR/SendMail(5424): at 
android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:531)
ERROR/SendMail(5424): at 
android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:531)
ERROR/SendMail(5424): at 
android.policy.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:1189)
ERROR/SendMail(5424): at 
android.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:871)
ERROR/SendMail(5424): at 
android.app.Activity.dispatchKeyEvent(Activity.java:1503)
ERROR/SendMail(5424): at 
android.policy.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1164)
ERROR/SendMail(5424): at 
android.view.ViewRoot.deliverKeyEvent(ViewRoot.java:926)
ERROR/SendMail(5424): at 
android.view.ViewRoot.handleMessage(ViewRoot.java:595)
ERROR/SendMail(5424): at android.os.Handler.dispatchMessage(Handler.java:80)
ERROR/SendMail(5424): at android.os.Looper.loop(Looper.java:91)
ERROR/SendMail(5424): at 
android.app.ActivityThread.main(ActivityThread.java:3052)
ERROR/SendMail(5424): at java.lang.reflect.Method.invokeNative(Native 
Method)
ERROR/SendMail(5424): at java.lang.reflect.Method.invoke(Method.java:356)
ERROR/SendMail(5424): at 
android.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1547)
ERROR/SendMail(5424): at android.os.ZygoteInit.main(ZygoteInit.java:1445)
ERROR/SendMail(5424): at android.dalvik.NativeStart.main(Native Method)
ERROR/SendMail(5424): Caused by: javax.activation.UnsupportedDataTypeException: 
no object DCH for MIME type multipart/mixed; 
ERROR/SendMail(5424): boundary==_Part_0_1075087160.1207214436435
ERROR/SendMail(5424): at 
javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:905)
ERROR/SendMail(5424): at 
javax.activation.DataHandler.writeTo(DataHandler.java:330)
ERROR/SendMail(5424): at 
javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1403)
ERROR/SendMail(5424): at 
javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1745)
ERROR/SendMail(5424): at 
com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:636)
ERROR/SendMail(5424): ... 29 more


GeorgeS a écrit :
 I been working on an application that does that and attachments won't
 go through using the code referenced. I get a error saying that
 'multipart/mixed' isn't supported. The same code works like a champ in
 a non-Android app. Sounds like something is implemented yet.
 
 
 On Feb 21, 7:12 am, Aditya [EMAIL PROTECTED] wrote:
 On Feb 21, 11:07 am, noha mansour [EMAIL PROTECTED] wrote: how can i 
 send attachment to gmail via android???
 thanks
 tryhttp://davanum.wordpress.com/2007/12/22/android-send-email-via-gmail-...
 and 
 thishttp://wiki.ittoolbox.com/index.php/Send_Email_with_Attachments_Using...

 mix up the code n u r done :)
  

--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en