[android-developers] Re: Can I use OpenGL to make Bitmap without GLSurfaceView

2010-05-02 Thread Robert Green
Awesome that you worked that out - but man... that sure isn't
lightweight!  I bet you could get substantial performance gains doing
that conversion natively and passing the processed array up to java.

On May 2, 4:34 pm, Streets Of Boston  wrote:
> Below is a snippet of code that turns a buffer from GL into a buffer
> that can be used by a Bitmap.
> I'm not sure if you can get a buffer from GL without been having
> showing it before or if this is what you're exactly looking for.
> But here goes anyway :-)
>
> 
>
> public void savePixels(int x, int y, int w, int h, GL10 gl) {
>         if (gl == null)
>                 return;
>
>         // synchronized (this) {
>         // if (mSavedBM != null) {
>         // mSavedBM.recycle();
>         // mSavedBM = null;
>         // }
>         // }
>
>         int b[] = new int[w * (y + h)];
>         int bt[] = new int[w * h];
>         IntBuffer ib = IntBuffer.wrap(b);
>         ib.position(0);
>         gl.glReadPixels(x, 0, w, y + h, GL10.GL_RGBA,GL10.GL_UNSIGNED_BYTE,
> ib);
>
>         for (int i = 0, k = 0; i < h; i++, k++) {// remember, that OpenGL
> bitmap
>                                         // is incompatible with
>                                         // Android bitmap
>                                            // and so, some correction need.
>                 for (int j = 0; j < w; j++) {
>                         int pix = b[i * w + j];
>                         int pb = (pix >> 16) & 0xff;
>                         int pr = (pix << 16) & 0x00ff;
>                         int pix1 = (pix & 0xff00ff00) | pr | pb;
>                         bt[(h - k - 1) * w + j] = pix1;
>                 }
>         }
>
>         Bitmap sb = Bitmap.createBitmap(bt, w, h, Bitmap.Config.ARGB_);
>         synchronized (this) {
>                 mSavedBM = sb;
>         }}
>
> 
>
> On May 2, 2:45 pm, SChaser  wrote:
>
>
>
>
>
> > I would like to be able to use OpenGL in the Android to render into a
> > bitmap (or any other sort of buffer I can turn into one), without
> > actually displaying a GLSurfaceView.
>
> > The purpose is to dynamically create very complex images using OpenGL,
> > and then drawing those images on the canvas of a MapView.
>
> > I have tried overlaying a translucent GLSurfaceView over a MapView, my
> > preferred approach, but it has some problems:
>
> > 1) I have complex menus I need to display from either the MapView or
> > the GLSurfaceView. I have been doing this using a ListView with its
> > own activity. Unfortunately, that activity pushes the MapView down the
> > stack. The result is a bit of flickering when the ListView activity
> > finishes, popping the MapView back to the top. Even worse, if I use
> > the ListView to overlay the GLSurfaceView (giving it the same complex
> > menu capabilities), when it finishes, the GLSurfaceView reappears but
> > the MapView doesn't display.
>
> > 2)As soon as the GLSurfaceView is created, the MapView stops fetching
> > and rendering tiles. There seems to be no way to know when the MapView
> > is complete, so I have to delay an arbitrary interval before creating
> > the surfaceview.
>
> > 3) When the GLSurfaceView is present, the MapView's built-in user
> > interface functions are obscured.
>
> > Anyone know if there is a way around any of these problems?
>
> > --
> > 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 
> 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] Re: Communicating from Android Service to an Activity

2010-05-02 Thread madmax
Thanks a lot Mark! This is exactly what i was looking for.. It
works..


Regards,
  Prafull.

On May 1, 6:25 pm, Mark Murphy  wrote:
> madmaxwrote:
> >              I have an AndroidServicethat runs indefinitely
>
> That's not possible and is not a good idea in general:
>
> http://www.androidguys.com/2009/09/09/diamonds-are-forever-services-a...
>
> > and
> > wants to notify when a specific interesting event occurs to an
> > activity. Now the problem is the "interesting event" occurs anytime
> > and i don't want to "poll" to theserviceall the time to get that
> > event... Theserviceitself should "notify" the activity about the
> > event occuring. I looked around and came across a few methods to do
> > it.
> > 1) Using Intents and putExtras() : This method wont suffice for me
> > because i "don't" want to start a new activity all  the time.
> > 2) Using aidl : I already have an aidl for communication between the
> >serviceand activity. This is essentially the polling mechanism.
>
> Have theservicesend a broadcast Intent via sendBroadcast(), and have
> the activity (when it is on-screen) dynamically register for that Intent
> via registerReceiver().
>
> Here is a sample project from one of my books that demonstrates the
> technique:
>
> http://github.com/commonsguy/cw-android/tree/master/Service/WeatherPlus/
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> Android Training...At Your Office:http://commonsware.com/training
>
> --
> 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] Re: Notification icon from a different package

2010-05-02 Thread Menny
I can only specify the icon resource ID. I can not use Drawable
objects.
I need some way to (maybe) create a notification of a different
Context, or some how USE a Drawable object with Notification

On Apr 29, 11:18 pm, Nerdrow  wrote:
> I can't remember it exactly off-hand, but if you can get a ResolveInfo
> for wherever you want to load the icon from, there's a loadIcon method
> there;  I THINK it's ResolveInfo.loadIcon(PackageManager
> packageManager, Context context), where context = your current
> context.  Search the source for Launcher/Launcher2 on github, I know
> that's where I found it originally.  If that doesn't work for you,
> there's also a method to getResourceIdForName or something to that
> effect in either PackageManager or ResolveInfo.
>
> On Apr 28, 8:25 am, Menny  wrote:
>
>
>
> > Hi,
> > I want to show a notification icon in my application, but to take the
> > icon from a different package.
>
> > My application loads resources from external packages, and ,may show
> > some information in the notification bar.
> > I can take the title and text from the external package, but the icon
> > can be specified only as resource ID, and Android extract the resource
> > from the running context.
>
> > Anyone can 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 
> > 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 
> 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


Re: [android-developers] Activity Not coming to foreground

2010-05-02 Thread Anurag Singh
This is typo mistake, I want to say that we can't use intent.getIntent(),
This method is depricated now.

 So, please choose another option like onNewIntent() or sendbrodcast.

On Mon, May 3, 2010 at 10:58 AM, Anurag Singh  wrote:

> intent.getAction() ,  This method is depricated now. So, please choose
> another option like onNewIntent() or brodcast.
>
> - Anurag Singh
>
>
> On Sun, May 2, 2010 at 6:52 PM, mike  wrote:
>
>> hi guys,
>>
>> i'm getting the outgoing number using BroadCastReceiver and then
>> starts a Activity.
>> but my activity runs in the background???  how can i bring it to
>> foreground??
>>
>>public void onReceive(Context context, Intent intent) {
>>// TODO Auto-generated method stub
>>this.context = context;
>>// this.inten = intent;
>>// String s = intent.getAction();
>>
>>if (intent.getAction()
>>
>>  .equalsIgnoreCase(Intent.ACTION_NEW_OUTGOING_CALL)) {
>>phonenbr =
>> intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
>>intent = new Intent(context, OutGoing.class);
>>intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
>>intent.putExtra("Number", phonenbr);
>>context.startActivity(intent);
>>} else {
>>telManager = (TelephonyManager) context
>>
>>  .getSystemService(Context.TELEPHONY_SERVICE);
>>telManager.listen(new StateListener(),
>>
>>  PhoneStateListener.LISTEN_CALL_STATE);
>>}
>>}
>>
>>
>> regards,
>> Rrandika
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>
>
>

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

[android-developers] Re: Some users are not finding our app in Android Market

2010-05-02 Thread AusR
So this goes against the documented defaults then?




On Apr 8, 1:01 pm, Yahel  wrote:
> It happened to my app for htcTatoo.
>
> The reason was that the screen resolution was lower than what I
> specified in the manifest.
> In this case, the AndroidMarketwon't show the app because
> downscaling doesn't work well.
> So to make the app show in themarketyou have to specifically state
> that the smaller resolution is supported.
>
> Maybe if you developped for say the nexus one, then it has to be
> downscaled to fit on the Legend which as a smaller resolution.
>
> Yahel

-- 
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: Activity Not coming to foreground

2010-05-02 Thread Kumar Bibek
You cannot ...

On May 2, 6:22 pm, mike  wrote:
> hi guys,
>
> i'm getting the outgoing number using BroadCastReceiver and then
> starts a Activity.
> but my activity runs in the background???  how can i bring it to
> foreground??
>
>         public void onReceive(Context context, Intent intent) {
>                 // TODO Auto-generated method stub
>                 this.context = context;
>                 // this.inten = intent;
>                 // String s = intent.getAction();
>
>                 if (intent.getAction()
>                                 
> .equalsIgnoreCase(Intent.ACTION_NEW_OUTGOING_CALL)) {
>                         phonenbr = 
> intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
>                         intent = new Intent(context, OutGoing.class);
>                         intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
>                         intent.putExtra("Number", phonenbr);
>                         context.startActivity(intent);
>                 } else {
>                         telManager = (TelephonyManager) context
>                                         
> .getSystemService(Context.TELEPHONY_SERVICE);
>                         telManager.listen(new StateListener(),
>                                         PhoneStateListener.LISTEN_CALL_STATE);
>                 }
>         }
>
> regards,
> Rrandika
>
> --
> 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


Re: [android-developers] Activity Not coming to foreground

2010-05-02 Thread Anurag Singh
intent.getAction() ,  This method is depricated now. So, please choose
another option like onNewIntent() or brodcast.

- Anurag Singh

On Sun, May 2, 2010 at 6:52 PM, mike  wrote:

> hi guys,
>
> i'm getting the outgoing number using BroadCastReceiver and then
> starts a Activity.
> but my activity runs in the background???  how can i bring it to
> foreground??
>
>public void onReceive(Context context, Intent intent) {
>// TODO Auto-generated method stub
>this.context = context;
>// this.inten = intent;
>// String s = intent.getAction();
>
>if (intent.getAction()
>
>  .equalsIgnoreCase(Intent.ACTION_NEW_OUTGOING_CALL)) {
>phonenbr =
> intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
>intent = new Intent(context, OutGoing.class);
>intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
>intent.putExtra("Number", phonenbr);
>context.startActivity(intent);
>} else {
>telManager = (TelephonyManager) context
>
>  .getSystemService(Context.TELEPHONY_SERVICE);
>telManager.listen(new StateListener(),
>
>  PhoneStateListener.LISTEN_CALL_STATE);
>}
>}
>
>
> regards,
> Rrandika
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

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

[android-developers] JIT compiler explanation

2010-05-02 Thread Justin King
Hello everyone,

Is anyone able to explain to me exactly what the upcoming JIT compiler will
provide? For example, I have Java programs that generate bytecode at runtime
which I would like to port to android. Will the JIT compiler make this
possible by converting the runtime generated Java byte code to Dalvik at
runtime as required?

Thanks!

Justin

-- 
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 close all activities in a app

2010-05-02 Thread Saurav
well there is a function called .finish()

this wud suffice ur needs i guess.

hope this helps.




Regards,
Saurav Mukherjee.


On Mon, May 3, 2010 at 8:52 AM, CMF  wrote:

> I have two activities,A ,B
> A will start activity B
> When I press "back"button in B, I want to close A also
> But how can I close A here?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

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

[android-developers] how to draw objects in openGl with delay

2010-05-02 Thread kirti kaul
Hi,

I want to draw say some squares after delay,ie if i need to draw 3
squares,i should get the square1 first,then after some delay square 2
second and so on.I used thread.sleep(msec),but what I get is , i get
all the three squares after the delay specified,i use something like
this:

gl.glPushMatrix();
gl.glTranslatef(1.0f, 1.8f, 0);
object.draw(gl);
square.update();
gl.glPopMatrix();
try{
thread.sleep(100);
}
catch
{
s.o.p("_");
}

gl.glPushMatrix();
gl.glTranslatef(.2f, .8f, 0);
square.draw(gl);

..so on

Can somebody help 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: widget doesn't fresh on verizon droid, but works fine on HTC eris.

2010-05-02 Thread JP
Actually a small addition. It's not only your service that's "in
jeopardy".
I have a similar problem and find that the Widget is being killed by
the OS almost immediately out of the gate. From far looks like what
you describe.
There's a way to start Services in the foreground (through
startForeground()), but I haven't yet figured out how to protect a
Widget in a similar fashion.


On May 2, 7:44 pm, JP  wrote:
> What you should look for:
> If you use a background service, check Logcat for something like
> "Process  (pid <...>) has died" to see if the OS is
> pulling the plug on your widget's background service.
>
> On May 2, 3:40 pm, billconan  wrote:
>
>
>
> > hello guys,
>
> > I'm developing a widget based on this tutorial.
> >  http://android-developers.blogspot.com/2009/04/introducing-home-scree...
>
> > the same code works fine on my HTC eris. but on the verizon droid, the
> > widget doesn't refresh. the widget updates the time i add it on the
> > home screen. but after that it freezed.
>
> > the droid runs a 2.1 os while the eris runs 1.5. can this be the
> > problem?
>
> > I'm updating an image view with this code:
>
> >      updateViews.setImageViewResource(R.id.xxx,.);
>
> > is there anybody having the same issue? do you know the solution?
>
> > --
> > 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 
> 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


Re: [android-developers] Re: Change the playback rate of a track in real time

2010-05-02 Thread yakura y
Mario I have solved all the problems with Eclipse. I have just set up my
application and it works flawlessly using your jni wrappers. Thanks a lot
and congratulations for your project.

2010/5/3 yakura y 

> >ffmpeg and mpg123 are the ones that I know of for MP3, don't know of
> >any for OGG.  I don't think you're going to find a Java decoder, and
> >certainly not in real time.
> Thank you for the info, Peter
>
>
> >i have written jni wrappers around mpg123 and libvorbis for android.
> >you can find them included in libgdx which is available at
> >http://code.google.com/p/libgdx/ . More
> info can be found at
> >http://www.badlogicgames.com or you can email if you have any
> >questions. writting to a wav file is not included should be extremely
> >simple though.
> Thanks, I have tried to use gdx on my project, but I can´t configure
> Eclipse properly to use libgdx.so and libandroidgl20.so. I have created the
> folder armeabi with both of them inside and added the jars, but when I
> launch the application I get an error because it can not find the library.
> Can you help me, 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: Market

2010-05-02 Thread Lance Nanek
>I'm not even quite sure why it would be necessary.

This ability would be great for any application that has a free
version and a paid version. Often the free version wants to offer a
button to open the market details page for the paid version. There's
no good way to tell if the paid version is available to the user,
however.

>you could query Cyrket

Using Cyrket would give false positives. Paid apps, for example, are
only visible to users in certain countries on certain carriers. The
Cyrket method would claim all users can see them. It lists paid apps,
so its scraper must be in a country and on a carrier that supports
them.

On Apr 26, 9:53 am, Sean Hodges  wrote:
> If you don't mind a potential delay after publishing the other app,
> then you could query Cyrket for its package name. For instance:
> "http://www.cyrket.com/p/android/com.blau.android.richer/"; You will
> get a 200 (success) response if the app is available on the market, or
> a 404 (page not found) if not. Careful not to pound the Cyket server
> with requests though, or you're likely to get blocked.
>
> I think a more sensible solution would be to handle this yourself,
> publish the app with the event triggering a simple "Coming soon"
> dialog, then publish another version with the Intent added as soon as
> the other app is on the market.
>
>
>
> On Mon, Apr 26, 2010 at 12:26 PM, Ajay  wrote:
> > Hi,
> >   I wanted to check the availability of another app in Market from my
> > app. Based on this I will have to give a message saying "Coming
> > soon..." or show the other app in Market. I am using the following
> > intent
>
> > new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?
> > id=com.example.android."));
>
> > Now, how can I catch the result which would say if the Market was able
> > to find this package or not?
>
> > Thank you,
> > Ajay
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group 
> 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] Listening for Bluetooth events and AVRCP profile

2010-05-02 Thread Moto
I need to find out the following information or guidance to achieve a
solution:

1. I want to be able to capture bluetooth state changes, particularly
when it's paired and when it's not.  I do see I can possibly catch the
intent "android.bluetooth.a2dp.intent.action.SINK_STATE_CHANGED" but
how reliable is this throughout devices since I can't find it on the
APIs?

2. I want to be able to send now playing information to the paired
device.  I assume this is done via the AVRCP profile.  Does Android
support this profile?  I could not find it in the APIs but did find
some info that is supported by android on this site.
http://sites.google.com/a/android.com/opensource/projects/bluetooth-faq


Thanks for all the help in advance!
-Moto

-- 
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 close all activities in a app

2010-05-02 Thread CMF
I have two activities,A ,B
A will start activity B
When I press "back"button in B, I want to close A also
But how can I close A here?

-- 
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: widget doesn't fresh on verizon droid, but works fine on HTC eris.

2010-05-02 Thread JP

What you should look for:
If you use a background service, check Logcat for something like
"Process  (pid <...>) has died" to see if the OS is
pulling the plug on your widget's background service.


On May 2, 3:40 pm, billconan  wrote:
> hello guys,
>
> I'm developing a widget based on this tutorial.
>  http://android-developers.blogspot.com/2009/04/introducing-home-scree...
>
> the same code works fine on my HTC eris. but on the verizon droid, the
> widget doesn't refresh. the widget updates the time i add it on the
> home screen. but after that it freezed.
>
> the droid runs a 2.1 os while the eris runs 1.5. can this be the
> problem?
>
> I'm updating an image view with this code:
>
>      updateViews.setImageViewResource(R.id.xxx,.);
>
> is there anybody having the same issue? do you know the solution?
>
> --
> 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


Re: [android-developers] Re: Change the playback rate of a track in real time

2010-05-02 Thread yakura y
>ffmpeg and mpg123 are the ones that I know of for MP3, don't know of
>any for OGG.  I don't think you're going to find a Java decoder, and
>certainly not in real time.
Thank you for the info, Peter

>i have written jni wrappers around mpg123 and libvorbis for android.
>you can find them included in libgdx which is available at
>http://code.google.com/p/libgdx/ . More
info can be found at
>http://www.badlogicgames.com or you can email if you have any
>questions. writting to a wav file is not included should be extremely
>simple though.
Thanks, I have tried to use gdx on my project, but I can´t configure Eclipse
properly to use libgdx.so and libandroidgl20.so. I have created the folder
armeabi with both of them inside and added the jars, but when I launch the
application I get an error because it can not find the library. Can you help
me, 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] user mode build and dexpreopt

2010-05-02 Thread truth4u
In building the image with the user variant, dexpreopt failed with
following error.

30:37.267647  dexpreopt: WaitForString: "#", 20.0
30:57.287851  dexpreopt: Timeout expired after 20.0 seconds
30:57.287922  dexpreopt: Killing emulator

It seems emulator is not working. Please suggest me some pointer to
resolve 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] Re: Maximum Texture Units

2010-05-02 Thread Lance Nanek
It wouldn't surprise me if the Droid has that little. Its graphics
solution breaks the scene up into tiles, which results in less data
being needed at any one time. It also performs depth testing before
doing the texturing, so uses less texture data due to that as well.

Isn't OpenGL supposed to transparently start swapping texture objects
between main memory and video memory for you when you run out of video
memory? Using it all up may manifest more as a noticeable drop in
performance than an outright error.

On May 2, 4:42 am, Robert Green  wrote:
> I remember reading that the MSM7200-based phones have 8mb of VRAM and
> so I have to imagine that you could count on at least that much for
> the better GPUs.
>
> What's weird though is that I keep finding things talking about how
> the PowerVR SGX530 has 2MB of VRAM which seems awfully low - unless
> that's a texture cache and there is a larger chunk of VRAM that is
> implementation-specific.  I don't know..
>
> I couldn't find any info on the QS8250 (snapdragon 1ghz) VRAM.
>
> So far I've never run out of vram on any device and I'm loading quite
> a bit in on some games.
>
> Antigen uses:
> 256x512 32 bit for story start text atlas
> 256x512 32 bit for main text atlas
> 256x512 32 bit for level bg front
> 512x512 16 bit for level bg back
> 5 256x256 32 bit for characters, shading and faces
> 7 64x64 32 bit for items
> several for the HUD
> and many other smaller ones for glow, particles, etc..
>
> My new 3D game uses (all mipmapped so add 33% more size on):
> 1024x1024 16 bit for main level texture
> 512x512 16 bit for level lightmap
> 4x 512x512 16 bit for characters
> 3x 256x256 16 bit for weapons
> 256x512 32 bit for text atlas
> about 512K-1MB of geometry VBOs
> 256x256 32 bit for HUD graphics
> Many smaller 32 bit ones for projectiles and other small things
>
> So really there seems to be ample room there.  Both of those scenarios
> load fine on a G1.
>
> If you want to write an easy test, write a loop that loads up a 512 32
> bit (1MB) texture into VRAM and keep count of how many times it works
> until gl.glGetError() returns the out of memory error after
> glTexImage2D.  I'd be curious as to what your results are.
>
> On May 2, 1:06 am, Jeremiah Sellars  wrote:
>
>
>
> > This may be just another silly question then, but after doing quite a
> > few searches about different phones... I'm finding the amount of
> > general RAM but not VRAM. Does anyone know this spec for newer phones?
> > I'm developing with Droid or better phones in mind...
>
> > On May 1, 6:02 am, Mario Zechner  wrote:
>
> > > gentextures only creates handles for you. Actual memory for the bitmap
> > > data is allocated when calling glteximage2D. That will be your biggest
> > > limitation as video ram is of course limited. How much vram is
> > > available is dependent on the chipset/device you are running your
> > > application on.
>
> > > On 1 Mai, 00:59, Jeremiah Sellars  wrote:
>
> > > > Oh, geez... okay that explains it. Thanks to both of you, that really
> > > > explains it well. Is there then a limit on the number of textures
> > > > GenTextures can return?
>
> > > > On Apr 30, 3:39 pm, Robert Green  wrote:
>
> > > > > Yeah multiple texture units are only needed for multitexturing, of
> > > > > which the most common use is for lightmapping.
>
> > > > > On Apr 30, 4:57 pm, Mario Zechner  wrote:
>
> > > > > > The number of texture units and the maximum texture size are not
> > > > > > really related in any way. The number of texture units tells you how
> > > > > > many textures you can use simultaniously when drawing geometry (how
> > > > > > many textures can be bound at once). You can have more textures in
> > > > > > video ram than there are texture units, however, you can only bind
> > > > > > #texture units textures at any time. A maximum of 2 texture units is
> > > > > > sufficient for most scenarios where you have a diffuse texture and a
> > > > > > lightmap for example.
>
> > > > > > The maximum texture size is really just an estimate with most 
> > > > > > drivers
> > > > > > and depends on things such as internal storage (which might be fixed
> > > > > > by the driver anyways) and so on.
>
> > > > > > In any case, both numbers will differ from device to device or 
> > > > > > rather
> > > > > > chipset to chipset.
>
> > > > > > On 30 Apr., 23:19, Jeremiah Sellars  wrote:
>
> > > > > > > I'm wondering if this is just an issue with how the emulator is 
> > > > > > > setup,
> > > > > > > but I'm not sure.
>
> > > > > > > I'm (natively) calling this:
>
> > > > > > > int maxt = 0;
>
> > > > > > > glGetIntegerv(GL_MAX_TEXTURE_UNITS, &maxt);
>
> > > > > > > __android_log_print(ANDROID_LOG_VERBOSE, "Native", "Max textures 
> > > > > > > %d",
> > > > > > > maxt);
>
> > > > > > > This only outputs 2... could it be possible that I'm going to be
> > > > > > > allowed only 2 textures? That seems impossible...
>
> > > > > > > GL_MAX_TEXTURE_SIZE reports 4096 which is more than enough. 

[android-developers] Re: Can't upload my .apk to the market - minSdkVersion error every time.

2010-05-02 Thread Lance Nanek
>'No resource identifier found for attribute 'targetSdkVersion' in package 
>'android'

This sort of error is usually from having a project build target lower
than when a feature was introduced. I think targetSdkVersion was added
in Android 1.6, for example, so you'd have to increase the project
build target to at least that in order to use it without an error.

No idea about your original error. Some random things you can check, I
guess: Those weird hyphens you posted in the XML aren't actually in
there, right? Your project build target is set to Android 1.5? You
have the latest ADT Eclipse plugin and latest SDK updates? You could
also try creating a new Android project, copying your old source files
and resources in, and redoing your manifest from the default one just
to be absolutely sure nothing is screwed up.

On May 2, 7:14 pm, Savgrr  wrote:
> I tried to add the android:targetSdkVersion attribute and I got an
> error msg that said
>
>  'No resource identifier found for attribute 'targetSdkVersion' in
> package 'android'
>
> Does that make sense? I am so frustrated. The app works great it just
> won't upload onto the Market. Is there a way to just bypass it?
>
> On Apr 28, 6:31 pm, Matt Hill  wrote:
>
>
>
> > Hi Savgrr.
>
> > Not sure if this is your problem, but perhaps add the
> > android:targetSdkVersion attribute to the uses-sdk node.
>
> > For more info, 
> > see:http://developer.android.com/guide/appendix/api-levels.html#uses
>
> > On Apr 27, 8:10 pm, Savgrr  wrote:
>
> > > Hi all, I am desperately looking for help with this! I've found many
> > > other forums on the subject but none of the suggestions ever help!
>
> > > I wrote a basic soundboard app, and it runs fine there's nothing wrong
> > > with it. I want to upload it to the Market, but every time I try I get
> > > an error message:
>
> > > Market requires the minSdkVersion to be set to a positive 32-bit
> > > integer in AndroidManifest.xml
>
> > > That is already in there, I'm using 1.5 so I have my minSdkVersion set
> > > at 3. I don't understand what the problem is, and I've asked a lot of
> > > devs that never know what to tell me. I don't want to use a different
> > > platform because my phone currently uses 1.5. Others have suggested
> > > putting the  line under the  line, but that hasn't
> > > helped at all. Here is what my manifest looks like:
>
> > > 
> > > - http://schemas.android.com/apk/res/android";
> > > package="com.sav.soundboard" android:versionName="1.0"
> > > android:versionCode="1">
> > > - 
> > > - 
> > > - 
> > >   
> > >   
>
> > >   
> > >   
> > >   
> > >  
> > >  
>
> > > Does anyone know how to fix 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 
> > > 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 
> > 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 
> 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


Re: [android-developers] Activity and view inflation

2010-05-02 Thread TreKing
On Sun, May 2, 2010 at 2:39 PM, Michael Scott  wrote:

> I have an Acitivity and I would like to fiddle with the views upon creation
>

Can't you just findViewById(int) for whichever view you want to fiddle with
and set whatever properties you want on if after you get it? After calling
setContentView() of course.

-
TreKing - Chicago transit tracking app for Android-powered devices
http://sites.google.com/site/rezmobileapps/treking

-- 
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: Can't upload my .apk to the market - minSdkVersion error every time.

2010-05-02 Thread Savgrr
I tried to add the android:targetSdkVersion attribute and I got an
error msg that said

 'No resource identifier found for attribute 'targetSdkVersion' in
package 'android'

Does that make sense? I am so frustrated. The app works great it just
won't upload onto the Market. Is there a way to just bypass it?

On Apr 28, 6:31 pm, Matt Hill  wrote:
> Hi Savgrr.
>
> Not sure if this is your problem, but perhaps add the
> android:targetSdkVersion attribute to the uses-sdk node.
>
> For more info, 
> see:http://developer.android.com/guide/appendix/api-levels.html#uses
>
> On Apr 27, 8:10 pm, Savgrr  wrote:
>
>
>
> > Hi all, I am desperately looking for help with this! I've found many
> > other forums on the subject but none of the suggestions ever help!
>
> > I wrote a basic soundboard app, and it runs fine there's nothing wrong
> > with it. I want to upload it to the Market, but every time I try I get
> > an error message:
>
> > Market requires the minSdkVersion to be set to a positive 32-bit
> > integer in AndroidManifest.xml
>
> > That is already in there, I'm using 1.5 so I have my minSdkVersion set
> > at 3. I don't understand what the problem is, and I've asked a lot of
> > devs that never know what to tell me. I don't want to use a different
> > platform because my phone currently uses 1.5. Others have suggested
> > putting the  line under the  line, but that hasn't
> > helped at all. Here is what my manifest looks like:
>
> > 
> > - http://schemas.android.com/apk/res/android";
> > package="com.sav.soundboard" android:versionName="1.0"
> > android:versionCode="1">
> > - 
> > - 
> > - 
> >   
> >   
>
> >   
> >   
> >   
> >  
> >  
>
> > Does anyone know how to fix 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 
> > 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 
> 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] Is there a way to view app memory usage in Nexus One while in authoring mode?

2010-05-02 Thread Agus
Dear all,

Is there a way to view app memory usage, threads on Nexus One while in
authoring mode? Is it even supported since I am not sure Nexus One is
a dev phone or not.

Agus.

-- 
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: "unable to open database file" after OS upgrade

2010-05-02 Thread Emmanuel
hello all,

Just to let you know, I included this code in my version of my games
'Word Prospector' and 'Chasseur de mots', and I don't have any more
bug report with this issue !

Emmanuel
http://androidblogger.blogspot.com/
http://www.alocaly.com/



On Apr 28, 2:01 am, Emmanuel  wrote:
> Hello all,
>
> I had the same issue recently, and after the reading of this thread, I
> try this thing :
>
> public class SQLHelper extends SQLiteOpenHelper
>         {
>                 private File m_DBFile;
>                 public SQLHelper(Context context, String name) {
>                         super(context, name, null, 1);
>                         m_DBFile  = context.getDatabasePath( name );
>                 }
>
>                 public void onCreate(SQLiteDatabase db)
>                 {
>
>                         // My stuff here :
>                         CreateTableWithDefaultValues(db);
>                 }
>
>                 @Override
>                 public void onUpgrade(SQLiteDatabase db, int oldVersion, int
> newVersion)
>                 {
>                         return;
>                 }
>                 public synchronized SQLiteDatabase getWritableDatabase ()
>                 {
>                         SQLiteDatabase db;
>                         if ( m_DBFile.exists() )
>                                 db = SQLiteDatabase.openDatabase( 
> m_DBFile.toString(), null,
> SQLiteDatabase.NO_LOCALIZED_COLLATORS );
>                         else
>                                 db = super.getWritableDatabase();
>                         return db;
>                 }
>         }
>
> Actually, it runs OK on the emulator, so I hope it doesn't bring any
> more issues, ... And that it solves the first crash !
>
> Does it seem reasonable ?
>
> Emmanuel /Alocalyhttp://androidblogger.blogspot.com/http://www.alocaly.com/
>
> On Apr 14, 7:24 pm, Mariano Kamp  wrote:
>
>
>
>
>
> > I had a look into it and this approach doesn't work for me.
>
> > When using the SQLiteOpenHelper you cannot pass in this flag.
>
> > I tried to work around the SQLiteOpenHelper first, but then it delegates to
> > the context, which itself uses private API and now have to copy/patch at
> > least four classes. I also found a reference to private API (FileUtils) that
> > uses some obscure modes that I don't want to touch as I don't really
> > understand them.
> > I fear to take a problem that a couple of hundred users of my app have to a
> > problem that will affect every user ;)
>
> > But thanks for your hint anyway.
>
> > On Mon, Apr 12, 2010 at 10:39 PM, Mariano Kamp 
> > wrote:
>
> > > Skink,
>
> > > awesome. That sounds fantastic. I will try that.
>
> > > Cheers,
> > > Mariano
>
> > > On Mon, Apr 12, 2010 at 7:45 PM, skink  wrote:
>
> > >> On Apr 9, 2:36 pm, Mariano Kamp  wrote:
> > >> > *bump*
>
> > >> > On Fri, Apr 2, 2010 at 12:53 PM, Mariano Kamp  > >> >wrote:
>
> > >> > > Hi,
>
> > >> > > recently I very often get error reports from users that upgrade their
> > >> OS.
> > >> > > This includes at least 1.5, 1.6, 2.1 and custom ROMs.
>
> > >> > > Anybody else seeing these? Any idea what to do about it?
>
> > >> > > Cheers,
> > >> > > Mariano
>
> > >> i had similar problem too, i solved it by adding flag
> > >> SQLiteDatabase.NO_LOCALIZED_COLLATORS when calling
> > >> SQLiteDatabase.openDatabase
>
> > >> hth
> > >> 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 > >>  cr...@googlegroups.com>
> > >> For more options, visit this group at
> > >>http://groups.google.com/group/android-developers?hl=en
>
> > >> To unsubscribe, reply using "remove me" as the subject.
>
> --
> 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] widget doesn't fresh on verizon droid, but works fine on HTC eris.

2010-05-02 Thread billconan
hello guys,

I'm developing a widget based on this tutorial.
 
http://android-developers.blogspot.com/2009/04/introducing-home-screen-widgets-and.html

the same code works fine on my HTC eris. but on the verizon droid, the
widget doesn't refresh. the widget updates the time i add it on the
home screen. but after that it freezed.

the droid runs a 2.1 os while the eris runs 1.5. can this be the
problem?

I'm updating an image view with this code:

 updateViews.setImageViewResource(R.id.xxx,.);


is there anybody having the same issue? do you know the solution?

-- 
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: Can I use OpenGL to make Bitmap without GLSurfaceView

2010-05-02 Thread Streets Of Boston
Below is a snippet of code that turns a buffer from GL into a buffer
that can be used by a Bitmap.
I'm not sure if you can get a buffer from GL without been having
showing it before or if this is what you're exactly looking for.
But here goes anyway :-)



public void savePixels(int x, int y, int w, int h, GL10 gl) {
if (gl == null)
return;

// synchronized (this) {
// if (mSavedBM != null) {
// mSavedBM.recycle();
// mSavedBM = null;
// }
// }

int b[] = new int[w * (y + h)];
int bt[] = new int[w * h];
IntBuffer ib = IntBuffer.wrap(b);
ib.position(0);
gl.glReadPixels(x, 0, w, y + h, GL10.GL_RGBA,GL10.GL_UNSIGNED_BYTE,
ib);

for (int i = 0, k = 0; i < h; i++, k++) {// remember, that OpenGL
bitmap
// is incompatible with
// Android bitmap
   // and so, some correction need.
for (int j = 0; j < w; j++) {
int pix = b[i * w + j];
int pb = (pix >> 16) & 0xff;
int pr = (pix << 16) & 0x00ff;
int pix1 = (pix & 0xff00ff00) | pr | pb;
bt[(h - k - 1) * w + j] = pix1;
}
}

Bitmap sb = Bitmap.createBitmap(bt, w, h, Bitmap.Config.ARGB_);
synchronized (this) {
mSavedBM = sb;
}
}


On May 2, 2:45 pm, SChaser  wrote:
> I would like to be able to use OpenGL in the Android to render into a
> bitmap (or any other sort of buffer I can turn into one), without
> actually displaying a GLSurfaceView.
>
> The purpose is to dynamically create very complex images using OpenGL,
> and then drawing those images on the canvas of a MapView.
>
> I have tried overlaying a translucent GLSurfaceView over a MapView, my
> preferred approach, but it has some problems:
>
> 1) I have complex menus I need to display from either the MapView or
> the GLSurfaceView. I have been doing this using a ListView with its
> own activity. Unfortunately, that activity pushes the MapView down the
> stack. The result is a bit of flickering when the ListView activity
> finishes, popping the MapView back to the top. Even worse, if I use
> the ListView to overlay the GLSurfaceView (giving it the same complex
> menu capabilities), when it finishes, the GLSurfaceView reappears but
> the MapView doesn't display.
>
> 2)As soon as the GLSurfaceView is created, the MapView stops fetching
> and rendering tiles. There seems to be no way to know when the MapView
> is complete, so I have to delay an arbitrary interval before creating
> the surfaceview.
>
> 3) When the GLSurfaceView is present, the MapView's built-in user
> interface functions are obscured.
>
> Anyone know if there is a way around any of these problems?
>
> --
> 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] Double click on app widget

2010-05-02 Thread westmeadboy
Is it possible to listen for double click events on an app widget?

Judging by the api, it appears not, but I think this would be really
useful.

I suppose a workaround would be to use an onClick pending intent to an
activity that checks if its been started twice in quick succession -
but this seems nasty...

-- 
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: Change the playback rate of a track in real time

2010-05-02 Thread Mario Zechner
i have written jni wrappers around mpg123 and libvorbis for android.
you can find them included in libgdx which is available at
http://code.google.com/p/libgdx/. More info can be found at
http://www.badlogicgames.com or you can email if you have any
questions. writting to a wav file is not included should be extremely
simple though.

On 2 Mai, 19:48, Peter Jeffe  wrote:
> On May 2, 6:36 am, yakura y  wrote:
>
> > Is there any library out there that it allows to decode mp3/ogg to wav in
> > android in realtime? (not necessarily in realtime but it could be great). I
> > think I need to use the NDK but I would not like to have to manage with
> > that.
>
> ffmpeg and mpg123 are the ones that I know of for MP3, don't know of
> any for OGG.  I don't think you're going to find a Java decoder, and
> certainly not in real time.
>
> -- Peter
>
> --
> 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] Activity and view inflation

2010-05-02 Thread Michael Scott
I have an Acitivity and I would like to fiddle with the views upon
creation. I thought that the way to do this would be to hook in on
onCreateView during inflation. But the method just doesn't get called,
no matter if I use setContentView(id) or onCreateView(view) with a
View I inflated with getLayoutInflater.inflate(id) ( or
(LayoutInflater)getSystemService(LAYOUT_INFLATER_SERVICE).inflate(id) ).
Have I misunderstood how it should work? Or what am I doing wrong?
/Michael

-- 
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 I use OpenGL to make Bitmap without GLSurfaceView

2010-05-02 Thread SChaser
I would like to be able to use OpenGL in the Android to render into a
bitmap (or any other sort of buffer I can turn into one), without
actually displaying a GLSurfaceView.

The purpose is to dynamically create very complex images using OpenGL,
and then drawing those images on the canvas of a MapView.

I have tried overlaying a translucent GLSurfaceView over a MapView, my
preferred approach, but it has some problems:

1) I have complex menus I need to display from either the MapView or
the GLSurfaceView. I have been doing this using a ListView with its
own activity. Unfortunately, that activity pushes the MapView down the
stack. The result is a bit of flickering when the ListView activity
finishes, popping the MapView back to the top. Even worse, if I use
the ListView to overlay the GLSurfaceView (giving it the same complex
menu capabilities), when it finishes, the GLSurfaceView reappears but
the MapView doesn't display.

2)As soon as the GLSurfaceView is created, the MapView stops fetching
and rendering tiles. There seems to be no way to know when the MapView
is complete, so I have to delay an arbitrary interval before creating
the surfaceview.

3) When the GLSurfaceView is present, the MapView's built-in user
interface functions are obscured.

Anyone know if there is a way around any of these problems?

-- 
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: some users getting package not signed correctly

2010-05-02 Thread Maps.Huge.Info (Maps API Guru)
Are you sure they are valid customers? Perhaps this is a scam. Just a
thought.

-John Coryat

-- 
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] some users getting package not signed correctly

2010-05-02 Thread Peter Jeffe
A small percentage of our users are getting a package not signed
correctly error when installing our app that was downloaded from the
Market.  They can't re-download from the Market, so we are having to
get them to download and install it from our site, which works fine.
It seems to happen to maybe 1% of our users, and only for our paid
app, not for the free one (at least that we've heard of, naturally the
paid users are going to contact us more than the free ones).

I'm guessing it's a problem when the download is corrupted for some
reason, but in that case shouldn't the Market let them re-download it
and try again?

Anyone else seeing this?

-- Peter

-- 
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: Change the playback rate of a track in real time

2010-05-02 Thread Peter Jeffe
On May 2, 6:36 am, yakura y  wrote:
> Is there any library out there that it allows to decode mp3/ogg to wav in
> android in realtime? (not necessarily in realtime but it could be great). I
> think I need to use the NDK but I would not like to have to manage with
> that.

ffmpeg and mpg123 are the ones that I know of for MP3, don't know of
any for OGG.  I don't think you're going to find a Java decoder, and
certainly not in real time.

-- Peter

-- 
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] SSL handshake logging in Android

2010-05-02 Thread Michael Rueger

On 5/1/10 7:20 PM, sandy8531 wrote:

I am having trouble with my HttpsURLConnection client.

I can make one request to the server using my keystore, however the
second (and subsequent) requests in the same JVM fail.  ( I initialize
a SSLSocketFactory using my keystore and set it on my
HttpsURLConnection).


See:
http://code.google.com/p/android/issues/detail?id=7074

Currently I'm wrapping my calls with retries. If anybody knows a better 
workaround please let us know!


Michael

--
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: Newb: Display URL Image

2010-05-02 Thread Mark Murphy
Jose Gomez wrote:
> If you are just trying to make the ImageView display an image from a URL
> use this function.
> 
> private Bitmap decodeImage(String url) {
> 
>  URL aURL;
> 
>  try {
> 
>  aURL = new URL(url);
> 
>  URLConnection conn = aURL.openConnection();
> 
>  conn.connect();
> 
>  InputStream is = conn.getInputStream();
> 
>  BufferedInputStream bis = new BufferedInputStream(is);
> 
>  Bitmap bm = BitmapFactory.decodeStream(bis);
> 
>  bis.close();
> 
>  is.close();
> 
>  return bm;
> 
>  } catch (MalformedURLException e) {
> 
>  e.printStackTrace();
> 
>  } catch (IOException e) {
> 
>  e.printStackTrace();
> 
>  }
> 
>  return null;
> 
>  }
> }
> 
> 
> call the function as
> imgView.setImageBitmap(decodeImage("http://sss.jpg";));

The decodeImage() method you supply is fine. However, do not call it as
shown. That requires you to call it on the main application thread,
because you are updating the UI. It is not safe to make HTTP requests on
the main application thread, because you do not know how long they will
take to process.

One approach is to call decodeImage() in the doInBackground() method of
an AsyncTask, then update the ImageView in the task's onPostExecute().
Have the ImageView show some placeholder image at the outset, so while
the download is happening, the user sees something, which then gets
replaced by the real image once it is downloaded.

There's a lot more that an app should consider: caching, detecting
connectivity, doing something more with the exceptions than quietly
logging them, etc.

-- 
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.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] htc droid incredible

2010-05-02 Thread Simone
Just a couple of questions. If I buy the droid incredible, would I be
able to:
-use it in Italy
-run my applications on it
Thanks
Simone

-- 
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: Newb: Display URL Image

2010-05-02 Thread Jose Gomez
If you are just trying to make the ImageView display an image from a URL use
this function.

private Bitmap decodeImage(String url) {

 URL aURL;

 try {

 aURL = new URL(url);

 URLConnection conn = aURL.openConnection();

 conn.connect();

 InputStream is = conn.getInputStream();

 BufferedInputStream bis = new BufferedInputStream(is);

 Bitmap bm = BitmapFactory.decodeStream(bis);

 bis.close();

 is.close();

 return bm;

 } catch (MalformedURLException e) {

 e.printStackTrace();

 } catch (IOException e) {

 e.printStackTrace();

 }

 return null;

 }
}


call the function as
imgView.setImageBitmap(decodeImage("http://sss.jpg";));

Sincerely
Jose C Gomez

http://www.josecgomez.com


On Sat, May 1, 2010 at 12:20 PM, Mark Murphy wrote:

> > On Apr 29, 6:13 pm, dylanh724  wrote:
> >> Hello:
> >>
> >> All I want to do is display a URL image.
>
> What is "display a URL image"?
>
> >> Does anyone have a template I
> >> could use that already displays an image that I can possibly modify?
>
> Where and how are you trying to display an image? As a single image in a
> widget-based layout? As an image in a row of a ListView? As part of
> drawing on a Canvas for a 2D game? As part of rendering an OpenGL 3D
> animation? As an image on a Web page in an HTML5 application? Something
> else?
>
> >> I've been looking all over the internet and the only answers I've
> >> found are extremely complex.
>
> That is because doing it properly can be complex, depending on how you
> are using it. For example, putting thumbnails in a ListView can be a
> substantial amount of code, to handle downloading in the background,
> displaying the images in the list once they are downloaded, managing a
> cache so if you have 10,000 rows in the list you don't try downloading
> and holding onto 10,000 images, etc.
>
> The more you can explain about where and how you are trying to "display
> a URL image", the better people can help you with your questions.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> Android 2.x Programming Books: http://commonsware.com/books
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

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

[android-developers] resized window for clicking other window app

2010-05-02 Thread sleith
Hi, i want to ask is it possible to launch activity in resized window,
so that we can still see behind activity screen, and we can click the
behind activity screen button or something?
(interact with behind activity screen)

Thanks

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


Re: [android-developers] Re: Android ANT compilation

2010-05-02 Thread Leigh McRae


I laughed when I read your first line.  Fair enough on your part but you 
need to balance how much time you spend with making the most elegant, 
portable, manageable etc and just getting it done.



On 5/1/2010 9:56 PM, Bob Kerns wrote:

I stop just short of being dogmatic about #1! That is, I stop short of
saying "you're wrong!" -- but I do urge you (and others) to think long
and hard about it -- and be open to the possibility that later thought
an experience may show a better way. That's been my experience, and my
experience is pretty broad and deep -- but not universal.

Generally, I find that the run-time decisions involved can be made
once, in a compatibility module, at a trivial cost. This also avoids
polluting your code with lots of conditionalizations -- a problem for
either runtime or preprocessor-time conditionalization.

If there are key pieces that simply must have a pre-computed
expression, and you can't afford a method call (benchmark, don't
assume!), then I would go for limited code generation. Code generation
can do everything that preprocessing can do -- but it has more clearly
defined scope and effects. Actually, it's a much more powerful
technique.

My technique for building multiple app versions from a single Android
Eclipse project does involve something you might term preprocessing,
kind of. The one java file which gets massaged is R.java, which gets
the package changed. So you could consider that post processing a
generated file! But that's just because I don't have control over the
generator -- and I think I may have a solution. If so, that'll be one
more instance of the pattern -- you think you need a preprocessor, but
eventually, you figure out there's a better way.

Re #3 -- it's possible to set up one Eclipse project to use Java code
from another. However, I'm really hesitant to even try to explain it,
since there are variants and even I find it confusing -- and then you
have to make it compatible with your non-IDE build. So generally do it
with ant, like it sounds like you're about to do. Just to be sure to
properly set the the ant build task up properly, telling it what
sources should trigger the build and what outputs to refresh. If you
do that, then everything will be rebuilt properly, and you won't have
to rebuild excessively.

Re #4 -- yes, mostly it's user config, a list of projects, various
cached data, etc. etc. There are some settings that may affect the
building of the project -- these are mostly defaults, that can be set
per-project. It's good practice to do that -- except then if you have
a lot of projects that work together, then you have the problem of
coordinating changes in the project settings. An example would be Java
language version settings, or enabling/disabling compiler warnings.

I sympathize with the difficult transition. I've been using the Emacs
command set since before it was Emacs (and was written in ITS Teco),
and it was a long time before I found IDEs to add sufficient value to
be worth it.  That's one reason I was never a heavy NetBeans user
(though NetBeans has progressed since then as well).

But Eclipse really does bring a lot of value to Java programming, with
its deeper understanding of the code. You'll find its support for
other programming languages to be disappointing -- C++ for example. In
part, that's because C++ syntax and semantics are just too
complicated, and then you have the preprocessor...but there are better
tools for C++.

On May 1, 8:06 am, Leigh McRae  wrote:
   

Thank you for the well thought out response, I got some good tips out of it.

1) I just can't agree with this one and apparently Sun doesn't either as
they added the preprocessor support.  The thing is that for a j2se
project you could use interfaces and other run-time solutions and throw
more hardware at it.  For a phone you are already hardware limited and
don't want to pay for anything at run-time that can be determined at
compile time.

2) Great. I will have to invest more time looking into this.

3) Score again.  This wasn't an editing outside of Eclipse problem.  The
problem is with two Eclipse projects sharing some common code. I edit it
in one project and the other one doesn't get refreshed even if it's
opened in the same workspace.  So thanks for the tip as this will help.  
Still I wish I could put all my code in one tree and make a BlackBerry

project and Android project that just filters parts of the code.  I
looked into this was unable to grok the help/examples for this.

4) I never even considered that a project could be outside of a
workspace.  Cool. I will try that.  It's all the .metadata stuff that I
was at odds with. So it's per user config and nothing to do with the
project?

Being an ex Emacs user that decided to just start using what everyone
else uses, I am very open to Eclipse but it's been a hard one to swallow
:)  Thanks for some good tips to make it more palatable

Leigh

On 5/1/2010 12:40 AM, Bob Kerns wrote:



 

Sigh, Google Grou

[android-developers] Activity Not coming to foreground

2010-05-02 Thread mike
hi guys,

i'm getting the outgoing number using BroadCastReceiver and then
starts a Activity.
but my activity runs in the background???  how can i bring it to
foreground??

public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
this.context = context;
// this.inten = intent;
// String s = intent.getAction();

if (intent.getAction()

.equalsIgnoreCase(Intent.ACTION_NEW_OUTGOING_CALL)) {
phonenbr = 
intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
intent = new Intent(context, OutGoing.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra("Number", phonenbr);
context.startActivity(intent);
} else {
telManager = (TelephonyManager) context

.getSystemService(Context.TELEPHONY_SERVICE);
telManager.listen(new StateListener(),
PhoneStateListener.LISTEN_CALL_STATE);
}
}


regards,
Rrandika

-- 
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] resize options menu + get icons centered ?

2010-05-02 Thread Mark Murphy
didi.yeah wrote:
> Hi,
> 
> I created a basic options menu, here an example of creating an element
> of me menu :
> 
> menu.add(0, MENU_BACKWARD, 0, "").setIcon(R.drawable.btn_backward);
> 
> As you can see I don't want to show any text in this menu, just an
> icon !
> But when the menu is showed, there is a "ugly" blank under the icon
> (the text is supposed to be there)
> and I want to avoid this.
> A least if it's possible to center the icon the options menus, it will
> be great.

You will need to write your own logic to intercept the MENU keypress and
display something of your own design. Option menus have captions. Sorry!

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

_Beginning Android 2_ from Apress Now Available!

-- 
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] resize options menu + get icons centered ?

2010-05-02 Thread didi.yeah
Hi,

I created a basic options menu, here an example of creating an element
of me menu :

menu.add(0, MENU_BACKWARD, 0, "").setIcon(R.drawable.btn_backward);

As you can see I don't want to show any text in this menu, just an
icon !
But when the menu is showed, there is a "ugly" blank under the icon
(the text is supposed to be there)
and I want to avoid this.
A least if it's possible to center the icon the options menus, it will
be great.

Thanks,
didi

-- 
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] Retrieve Current Dialing Number

2010-05-02 Thread mike
hi guys,

currently i'm always getting the previously dialed number. but what i
need is current dialed number.

this is my code the method to retrieve number is quoted from a another
developer who helped me but it always gives the previous number. need
help urgently

public class CallListener extends BroadcastReceiver {
private Context context;
// Intent inten = null;
String phonenbr;

@Override
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
this.context = context;
TelephonyManager telManager = (TelephonyManager)
context
.getSystemService(Context.TELEPHONY_SERVICE);
telManager.listen(new StateListener(),
PhoneStateListener.LISTEN_CALL_STATE);

}

class StateListener extends PhoneStateListener {
@Override
public void onCallStateChanged(int state, String
incomingNumber) {
// TODO Auto-generated method stub
// super.onCallStateChanged(state,
incomingNumber);
switch (state) {
case TelephonyManager.CALL_STATE_RINGING:
Log.d("DEBUG", "RINGING");
break;
case TelephonyManager.CALL_STATE_IDLE:
//
BroadcastReceiver.this.clearAbortBroadcast();
//context.unregisterReceiver(this.);
System.exit(0);
break;
case TelephonyManager.CALL_STATE_OFFHOOK:
phonenbr =
getLastCallLogEntry(context);
break;
}
}
}

private String getLastCallLogEntry(Context context) {
String[] projection = new String[] { BaseColumns._ID,
CallLog.Calls.NUMBER,
CallLog.Calls.TYPE };
ContentResolver resolver =
context.getContentResolver();
Cursor cur = resolver.query(CallLog.Calls.CONTENT_URI,
projection,
null, null,
CallLog.Calls.DEFAULT_SORT_ORDER);
int numberColumn =
cur.getColumnIndex(CallLog.Calls.NUMBER);
int typeColumn =
cur.getColumnIndex(CallLog.Calls.TYPE);

if (!cur.moveToNext()) {
cur.close();
return "";
}
String number = cur.getString(numberColumn);
String type = cur.getString(typeColumn);
String dir = null;
try {
int dircode = Integer.parseInt(type);
switch (dircode) {
case CallLog.Calls.OUTGOING_TYPE:
dir = "OUTGOING";
break;

case CallLog.Calls.INCOMING_TYPE:
dir = "INCOMING";
break;

case CallLog.Calls.MISSED_TYPE:
dir = "MISSED";
break;
}
} catch (NumberFormatException ex) {
}
if (dir == null)
dir = "Unknown, code: " + type;
cur.close();
return number;

}

}
regards,
Mike

-- 
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] Change the playback rate of a track in real time

2010-05-02 Thread yakura y
Thanks Anurag,

I have fixed the error. At the end, I have used an implementation with
AudioTrack. It seems to be ideal for what I am trying to do, but I have
another question:

Is there any library out there that it allows to decode mp3/ogg to wav in
android in realtime? (not necessarily in realtime but it could be great). I
think I need to use the NDK but I would not like to have to manage with
that.

Thanks

2010/5/2 Anurag Singh 

> Hey, I just gone through with your code. You are not using
> public final void setRate (int streamID, float rate)Please take  care
> streamID is  different from soundID. streamID is the value returned by the
> play() function.
>
> - Anurag Singh
>
> On Sun, May 2, 2010 at 12:48 AM, Y Kim  wrote:
>
>> Hello everybody,
>>
>> I would like to know if somebody knows a library to changing the
>> playback rate of a track in real time. My idea is to load a track and
>> change its playback rate to half or double. Firstly, I tried with
>> MusicPlayer but is was not possible at all and then I tried with
>> SoundPool. The problem is that with SoundPool I can´t change the rate
>> once the track is loaded. Here is the code I am using (proof of
>> concept):
>>
>>float j = 1;
>>
>>@Override
>>public void onCreate(Bundle savedInstanceState) {
>>super.onCreate(savedInstanceState);
>>setContentView(R.layout.main);
>>
>>Button b = (Button)findViewById(R.id.Button01);
>>b.setOnClickListener(new OnClickListener() {
>>
>>@Override
>>public void onClick(View v) {
>>j = (float) (j +.5);
>>
>>}
>>});
>>
>>AssetFileDescriptor afd;
>>try {
>>
>>SoundPool sp = new SoundPool(1, AudioManager.STREAM_MUSIC,
>> 0);
>>
>>afd = getAssets().openFd("wav/sample.wav");
>>int id = sp.load(afd, 1);
>>sp.play(id, 1, 1, 1, 0, j);
>>
>>} catch (IOException e) {
>>// TODO Auto-generated catch block
>>e.printStackTrace();
>>}
>>}
>>
>> When I press the button, the playback rate should increase but it does
>> not happen. Any idea of how change the rate in real time?
>>
>> 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
>>
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

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

[android-developers] Tab control in "News and weather" app (N1)?

2010-05-02 Thread Ilya Shinkarenko
hi all,

does anybody know if the tab control used in the "News and weather"
app (preinstalled on Nexus One) is a standard one and what is the name
of if?

thanks
ilya

-- 
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] Porting to Android Development Phones

2010-05-02 Thread arikh
Hello,

Where can I get the Eclair source tree for G1? G2?


Thanks,
Arik Halperin

-- 
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: Market shows: "Localized to: unknown" - issue 5930 is still not fixed?

2010-05-02 Thread Evgeny V
Yes. I have res/values.



2010/5/2 Konstantin Vasilyev 

> We know it works, e.g.
>
> http://www.cyrket.com/p/android/org.kman.WifiManager/
>
> (and countless others)
>
> Do you have a res/values, too (non-localized)?
>
> If not, can you try creating it?
>
> -- Kostya
>
> Evgeny V  писал(а) в своём письме Sat, 01 May 2010
> 23:59:55 +0400:
>
>   Unfortunately the suggested solution doesn't solving the problem:(
>>
>> 2010/5/1 Evgeny V 
>>
>>   I thought that it can be a problem but stil din't try.
>>> Thanks a lot!
>>>
>>> 2010/5/1 Konstantin Vasilyev 
>>>
>>> Hi,
>>>

 Have you tried using two-letter locale codes?

 res/values-fr
 res/values-es
 res/values-ru

 -- Kostya


 Evgeny V  писал(а) в своём письме Sat, 01 May 2010
 12:45:25 +0400:


 Hi all,

>
> Any updates for this issue?
>
> When I've published my update it's not appeared as "Just in" in Market.
> May the unknown localization cause such problem?
>
> Thanks,
> Evgeny
>
> On Sat, Apr 24, 2010 at 11:41 PM, EvgenyV  wrote:
>
> Hi all!
>
>>
>> I've just uploaded my application supports many languages. Android
>> Market shows "Localized to: unknown".
>> I have res\values-fr-rFR, res\values-es-rES, res\values-ru-rRU etc.
>> localized folders.
>>
>> Found that same issue has reported as issue 5930 but didn't find any
>> responses.
>>
>> Any ideas?
>>
>> Thanks in advance,
>> Evgeny
>>
>>
>
>
 --
 Написано в почтовом клиенте браузера Opera: http://www.opera.com/mail/

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

>>>
>>>
>>>
>>>
>>
>
> --
> Написано в почтовом клиенте браузера Opera: http://www.opera.com/mail/
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

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

[android-developers] Re: Maximum Texture Units

2010-05-02 Thread Robert Green
I remember reading that the MSM7200-based phones have 8mb of VRAM and
so I have to imagine that you could count on at least that much for
the better GPUs.

What's weird though is that I keep finding things talking about how
the PowerVR SGX530 has 2MB of VRAM which seems awfully low - unless
that's a texture cache and there is a larger chunk of VRAM that is
implementation-specific.  I don't know..

I couldn't find any info on the QS8250 (snapdragon 1ghz) VRAM.

So far I've never run out of vram on any device and I'm loading quite
a bit in on some games.

Antigen uses:
256x512 32 bit for story start text atlas
256x512 32 bit for main text atlas
256x512 32 bit for level bg front
512x512 16 bit for level bg back
5 256x256 32 bit for characters, shading and faces
7 64x64 32 bit for items
several for the HUD
and many other smaller ones for glow, particles, etc..

My new 3D game uses (all mipmapped so add 33% more size on):
1024x1024 16 bit for main level texture
512x512 16 bit for level lightmap
4x 512x512 16 bit for characters
3x 256x256 16 bit for weapons
256x512 32 bit for text atlas
about 512K-1MB of geometry VBOs
256x256 32 bit for HUD graphics
Many smaller 32 bit ones for projectiles and other small things

So really there seems to be ample room there.  Both of those scenarios
load fine on a G1.

If you want to write an easy test, write a loop that loads up a 512 32
bit (1MB) texture into VRAM and keep count of how many times it works
until gl.glGetError() returns the out of memory error after
glTexImage2D.  I'd be curious as to what your results are.


On May 2, 1:06 am, Jeremiah Sellars  wrote:
> This may be just another silly question then, but after doing quite a
> few searches about different phones... I'm finding the amount of
> general RAM but not VRAM. Does anyone know this spec for newer phones?
> I'm developing with Droid or better phones in mind...
>
> On May 1, 6:02 am, Mario Zechner  wrote:
>
>
>
>
>
> > gentextures only creates handles for you. Actual memory for the bitmap
> > data is allocated when calling glteximage2D. That will be your biggest
> > limitation as video ram is of course limited. How much vram is
> > available is dependent on the chipset/device you are running your
> > application on.
>
> > On 1 Mai, 00:59, Jeremiah Sellars  wrote:
>
> > > Oh, geez... okay that explains it. Thanks to both of you, that really
> > > explains it well. Is there then a limit on the number of textures
> > > GenTextures can return?
>
> > > On Apr 30, 3:39 pm, Robert Green  wrote:
>
> > > > Yeah multiple texture units are only needed for multitexturing, of
> > > > which the most common use is for lightmapping.
>
> > > > On Apr 30, 4:57 pm, Mario Zechner  wrote:
>
> > > > > The number of texture units and the maximum texture size are not
> > > > > really related in any way. The number of texture units tells you how
> > > > > many textures you can use simultaniously when drawing geometry (how
> > > > > many textures can be bound at once). You can have more textures in
> > > > > video ram than there are texture units, however, you can only bind
> > > > > #texture units textures at any time. A maximum of 2 texture units is
> > > > > sufficient for most scenarios where you have a diffuse texture and a
> > > > > lightmap for example.
>
> > > > > The maximum texture size is really just an estimate with most drivers
> > > > > and depends on things such as internal storage (which might be fixed
> > > > > by the driver anyways) and so on.
>
> > > > > In any case, both numbers will differ from device to device or rather
> > > > > chipset to chipset.
>
> > > > > On 30 Apr., 23:19, Jeremiah Sellars  wrote:
>
> > > > > > I'm wondering if this is just an issue with how the emulator is 
> > > > > > setup,
> > > > > > but I'm not sure.
>
> > > > > > I'm (natively) calling this:
>
> > > > > > int maxt = 0;
>
> > > > > > glGetIntegerv(GL_MAX_TEXTURE_UNITS, &maxt);
>
> > > > > > __android_log_print(ANDROID_LOG_VERBOSE, "Native", "Max textures 
> > > > > > %d",
> > > > > > maxt);
>
> > > > > > This only outputs 2... could it be possible that I'm going to be
> > > > > > allowed only 2 textures? That seems impossible...
>
> > > > > > GL_MAX_TEXTURE_SIZE reports 4096 which is more than enough. I 
> > > > > > suppose
> > > > > > you could lay everything out on a couple of 4096x 4096 images 
> > > > > > (seems a
> > > > > > bit crazy) but anyway...
>
> > > > > > Am I just running into one of things that will be different per 
> > > > > > phone
> > > > > > processor?
>
> > > > > > Thanks everyone,
> > > > > > Jeremiah
>
> > > > > > --
> > > > > > 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 
> > > > > 

Re: [android-developers] BroadcastReceiver, Intent objects

2010-05-02 Thread Anurag Singh
Yeah, there's no fucntion available in intent class. But you can putExtra
putExtra
(String  name,
long value) to
recongnize any known scenario. On the other end use getExtra to get the same
value.

There are so many similar function described in intent class, you can try
according to your need.

- Anurag Singh

On Sun, May 2, 2010 at 11:28 AM, Sean Sullivan wrote:

>
> I've implemented a BroadcastReceiver class to receive Intent objects.
>
> In my BroadcastReceiver class, I'd like to be able to identify the
> source (sender) of the Intent object.  Is there an API that enables me
> to do this?
>
> I've already read through the javadocs and the Android platform source
> code but didn't find an answer.
>
> Thank in advance.
>
> Sean
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

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

[android-developers] Re: vibrator and emulator

2010-05-02 Thread Simone
Ohhh ok thanks, at least I know now ;)
Simone

On 2 Mag, 06:32, David Turner  wrote:
> The emulator simply doesn't support vibrator emulation at this point, sorry.
>
>
>
> On Sat, May 1, 2010 at 9:54 PM, Simone  wrote:
> > I have a simple problem: I make a simple call to Vibrator.vibrate(long
> > time);, but in the logcat I don't see anything related to it. How can
> > I test if the vibration works using the emulator?
> > Thanks
> > Simone
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group 
> 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