[android-developers] Re: Miracast?

2012-11-08 Thread HeHe
i wonder if any mobile android device can sustain 2 hours of miracasting 
its screen on which a movie is played without draining its battery, because 
it involves mpeg/h264 decoding first, capturing screen shots at min 30fps, 
encoding the screen shots to h264 bitstreams, muxing the bitstreams in TS 
and p2p sending the TS packets via RTP.

has anyone tried it?

On Wednesday, November 7, 2012 8:59:30 AM UTC-8, Robert Hattan wrote:

 I would recommend Google better advertise Miracast capability with Android 
 4.2.  It hasn't been explained very well to consumers and if existing 
 hardware is upgraded to Android 4.2 will it support Miracast.  Similar to 
 listing phones on Android.com, it would be nice to see a list of Miracast 
 supported TVs, etc.  Even more exciting would be the ability to share an 
 Android 4.2 phone with an Android tablet as a future feature.

-- 
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: Audio Record problem (urgent)

2010-09-20 Thread HeHe
you should also show logcat output.

On Sep 20, 5:35 am, melo fredchou0...@gmail.com wrote:
 Hi all
 I'm an android starter
 I used MediaRecorder and MediaPlayer to record voice via mic before
 This time,I try AudioRecord and  AudioTrack to record voice
 But when I try to start, it's forced to be shut down
 I've no idea where is wrong?
 here are my code ~
 Could any one tell me why?
 TKS in advance :)

 public class audioRecorderTest2 extends Activity
 {

         boolean isRecording = true;

         private static final String Tag = audioRecorder;
         private static final boolean log = true;

         Button recordButton;
         Button stopButton;

         OnClickListener record_listener = null;
         OnClickListener stop_listener = null;

         int frequency = 8000;
         int channelConfiguration = AudioFormat.CHANNEL_CONFIGURATION_MONO;
         int audioEncoding = AudioFormat.ENCODING_PCM_16BIT;

         protected static final int MENU_ABOUT = Menu.FIRST;
         protected static final int MENU_Quit = Menu.FIRST + 1;

     /** Called when the activity is first created. */
     @Override
     public void onCreate(Bundle savedInstanceState)
     {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.main);
         initResourceRefs();

         setTitle(Audio recorder test...);

         record_listener = new OnClickListener()
             {
                 @Override
                 public void onClick(View arg0)
                 {
                         AudioManager am =
 (AudioManager)getSystemService(Context.AUDIO_SERVICE);

                         //int actualBufferSize = 4096*8;

                         int bufferSize =
 AudioTrack.getMinBufferSize(frequency,channelConfiguration,audioEncoding);

                         int actualBufferSize = bufferSize;//4096*8

                         AudioTrack audioTrack = new
 AudioTrack(AudioManager.STREAM_MUSIC,
                                                                        
 frequency,
                                                                        
 channelConfiguration,
                                                                audioEncoding,
                                                                
 actualBufferSize,

 AudioTrack.MODE_STREAM);

                         byte[] buffer = new byte[actualBufferSize];

                         AudioRecord audioRecord = new
 AudioRecord(MediaRecorder.AudioSource.MIC,
                                                                           
 frequency,
                                                                           
 channelConfiguration,
                                                                           
 audioEncoding,
                                                                   
 actualBufferSize);

                         am.setRouting(AudioManager.MODE_NORMAL,
                                       AudioManager.ROUTE_EARPIECE,
                                       AudioManager.ROUTE_ALL);

                         am.setSpeakerphoneOn(true);
                         am.setMicrophoneMute(false);

                         Log.d(Tag,Is speakerphone on? :  + 
 am.isSpeakerphoneOn());

                         audioTrack.setPlaybackRate(frequency);
                         audioRecord.startRecording();
                         audioTrack.play();

                         int frameSize = bufferSize;//320

                         while(isRecording == true)
                         {
                           try{
                                 int bufferReadResult = 
 audioRecord.read(buffer,
 0,frameSize);

                                 if(bufferReadResult == 
 AudioRecord.ERROR_INVALID_OPERATION)
                                         
 if(log)Log.d(Tag,record.read:ERROR_INVALID_OPERATION
 returned);

                                 else if(bufferReadResult == 
 AudioRecord.ERROR_BAD_VALUE)
                                 if(log)Log.d(Tag,record.read:ERROR_BAD_VALUE
 returned);

                                 else if(bufferReadResult != frameSize)
                                         
 if(log)Log.d(Tag,record.read:Requested  + frameSize +
                                                          bytes but read + 
 bufferReadResult + bytes);

                             else audioTrack.write(buffer,0,buffer.length);
                           }catch(Exception e)
                           {if(log)Log.e(Tag,ERROR:  + e.toString());}
                         }

                         audioRecord.stop();
                         audioTrack.stop();
                         audioRecord.release();
                         audioTrack.release();
                 }
             };//record_listener

             stop_listener = new OnClickListener()
             {
                 @Override
                 public void onClick(View arg0)
                 {
                         isRecording = 

[android-developers] Re: auto switching the tab being viewed

2010-09-08 Thread HeHe
why googling? you seemed to have answered to your own question, didn't
you?

On Sep 8, 1:19 pm, Mike Adams adams...@gmail.com wrote:
 I sent this yesterday but it must have got lost in moderation, as i've
 scanned the posts carefully and not seen my post, so resending.

 I've been googleing this but no luck so far. I have a tabbedactivity with
 three tabs. each tab represents an activity, and they are nested classes of
 the main tabbed activity class.   One of my activities has a thread that
 runs and gets messages from the telnet thread via a queue. Without going
 into that to much essentially the issue is sometimes the board activity
 realizes a game has started and creates a new board, but the person may not
 be viewing the board tab, he may be in the console tab reading new chat
 messages, and what I'm trying to do is switch him to the board tab when a
 game starts. See he can send a request for a game and be waiting for someone
 to respond, and be watching the new chat in the console view rather than
 being in his board view, but ideally i want to switch him to the board
 activity/tab on new game.

 Since the board tab has a thread running, maybe there is just a line of code
 i can stick into a handler ( using a handler since the thread cant touch the
 UI itself ) that brings that activity, tab to the front or selected.

 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


[android-developers] Re: auto switching the tab being viewed

2010-09-08 Thread HeHe
your closing statement ...i can stick into a handler ( using a
handler since the thread cant touch the
UI itself ) that brings that activity, tab to the front or selected.
seems to me the answer.

that is, put a handler in the realizing activity to periodically
realize something has happened. then call TabHost.setCurrentTab() to
automatize tab switching. (prepare to handle onPause and onResume)

i feel it should work.


On Sep 8, 4:52 pm, Mike Adams adams...@gmail.com wrote:
 No i haven't answered it at all. the question is how when a thread in one
 activity realizes something has happened, make the application swith to that
 tab, as if the users had placed their finger on that tab. but i want it
 automatic. I do not know how to do this. I do not have an answer to this. I
 have searched for how to do it.

 Mike



 On Wed, Sep 8, 2010 at 4:30 PM, HeHe cnm...@gmail.com wrote:
  why googling? you seemed to have answered to your own question, didn't
  you?

  On Sep 8, 1:19 pm, Mike Adams adams...@gmail.com wrote:
   I sent this yesterday but it must have got lost in moderation, as i've
   scanned the posts carefully and not seen my post, so resending.

   I've been googleing this but no luck so far. I have a tabbedactivity with
   three tabs. each tab represents an activity, and they are nested classes
  of
   the main tabbed activity class.   One of my activities has a thread that
   runs and gets messages from the telnet thread via a queue. Without going
   into that to much essentially the issue is sometimes the board activity
   realizes a game has started and creates a new board, but the person may
  not
   be viewing the board tab, he may be in the console tab reading new chat
   messages, and what I'm trying to do is switch him to the board tab when a
   game starts. See he can send a request for a game and be waiting for
  someone
   to respond, and be watching the new chat in the console view rather than
   being in his board view, but ideally i want to switch him to the board
   activity/tab on new game.

   Since the board tab has a thread running, maybe there is just a line of
  code
   i can stick into a handler ( using a handler since the thread cant touch
  the
   UI itself ) that brings that activity, tab to the front or selected.

   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.comandroid-developers%2Bunsubs 
  cr...@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: Maps with directions.

2010-09-07 Thread HeHe
you might like to try

Location src,dst;
//...set src/dst locations

String uri=String.format(http://maps.google.com/maps?f=dsaddr=%f,
%fdaddr=%f,%fhl=en
,src.getLatitude(),src.getLongitude()
,dst.getLatitude(),dst.getLongitude());

startActivity(new 
Intent(Intent.ACTION_VIEW,Uri.parse(uri)));



On Sep 7, 9:45 am, tatebn brandonnt...@gmail.com wrote:
 Is it possibly to have a button in my app that switches to the phone's
 Maps application while passing in a destination for directions?  And
 how would I do that?  Haven't been able to find anything about it.

 Thanks

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


[android-developers] Re: obtainBuffer timed out in AudioTrack.write()

2010-09-02 Thread HeHe
as the log hints, it is likely that your app pegs cpu for too long or
your app causes GCs which may also peg cpu.

On Sep 1, 1:11 pm, sasq jonas.minnb...@gmail.com wrote:
 Don't know why I bother asking here but, you never know, right?

 Anyway - after stopping and restarting playback of an audiotrack
 stream, on some devices I consistently get;

 W/AudioTrack( 2453): obtainBuffer timed out (is the CPU pegged?)
 0x64acc0 user=0001, server=

 after freezing for a couple of seconds. This happens whether I just
 pause() and flush() my audiotrack or release() and recreate it.

 Anyway to avoid 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: obtainBuffer timed out in AudioTrack.write()

2010-09-02 Thread HeHe
as the log hints, it is likely that your app pegs cpu for too long or
your app causes GCs which may also peg cpu.


On Sep 1, 1:11 pm, sasq jonas.minnb...@gmail.com wrote:
 Don't know why I bother asking here but, you never know, right?

 Anyway - after stopping and restarting playback of an audiotrack
 stream, on some devices I consistently get;

 W/AudioTrack( 2453): obtainBuffer timed out (is the CPU pegged?)
 0x64acc0 user=0001, server=

 after freezing for a couple of seconds. This happens whether I just
 pause() and flush() my audiotrack or release() and recreate it.

 Anyway to avoid 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: creating a WebView in the top of a view

2010-08-02 Thread HeHe
i guess you need to capture BACK key events and hide WebView
accordingly.

On Aug 2, 1:56 pm, guich guiha...@gmail.com wrote:
 Hi,

 I'm trying to do a fairly simple thing but i'm failing since 3 hours.

 I have a WebView that i show with some pictures and html stored in
 local sdcard. After the user clicks a button in my app, i want to show
 the webview, and when he press the back button, i want to return to
 the previous view (which is my main app view).

 Can someone tell me how to do it? I tried this:

          WebView webview = new WebView(this);
          setContentView(webview);
          webview.loadUrl(url);

 However, when i press back, my app quits.

 thanks in advance,

    guich

-- 
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: Udp +Tcp connection in Android

2010-07-17 Thread HeHe
finally i understood xuxu's question, did i?

On Jul 17, 8:28 am, Carlos Silva r3...@r3pek.org wrote:
 On Sat, Jul 17, 2010 at 11:40, Indicator Veritatis mej1...@yahoo.comwrote:

  Actually, it is possible, but it would require custom code for both
  server and client dropping the UDP connection and starting up a
  corresponding TCP connection on agreed upon ports -- but why? The
  request sounds like it can only be based on a misunderstanding; not
  just of Android, but of network protocols.

 From the first post, I thought he wanted to convert a UDP socket to a TCP
 socket, reusing it, and that's not possible.

 If he wants to have both, just open to socket connections, one TCP and other
 UDP and send/recevie whenever he wants/needs.

-- 
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: Compile Sip Stack

2010-07-07 Thread HeHe
imho, movng sip-related objects over jni should be fine in most of
case, because they are just signaling stuff, are sparse and usually
small in size (compared to media packets).

On Jul 7, 7:56 am, Fred Grott(Android Expert, 
http://mobilebytes.wordpress.com)
fred.gr...@gmail.com wrote:
 You would not use C/C++ for the sip stack for obvious reasons of cost
 of moving objects over the JNI

 On Jul 7, 9:40 am, André Barbosa afilipebarb...@gmail.com wrote:



  hi,
  anyone could compile some SIP Stack in C/C++ along with Android source
  code?

  Note: i am referring not to compile the Sip Stack with ndk, but
  compile with all the code of the Android plataform.

  best Regards.

-- 
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: Geocoder not working on emulator

2010-07-07 Thread HeHe
afaik, from ddmsemulator control panel, you may feed any gps data
that is resolvable to human-readable address so that you can test your
app.

On Jul 4, 9:50 pm, pranay streetfi...@gmail.com wrote:
 hi, i am trying to run the example as given in the book Professional
 Android  Development by Reto Meier[pg 220], but i am not able to get
 the address string i always get No address . I read about the same
 prob in this forum, and i tried it in api level 7 but in both 7 and 8
 api levels , i am getting the same output, i.e. No address.
 Also can anyone please tell me that here i have to manually supply the
 lat and longitude , so it is it possible that to get them
 automatically?

-- 
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: TCP IP connection via Mobile Network

2010-07-02 Thread HeHe
as a poor man who cannot afford a piece of cloud Amazon/EC2 or even
just one high-end $50k router that indeed can well handle 64k
simultaneous persistent tcp connections, udp seems the only choice to
serve a million of users.

also, afaik, for rtp apps that demand low latency, udp seems far
superior to tcp.

On Jul 1, 11:51 pm, Bob Kerns r...@acm.org wrote:
 Not necessarily. If you need what amounts logically to a reliable
 connection, simulating it yourself with UDP may not help your
 scalability, unless you're bpassing a flawed kernel implementation.

 I can think of a few high traffic sites that use TCP connections
 exclusively, scaled up beyond your or my wildest dreams.

 On Jul 1, 5:52 pm, HeHe cnm...@gmail.com wrote:



  if the statement I concluded that this is not allowed when using a
  non LAN connection. were true, all RTP apps would fail on 3G
  networks. but most if not all of them seem working well.

  meanwhile, servers requiring *persistent tcp connections* may have
  scalability issue.

  On Jul 1, 3:18 pm, Miguel Morales therevolti...@gmail.com wrote:

   I was never able to receive udp packets from my server onto my phone
   that's connected a 3G network.
   I concluded that this is not allowed when using a non LAN connection.
   Phone to phone TCP works from what I've heard, but frankly I don't see
   the advantages unless your game REALLY needs it.

   What works for me is of course having all players communicate via a
   common server and try to have the latency as low as possible.

   There was a thread about this where I gave my two cents and
   experience.  I use a combination of perl, erlang/rabbitmq, and java.
   You can find the thread 
   here:http://groups.google.com/group/android-developers/browse_thread/threa..

   Miguel.

   On Thu, Jul 1, 2010 at 9:40 AM, HeHe cnm...@gmail.com wrote:
i would suggest that you try udp with your app because, against the
same well-designed nat, often a very good tcp hole punch technique
has a much higher failure rate than a fair udp one.

On Jul 1, 8:44 am, WuffIT Tech wuffi...@gmail.com wrote:
I understand that the IP is subject to change but that is not my
concern.  If a connection is dropped, I can always send the other
phone my IP address and reconnect.  I have come to the conclusion that
there is not a way to do this without actually using a third party
server.  My question now is how should I implement this server.  Any
good server examples out there that is similar to what I need?  My
overall objective is to have a server that will route a message from
one phone to another like an IM program.

On Jun 15, 5:47 am, Matthew Powers mtpow...@gmail.com wrote:

 I would worry about your IP address changing as you move in and out 
 of
 different networks, your IP address is not constant

 On Thu, Jun 10, 2010 at 2:40 PM, WuffIT Tech wuffi...@gmail.com 
 wrote:
  Hi,

  I am new to this forum and I would like to throw out this question 
  and
  hopefully someone can point me in the right direction. I am 
  developing
  an Android application and I would like to setup a tcp/ip type of
  connection between two Android phones using the 3G/Edge network. My
  test version will establish a connection if I have both phones on a
  lan using wifi but when I use T-Mobile's network a connection is 
  not
  established. Could this issue be a port or ip address? 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.comandroid-developers%2Bunsubs
   cr...@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

   --http://developingthedream.blogspot.com/,http://diastrofunk.com,http:/...,
~Isaiah 55:8-9

-- 
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: Deploy App on Google Android G1 Phone

2010-07-02 Thread HeHe
is your LAN is behind nat?

On Jul 2, 7:22 am, Lamia Hannoun lamia.hann...@gmail.com wrote:
 Hi !

 I actually want to deploy my app on a real phone after deploying it on a an
 emulator.the problem is that i access to a web service (.net) hosted on my
 machine , i used the address 10.0.2.2 to test it on emulator and everythg
 went well, when i install my app on my htc i couldn't access to my web
 service, i tried to change the address by using a real machine IP connected
 to a LAN but it didn't work!!!

 Do u have any ideas to solve that issue.

 Thank you.

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


[android-developers] Re: TCP IP connection via Mobile Network

2010-07-01 Thread HeHe
i would suggest that you try udp with your app because, against the
same well-designed nat, often a very good tcp hole punch technique
has a much higher failure rate than a fair udp one.

On Jul 1, 8:44 am, WuffIT Tech wuffi...@gmail.com wrote:
 I understand that the IP is subject to change but that is not my
 concern.  If a connection is dropped, I can always send the other
 phone my IP address and reconnect.  I have come to the conclusion that
 there is not a way to do this without actually using a third party
 server.  My question now is how should I implement this server.  Any
 good server examples out there that is similar to what I need?  My
 overall objective is to have a server that will route a message from
 one phone to another like an IM program.

 On Jun 15, 5:47 am, Matthew Powers mtpow...@gmail.com wrote:



  I would worry about your IP address changing as you move in and out of
  different networks, your IP address is not constant

  On Thu, Jun 10, 2010 at 2:40 PM, WuffIT Tech wuffi...@gmail.com wrote:
   Hi,

   I am new to this forum and I would like to throw out this question and
   hopefully someone can point me in the right direction. I am developing
   an Android application and I would like to setup a tcp/ip type of
   connection between two Android phones using the 3G/Edge network. My
   test version will establish a connection if I have both phones on a
   lan using wifi but when I use T-Mobile's network a connection is not
   established. Could this issue be a port or ip address? 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.comandroid-developers%2Bunsubs
cr...@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: TCP IP connection via Mobile Network

2010-07-01 Thread HeHe
if the statement I concluded that this is not allowed when using a
non LAN connection. were true, all RTP apps would fail on 3G
networks. but most if not all of them seem working well.

meanwhile, servers requiring *persistent tcp connections* may have
scalability issue.

On Jul 1, 3:18 pm, Miguel Morales therevolti...@gmail.com wrote:
 I was never able to receive udp packets from my server onto my phone
 that's connected a 3G network.
 I concluded that this is not allowed when using a non LAN connection.
 Phone to phone TCP works from what I've heard, but frankly I don't see
 the advantages unless your game REALLY needs it.

 What works for me is of course having all players communicate via a
 common server and try to have the latency as low as possible.

 There was a thread about this where I gave my two cents and
 experience.  I use a combination of perl, erlang/rabbitmq, and java.
 You can find the thread 
 here:http://groups.google.com/group/android-developers/browse_thread/threa...http://groups.google.com/group/android-developers/browse_thread/threa...

 Miguel.





 On Thu, Jul 1, 2010 at 9:40 AM, HeHe cnm...@gmail.com wrote:
  i would suggest that you try udp with your app because, against the
  same well-designed nat, often a very good tcp hole punch technique
  has a much higher failure rate than a fair udp one.

  On Jul 1, 8:44 am, WuffIT Tech wuffi...@gmail.com wrote:
  I understand that the IP is subject to change but that is not my
  concern.  If a connection is dropped, I can always send the other
  phone my IP address and reconnect.  I have come to the conclusion that
  there is not a way to do this without actually using a third party
  server.  My question now is how should I implement this server.  Any
  good server examples out there that is similar to what I need?  My
  overall objective is to have a server that will route a message from
  one phone to another like an IM program.

  On Jun 15, 5:47 am, Matthew Powers mtpow...@gmail.com wrote:

   I would worry about your IP address changing as you move in and out of
   different networks, your IP address is not constant

   On Thu, Jun 10, 2010 at 2:40 PM, WuffIT Tech wuffi...@gmail.com wrote:
Hi,

I am new to this forum and I would like to throw out this question and
hopefully someone can point me in the right direction. I am developing
an Android application and I would like to setup a tcp/ip type of
connection between two Android phones using the 3G/Edge network. My
test version will establish a connection if I have both phones on a
lan using wifi but when I use T-Mobile's network a connection is not
established. Could this issue be a port or ip address? 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.comandroid-developers%2Bunsubs
 cr...@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

 --http://developingthedream.blogspot.com/,http://diastrofunk.com,http://www.youtube.com/user/revoltingx,
  ~Isaiah 55:8-9

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


[android-developers] Re: How To Override the “Back ” button so it doesn’t Finish() my Activity?

2010-06-29 Thread HeHe
it seems that overrriding onKeyDown() method of your activity and
returning with a true value perhaps may serve your need.


On Jun 29, 8:42 am, draf...@gmail.com draf...@gmail.com wrote:
 I currently have an Activity that when it gets displayed a
 Notification will also get displayed in the Notification bar.

 This is so that when the User presses home and the Activity gets
 pushed to the background they can get back to the Activity via the
 Notification.

 The problem arises when a User presses the back button, my Activity
 gets destroyed but the Notification remains as I want the user to be
 able to press back but still be able to get to the Activity via the
 Notification. But when a USER tries this I get Null Pointers as its
 trying to start a new activity rather than bringing back the old one.

 So essentially I want the Back button to act the exact same as the
 Home button and here is how I have tried so far:

 ---

                         @Override
                         public boolean onKeyDown(int keyCode, KeyEvent event) 
  {
                             if 
 (Integer.parseInt(android.os.Build.VERSION.SDK)  5
                                      keyCode == KeyEvent.KEYCODE_BACK
                                      event.getRepeatCount() == 0) {
                                 Log.d(CDA, onKeyDown Called);
                                 onBackPressed();
                             }

                             return super.onKeyDown(keyCode, event);
                         }

                         public void onBackPressed() {
                                 Log.d(CDA, onBackPressed Called);
                         Intent setIntent = new Intent(Intent.ACTION_MAIN);
                         setIntent.addCategory(Intent.CATEGORY_HOME);
                         setIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                         startActivity(setIntent);

                             return;
                         }

 ---

 However the above code still seems to allow my Activity to be
 destroyed, How can I stop my Activity from being destroyed when the
 back button is pressed?

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


[android-developers] Re: Is runtime mapview defining possible? (rather then in main.xml)

2010-06-27 Thread HeHe
sorry it does not work for you. it is odd. all map views of my app are
dynamically created and inserted this way. i need to check if they are
ok with debug and release modes while i dont want to hardcode map key
in layout xml and manually modify xml whenever i switch my app between
two modes. anyway hope you find a way out soon.

On Jun 27, 7:21 am, Thomas Wrobel darkfl...@gmail.com wrote:
 Thanks, but no luck. I get the exact same error :-/

 On 26 June 2010 22:35, HeHe cnm...@gmail.com wrote:



  it should be possible. one way is to put a framelayout on xml and in
  activity do sxth like:

  mapview mview=new mapview(this,getString(R.string.mapkey));

  framelayout frame=(framelayout)findViewById(R.id.frame);

  bframe.addView(mview,0,new
  framelayout.layoutparams(FILL_PARENT,FILL_PARENT));

  On Jun 26, 12:52 pm, ThomasWrobel darkfl...@gmail.com wrote:
   I've been trying to use a mapView in my app, and have been following
   the tutorial;
 http://developer.android.com/resources/tutorials/views/hello-mapview

   However, I'd like to be able to generate the mapView at runtime, and
   assign it to a widget container. (rather then just having it as the
   route element in Main.xml as in the example).

   Is this possible?

   I tried just extending mapActivity as stated, and implementing the
   overrides.
   However, at the moment I'm getting this error;

   06-26 21:31:20.946: ERROR/AndroidRuntime(1845):
   java.lang.IllegalAccessError: Class ref in pre-verified class resolved
   to unexpected implementation
   06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
   dalvik.system.DexFile.defineClass(Native Method)
   06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
   dalvik.system.DexFile.loadClassBinaryName(DexFile.java:209)
   06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
   dalvik.system.PathClassLoader.findClass(PathClassLoader.java:203)
   06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
   java.lang.ClassLoader.loadClass(ClassLoader.java:573)
   06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
   java.lang.ClassLoader.loadClass(ClassLoader.java:532)
   06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
   android.app.Instrumentation.newActivity(Instrumentation.java:1021)
   06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
   android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
   2489)
   06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
   android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
   2621)
   06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
   android.app.ActivityThread.access$2200(ActivityThread.java:126)
   06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
   android.app.ActivityThread$H.handleMessage(ActivityThread.java:1932)
   06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
   android.os.Handler.dispatchMessage(Handler.java:99)
   06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
   android.os.Looper.loop(Looper.java:123)
   06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
   android.app.ActivityThread.main(ActivityThread.java:4595)
   06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
   java.lang.reflect.Method.invokeNative(Native Method)
   06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
   java.lang.reflect.Method.invoke(Method.java:521)
   06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
   com.android.internal.os.ZygoteInit
   $MethodAndArgsCaller.run(ZygoteInit.java:860)
   06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
   com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
   06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
   dalvik.system.NativeStart.main(Native Method)
   

   Which I think might be because theres no where in my code or xml at
   the moment that defines where the mapView actually goes.
   I can't figure out how to assign it. (in this case to a page in my
   tabHost)

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs 
  cr...@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: Is runtime mapview defining possible? (rather then in main.xml)

2010-06-26 Thread HeHe
it should be possible. one way is to put a framelayout on xml and in
activity do sxth like:

mapview mview=new mapview(this,getString(R.string.mapkey));

framelayout frame=(framelayout)findViewById(R.id.frame);

bframe.addView(mview,0,new
framelayout.layoutparams(FILL_PARENT,FILL_PARENT));


On Jun 26, 12:52 pm, ThomasWrobel darkfl...@gmail.com wrote:
 I've been trying to use a mapView in my app, and have been following
 the 
 tutorial;http://developer.android.com/resources/tutorials/views/hello-mapview

 However, I'd like to be able to generate the mapView at runtime, and
 assign it to a widget container. (rather then just having it as the
 route element in Main.xml as in the example).

 Is this possible?

 I tried just extending mapActivity as stated, and implementing the
 overrides.
 However, at the moment I'm getting this error;

 06-26 21:31:20.946: ERROR/AndroidRuntime(1845):
 java.lang.IllegalAccessError: Class ref in pre-verified class resolved
 to unexpected implementation
 06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
 dalvik.system.DexFile.defineClass(Native Method)
 06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
 dalvik.system.DexFile.loadClassBinaryName(DexFile.java:209)
 06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
 dalvik.system.PathClassLoader.findClass(PathClassLoader.java:203)
 06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
 java.lang.ClassLoader.loadClass(ClassLoader.java:573)
 06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
 java.lang.ClassLoader.loadClass(ClassLoader.java:532)
 06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
 android.app.Instrumentation.newActivity(Instrumentation.java:1021)
 06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
 2489)
 06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
 android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
 2621)
 06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
 android.app.ActivityThread.access$2200(ActivityThread.java:126)
 06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
 android.app.ActivityThread$H.handleMessage(ActivityThread.java:1932)
 06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
 android.os.Handler.dispatchMessage(Handler.java:99)
 06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
 android.os.Looper.loop(Looper.java:123)
 06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
 android.app.ActivityThread.main(ActivityThread.java:4595)
 06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
 java.lang.reflect.Method.invokeNative(Native Method)
 06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
 java.lang.reflect.Method.invoke(Method.java:521)
 06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
 com.android.internal.os.ZygoteInit
 $MethodAndArgsCaller.run(ZygoteInit.java:860)
 06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
 06-26 21:31:20.946: ERROR/AndroidRuntime(1845):     at
 dalvik.system.NativeStart.main(Native Method)
 

 Which I think might be because theres no where in my code or xml at
 the moment that defines where the mapView actually goes.
 I can't figure out how to assign it. (in this case to a page in my
 tabHost)

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


[android-developers] Re: How to on Gps in emulator

2010-06-23 Thread HeHe
DDMS perspective  Emulator Control  Location Control  Send

On Jun 23, 7:59 am, Sohan badaya sohan.bad...@gmail.com wrote:
 Hi,

 How to start Gps in emulator.

 Thanks

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


[android-developers] Re: button background image scaled down by default?

2010-06-09 Thread HeHe
i guess you could try android:scaleType attribute.

On Jun 9, 2:06 pm, Stanley Li junpin1...@gmail.com wrote:
 Hi all,

 I try to make a button with a background image. However, the background
 image is scaled down.

 In my xml code, I have:

 Button
 android:id=@+id/start_game_button
 android:layout_width=480px
 android:layout_height=wrap_content
 android:text=@string/Start_Game
 android:textSize=25dip
 android:layout_gravity=center_horizontal
 android:background=@drawable/startgame_button
 /

 The background image is 400X100. However, when it goes to the screen
 (480X854), the image is much smaller than 400 pixel wide.

 If i use an image of 480X100, the image still can't fit the whole screen.

 It seems there is a relationship between layout_width and the size of the
 background image. For example, when i set layout_width=700px, the background
 image's width is increased but it still can't fit the whole screen
 horizontally.

 Can any help me with this?

 Thanks so much.

 Stanley

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


[android-developers] Re: how to obtain email address?

2010-06-04 Thread HeHe
(refurbished)

does anybody know how to programmingly obtain the (GMail) email
address configured on a phone, which is usually the one initially
entered to activate the phone?

MANY thanks in advance for any know-how.

On Jun 2, 9:43 am, HeHe cnm...@gmail.com wrote:
 does anybody know how to programmatically obtain the email address
 configured on an android phone? that is the one which was used to
 activate the phone?

 thanks in advance for the know-how.

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


[android-developers] how to obtain email address?

2010-06-02 Thread HeHe
does anybody know how to programmatically obtain the email address
configured on an android phone? that is the one which was used to
activate the phone?

thanks in advance for the know-how.

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


[android-developers] Re: SIP Stack

2010-05-13 Thread HeHe
mike, i just saw this open defect with sipdroid/pbxes:
http://code.google.com/p/sipdroid/issues/detail?id=158q=batterysort=-priority

i wonder if this defect comes from a belief in TCP between sipdroid/
pbxes and a thought that TCP connections can persist longer with less
overhead (thus use less battery power) than UDP.

On May 10, 11:46 am, mike enervat...@gmail.com wrote:
 On 05/10/2010 11:24 AM, HeHe wrote:

  when i mentioned ...not be able to receive incoming calls.., i was
  not thinking about just server-client streaming. Mike, you knew
  it :)

  what is your mobile service provider? the sentence IP address changes
  are probably pretty rare looks strange to a T-Moble user like me. at
  least i find my G1 ip frequently changes :(

 So I haven't actually tested this, and I disclaimed because I
 wasn't sure :) If you're getting lots of IP address changes regardless
 of what's happening at the 3gpp/l2 layer, you're probably not going
 to not have a very good experience with streaming media of any kind
 because once the IP address changes, the RTP stream is going to
 tank regardless of SIP, RTSP, Skype, etc.

 That's why you'd need to deal with it more directly like using IP
 handoffs using Mobile IP, etc. Handoffs could be done using SIP, but
 it would be ugly. Which probably means that somebody has proposed it
 and that the working group has taken it on :) AFAIK, mobile IP is still
 not deployed widely,  even though we were working on it the handoff
 probelm almost 10 years ago...

 Part of the reason probably is because 3GPP's latency is really awful for
 real time conversations so there's still too high an energy barrier to
 actually
 deal with the truly difficult problem of dealing with handoffs when TDM
 still
 works just fine. Maybe 4G will get rid of all that bizarre leftovers
 from the
 ATM/bellhead days that 3G had to live with to get standardized.

 In any case as far as SIP registration goes, it should be relatively easy to
 camp on an event for when the IP address changes and quickly reregister
 inside the SIP stack. It wouldn't be surprising that most of the SIP stacks
 already have that feature. How bad this is on battery life is obviously
 dependent on how often IP addresses are actually changing, but you have
 the exact same problem with IM so at some level it's acceptable since
 people do use IM...

 Mike





  On May 10, 10:47 am, mikeenervat...@gmail.com  wrote:

  On 05/10/2010 10:24 AM, HeHe wrote:

  i was not thinking about media.

  i guess the reason why sipdroid+TCP+pbxes can lower battery use is to
  enlarge sip registration expiration, eg. to 5 minutes or longer. what
  if mobile service provider changes phone IP earlier than 5 min when
  the provider finds no traffic to/from the phone? it will not be able
  to receive incoming calls without re-registration.

  anyway, i am just guessing. do you know the usual (or by default)
  registration expiration between sipdroid and pbxes?

  Again, if this is just server-client streaming this is yet another
  reason to avoid SIP and look at RTSP. SIP is a rendezvous protocol,
  and all rendezvous protocols are complicated, with lots of things to
  consider.

  AFAIK -- it's been a long time -- SIP registrations can be very long
  lasting. Unless something has actually changed -- like your IP address
  moved -- it shouldn't be a problem. I'm not entirely convinced that this
  is a huge issue anyway because the cellular guys are probably moving
  you around at L2 for the most part (again, it's been a long time since I've
  paid attention to the 3gpp guys), so IP address changes are probably
  pretty rare. I have no idea if anybody's been deploying mobile IP which
  would more directly solve this issue.

  Mike, who used to like to make fun of Henning, Cullen and Jonathan and
              many others in the SIP WG because of SIP's complexity.

  On May 10, 9:32 am, mikeenervat...@gmail.com    wrote:

  On 05/10/2010 09:04 AM, HeHe wrote:

  i saw this in sipdroid project FAQ:

       Sipdroid now uses TCP for the signaling connection and keeps the
  corresponding port open.

  does anyone know how peer servers of sipdroid handle scalability when
  there are a million of sipdroid clients connecting with the servers
  using TCP?

  as i observed, T-mobile Intermittently changes IP of my G1 phone
  without any notice, which in fact tears down the TCP connection.

  Remember that SIP doesn't actually transport the media, that's
  RTP which is over UDP. So losing the connection shouldn't generally
  be any worse than losing a http connection generally.

  As far as scalability, I woudn't worry about that too much. UDP
  based SIP suffers from a lot of problems, not the least of which is
  the lack of security (unless you manage to find DTLS or are running
  it over IPsec). And of course NAT's are tricky as I mentioned before.

  But I still haven't heard why RTSP wouldn't be a better choice if
  this is just server-client streaming. SIP

[android-developers] Re: clock of emulator 1.6 runs 100% slower than real time clock!!!

2010-05-11 Thread HeHe
is this clock slowness of emulator 1.6 a direct cause of the
freaky behavior of AudioRecorder class that quite some developers
found with SDK 1.6??? that is, the slowness of system clock causes
AudioRecorder to sample audio 100% slowlier than the speed it should??

if yes, what action should i take to fix the issue?

please advice. thanks a lot !!!

On May 10, 4:35 pm, HeHe cnm...@gmail.com wrote:
 often the clock of emulator 1.6 runs significantly (100-150%) slower
 than real world clock.

 for example, after 10 minutes of a human life have elapsed, from
 logcat timestamp only 5 minutes have elapsed on my emulator 1.6,

 has anyone using emulator 1.6 experienced the same issue? if yes, how
 did you tackle with it?

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group 
 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] PLEASE HELP!!! may i develop app for Android 1.6 using SDK 2.x?

2010-05-11 Thread HeHe
the slowness of system clock with SDK 1.6 makes debugging of my app
that heavily depends on correct clock timing impossible.

hence, i would like to know if i can develop app for Android 1.5/1.6
using more recently released SDK (eg. 2.0)? if yes, how?

thanks in advancet for any advice!!

-- 
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: PLEASE HELP!!! may i develop app for Android 1.6 using SDK 2.x?

2010-05-11 Thread HeHe
hi Nathan and Mark, thanks a lot to both of you!!

one more question: in Eclipse, how can i set project properties to
1.5? could you elaborate the menu options or point me to the
documentation page that indicates how-to.

thanks again!!

On May 11, 10:50 am, Nathan critter...@crittermap.com wrote:
 On May 11, 10:32 am, Mark Wyszomierski mar...@gmail.com wrote:



  the app will still work on 1.5+. Just make sure you don't use any SDK
  methods that don't exist on earlier platforms without checking the
  user's local sdk version.

 A further tip: as one of the ways to check you aren't using API that
 won't work on 1.5, set your project properties to 1.5 and see if there
 are compile errors. Do this once in a while, and at least once before
 every release.

 If any methods come up that do not compile on 1.5, and you still want
 to use them, you'll need to use reflection to make them compile for
 1.5. It's messy but it works.

 Nathan

 --
 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: PLEASE HELP!!! may i develop app for Android 1.6 using SDK 2.x?

2010-05-11 Thread HeHe
thanks, Mark.

i think i need to upgrade SDK asap, or i will become crazy!

emulator 1.6 is far more terrible than 1.5. beside the slow clock
issue, it tends to lose connection with adb, so i have been having to
either kill emulator or kill adb frequently to debug my app.

enough. i cannot stand it any more.

On May 11, 9:53 am, HeHe cnm...@gmail.com wrote:
 the slowness of system clock with SDK 1.6 makes debugging of my app
 that heavily depends on correct clock timing impossible.

 hence, i would like to know if i can develop app for Android 1.5/1.6
 using more recently released SDK (eg. 2.0)? if yes, how?

 thanks in advancet for any advice!!

 --
 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: SIP Stack

2010-05-10 Thread HeHe
i saw this in sipdroid project FAQ:

  Sipdroid now uses TCP for the signaling connection and keeps the
corresponding port open.

does anyone know how peer servers of sipdroid handle scalability when
there are a million of sipdroid clients connecting with the servers
using TCP?

as i observed, T-mobile Intermittently changes IP of my G1 phone
without any notice, which in fact tears down the TCP connection.

On May 9, 10:14 pm, Nandan . bhavesh2...@gmail.com wrote:
 yaa android cod support *sip stack s*uch as mjsip, now  pjsip is already
 ported in android platform.

 i can refer you just see sipdroid project.
 sipdroid.org

 you can use  rtpsender and reciver java file of sipdroid project of media
 folder.

 bhavesh





 On Mon, May 10, 2010 at 3:24 AM, mike enervat...@gmail.com wrote:
  On 05/06/2010 01:24 AM, vaibhav wrote:

  Hi

  When I went through the document opencore_framework_capabilities.pdf
  I came to know that Android supports RTP streaming for 3gpp format.

  After doing a anaysis I found that the data from a server could be
  streamed to the android device and played back. i.e the RTP payloads
  sent from the server are parsed by the Android device and sent to the
  decoder for playback.

  1. I want to know if it is possible that the PCM data captured from a
  camera and then encoded using a particular encoder could be streamed
  using  RTP from  android code i.e is RTP sender support present in the
  Android code ?. If not then can someone please mention what could be
  the possible modifications required.

  2. Does Android code support SIP stack ?.

  I assume that know that RTP is the actual media payloads, and that SIP
  is the rendezvous protocol to facilitate setting up the RTP listeners via
  an SDP announcement?

  That said, it sounds like you ought to look into RTSP if what you're trying
  to do is just stream. SIP is very, very complicated in comparison, and has
  all kinds of issues surrounding NAT's that are likely to just confuse the
  issue if all you're trying to do is Server-Client streaming.

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

 --
 B!-!/-\\/!=$!-!

 --
 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: SIP Stack

2010-05-10 Thread HeHe
i was not thinking about media.

i guess the reason why sipdroid+TCP+pbxes can lower battery use is to
enlarge sip registration expiration, eg. to 5 minutes or longer. what
if mobile service provider changes phone IP earlier than 5 min when
the provider finds no traffic to/from the phone? it will not be able
to receive incoming calls without re-registration.

anyway, i am just guessing. do you know the usual (or by default)
registration expiration between sipdroid and pbxes?

On May 10, 9:32 am, mike enervat...@gmail.com wrote:
 On 05/10/2010 09:04 AM, HeHe wrote:

  i saw this in sipdroid project FAQ:

     Sipdroid now uses TCP for the signaling connection and keeps the
  corresponding port open.

  does anyone know how peer servers of sipdroid handle scalability when
  there are a million of sipdroid clients connecting with the servers
  using TCP?

  as i observed, T-mobile Intermittently changes IP of my G1 phone
  without any notice, which in fact tears down the TCP connection.

 Remember that SIP doesn't actually transport the media, that's
 RTP which is over UDP. So losing the connection shouldn't generally
 be any worse than losing a http connection generally.

 As far as scalability, I woudn't worry about that too much. UDP
 based SIP suffers from a lot of problems, not the least of which is
 the lack of security (unless you manage to find DTLS or are running
 it over IPsec). And of course NAT's are tricky as I mentioned before.

 But I still haven't heard why RTSP wouldn't be a better choice if
 this is just server-client streaming. SIP is a kitchen sink of a
 protocol.

 Mike





  On May 9, 10:14 pm, Nandan .bhavesh2...@gmail.com  wrote:

  yaa android cod support *sip stack s*uch as mjsip, now  pjsip is already
  ported in android platform.

  i can refer you just see sipdroid project.
  sipdroid.org

  you can use  rtpsender and reciver java file of sipdroid project of media
  folder.

  bhavesh

  On Mon, May 10, 2010 at 3:24 AM, mikeenervat...@gmail.com  wrote:

  On 05/06/2010 01:24 AM, vaibhav wrote:

  Hi

  When I went through the document opencore_framework_capabilities.pdf
  I came to know that Android supports RTP streaming for 3gpp format.

  After doing a anaysis I found that the data from a server could be
  streamed to the android device and played back. i.e the RTP payloads
  sent from the server are parsed by the Android device and sent to the
  decoder for playback.

  1. I want to know if it is possible that the PCM data captured from a
  camera and then encoded using a particular encoder could be streamed
  using  RTP from  android code i.e is RTP sender support present in the
  Android code ?. If not then can someone please mention what could be
  the possible modifications required.

  2. Does Android code support SIP stack ?.

  I assume that know that RTP is the actual media payloads, and that SIP
  is the rendezvous protocol to facilitate setting up the RTP listeners via
  an SDP announcement?

  That said, it sounds like you ought to look into RTSP if what you're 
  trying
  to do is just stream. SIP is very, very complicated in comparison, and has
  all kinds of issues surrounding NAT's that are likely to just confuse the
  issue if all you're trying to do is Server-Client streaming.

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

  --
  B!-!/-\\/!=$!-!

  --
  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: SIP Stack

2010-05-10 Thread HeHe
when i mentioned ...not be able to receive incoming calls.., i was
not thinking about just server-client streaming. Mike, you knew
it :)

what is your mobile service provider? the sentence IP address changes
are probably pretty rare looks strange to a T-Moble user like me. at
least i find my G1 ip frequently changes :(

On May 10, 10:47 am, mike enervat...@gmail.com wrote:
 On 05/10/2010 10:24 AM, HeHe wrote:

  i was not thinking about media.

  i guess the reason why sipdroid+TCP+pbxes can lower battery use is to
  enlarge sip registration expiration, eg. to 5 minutes or longer. what
  if mobile service provider changes phone IP earlier than 5 min when
  the provider finds no traffic to/from the phone? it will not be able
  to receive incoming calls without re-registration.

  anyway, i am just guessing. do you know the usual (or by default)
  registration expiration between sipdroid and pbxes?

 Again, if this is just server-client streaming this is yet another
 reason to avoid SIP and look at RTSP. SIP is a rendezvous protocol,
 and all rendezvous protocols are complicated, with lots of things to
 consider.

 AFAIK -- it's been a long time -- SIP registrations can be very long
 lasting. Unless something has actually changed -- like your IP address
 moved -- it shouldn't be a problem. I'm not entirely convinced that this
 is a huge issue anyway because the cellular guys are probably moving
 you around at L2 for the most part (again, it's been a long time since I've
 paid attention to the 3gpp guys), so IP address changes are probably
 pretty rare. I have no idea if anybody's been deploying mobile IP which
 would more directly solve this issue.

 Mike, who used to like to make fun of Henning, Cullen and Jonathan and
            many others in the SIP WG because of SIP's complexity.





  On May 10, 9:32 am, mikeenervat...@gmail.com  wrote:

  On 05/10/2010 09:04 AM, HeHe wrote:

  i saw this in sipdroid project FAQ:

      Sipdroid now uses TCP for the signaling connection and keeps the
  corresponding port open.

  does anyone know how peer servers of sipdroid handle scalability when
  there are a million of sipdroid clients connecting with the servers
  using TCP?

  as i observed, T-mobile Intermittently changes IP of my G1 phone
  without any notice, which in fact tears down the TCP connection.

  Remember that SIP doesn't actually transport the media, that's
  RTP which is over UDP. So losing the connection shouldn't generally
  be any worse than losing a http connection generally.

  As far as scalability, I woudn't worry about that too much. UDP
  based SIP suffers from a lot of problems, not the least of which is
  the lack of security (unless you manage to find DTLS or are running
  it over IPsec). And of course NAT's are tricky as I mentioned before.

  But I still haven't heard why RTSP wouldn't be a better choice if
  this is just server-client streaming. SIP is a kitchen sink of a
  protocol.

  Mike

  On May 9, 10:14 pm, Nandan .bhavesh2...@gmail.com    wrote:

  yaa android cod support *sip stack s*uch as mjsip, now  pjsip is already
  ported in android platform.

  i can refer you just see sipdroid project.
  sipdroid.org

  you can use  rtpsender and reciver java file of sipdroid project of media
  folder.

  bhavesh

  On Mon, May 10, 2010 at 3:24 AM, mikeenervat...@gmail.com    wrote:

  On 05/06/2010 01:24 AM, vaibhav wrote:

  Hi

  When I went through the document opencore_framework_capabilities.pdf
  I came to know that Android supports RTP streaming for 3gpp format.

  After doing a anaysis I found that the data from a server could be
  streamed to the android device and played back. i.e the RTP payloads
  sent from the server are parsed by the Android device and sent to the
  decoder for playback.

  1. I want to know if it is possible that the PCM data captured from a
  camera and then encoded using a particular encoder could be streamed
  using  RTP from  android code i.e is RTP sender support present in the
  Android code ?. If not then can someone please mention what could be
  the possible modifications required.

  2. Does Android code support SIP stack ?.

  I assume that know that RTP is the actual media payloads, and that SIP
  is the rendezvous protocol to facilitate setting up the RTP listeners 
  via
  an SDP announcement?

  That said, it sounds like you ought to look into RTSP if what you're 
  trying
  to do is just stream. SIP is very, very complicated in comparison, and 
  has
  all kinds of issues surrounding NAT's that are likely to just confuse 
  the
  issue if all you're trying to do is Server-Client streaming.

  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.comandroid-developers%2Bunsubs
   cr...@googlegroups.com

[android-developers] Re: SIP Stack

2010-05-10 Thread HeHe
mike, is it possible that the situation where ISP changes ip of your
phone differs from the situation where you manually change ip of your
phone ipconfig/renew?

that is, is it possible that a phone cannot detect change of ip until
next time when it tries to send something out?

by the way, what is the java/android api you use to detect ip
change? could you share a code example with me? thanks :)

On May 10, 11:46 am, mike enervat...@gmail.com wrote:
 On 05/10/2010 11:24 AM, HeHe wrote:

  when i mentioned ...not be able to receive incoming calls.., i was
  not thinking about just server-client streaming. Mike, you knew
  it :)

  what is your mobile service provider? the sentence IP address changes
  are probably pretty rare looks strange to a T-Moble user like me. at
  least i find my G1 ip frequently changes :(

 So I haven't actually tested this, and I disclaimed because I
 wasn't sure :) If you're getting lots of IP address changes regardless
 of what's happening at the 3gpp/l2 layer, you're probably not going
 to not have a very good experience with streaming media of any kind
 because once the IP address changes, the RTP stream is going to
 tank regardless of SIP, RTSP, Skype, etc.

 That's why you'd need to deal with it more directly like using IP
 handoffs using Mobile IP, etc. Handoffs could be done using SIP, but
 it would be ugly. Which probably means that somebody has proposed it
 and that the working group has taken it on :) AFAIK, mobile IP is still
 not deployed widely,  even though we were working on it the handoff
 probelm almost 10 years ago...

 Part of the reason probably is because 3GPP's latency is really awful for
 real time conversations so there's still too high an energy barrier to
 actually
 deal with the truly difficult problem of dealing with handoffs when TDM
 still
 works just fine. Maybe 4G will get rid of all that bizarre leftovers
 from the
 ATM/bellhead days that 3G had to live with to get standardized.

 In any case as far as SIP registration goes, it should be relatively easy to
 camp on an event for when the IP address changes and quickly reregister
 inside the SIP stack. It wouldn't be surprising that most of the SIP stacks
 already have that feature. How bad this is on battery life is obviously
 dependent on how often IP addresses are actually changing, but you have
 the exact same problem with IM so at some level it's acceptable since
 people do use IM...

 Mike





  On May 10, 10:47 am, mikeenervat...@gmail.com  wrote:

  On 05/10/2010 10:24 AM, HeHe wrote:

  i was not thinking about media.

  i guess the reason why sipdroid+TCP+pbxes can lower battery use is to
  enlarge sip registration expiration, eg. to 5 minutes or longer. what
  if mobile service provider changes phone IP earlier than 5 min when
  the provider finds no traffic to/from the phone? it will not be able
  to receive incoming calls without re-registration.

  anyway, i am just guessing. do you know the usual (or by default)
  registration expiration between sipdroid and pbxes?

  Again, if this is just server-client streaming this is yet another
  reason to avoid SIP and look at RTSP. SIP is a rendezvous protocol,
  and all rendezvous protocols are complicated, with lots of things to
  consider.

  AFAIK -- it's been a long time -- SIP registrations can be very long
  lasting. Unless something has actually changed -- like your IP address
  moved -- it shouldn't be a problem. I'm not entirely convinced that this
  is a huge issue anyway because the cellular guys are probably moving
  you around at L2 for the most part (again, it's been a long time since I've
  paid attention to the 3gpp guys), so IP address changes are probably
  pretty rare. I have no idea if anybody's been deploying mobile IP which
  would more directly solve this issue.

  Mike, who used to like to make fun of Henning, Cullen and Jonathan and
              many others in the SIP WG because of SIP's complexity.

  On May 10, 9:32 am, mikeenervat...@gmail.com    wrote:

  On 05/10/2010 09:04 AM, HeHe wrote:

  i saw this in sipdroid project FAQ:

       Sipdroid now uses TCP for the signaling connection and keeps the
  corresponding port open.

  does anyone know how peer servers of sipdroid handle scalability when
  there are a million of sipdroid clients connecting with the servers
  using TCP?

  as i observed, T-mobile Intermittently changes IP of my G1 phone
  without any notice, which in fact tears down the TCP connection.

  Remember that SIP doesn't actually transport the media, that's
  RTP which is over UDP. So losing the connection shouldn't generally
  be any worse than losing a http connection generally.

  As far as scalability, I woudn't worry about that too much. UDP
  based SIP suffers from a lot of problems, not the least of which is
  the lack of security (unless you manage to find DTLS or are running
  it over IPsec). And of course NAT's are tricky as I mentioned before.

  But I still haven't heard why

[android-developers] clock of emulator 1.6 runs 100% slower than real time clock!!!

2010-05-10 Thread HeHe
often the clock of emulator 1.6 runs significantly (100-150%) slower
than real world clock.

for example, after 10 minutes of a human life have elapsed, from
logcat timestamp only 5 minutes have elapsed on my emulator 1.6,

has anyone using emulator 1.6 experienced the same issue? if yes, how
did you tackle with it?

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


[android-developers] Re: Inter thread Communication

2010-04-24 Thread HeHe
or,

  5. STL queue in C++/NDK :-P

On Apr 24, 11:18 am, Anurag Singh anusingh...@gmail.com wrote:
 1. use global varibales

 2. use named pipe streams

 3. use socket

 4. use file system

 - Anurag Singh





 On Sat, Apr 24, 2010 at 9:31 PM, Shekhar shekhar...@gmail.com wrote:
  Hi All,

  I have a basic question on support of mutithreading in the android
  application programming.
  Suppose I have an activity running on the main thread and from the
  main thread, I have
  started two threads .Now my intention is to pass the data between
  these two threads.

  Which method I have to use to pass the data between these two new
  threads?

  Thanks,
  Shekhar

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs 
  cr...@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] how to remove a notification with flag FLAG_NO_CLEAR

2010-04-20 Thread HeHe
as title.

thank you.

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


[android-developers] Re: AudioRecord fails on Android 2.1

2010-04-12 Thread HeHe


 On Apr 12, 2:34 pm, Gabriel Simões gsim...@gmail.com wrote:
 I´d like to ask you one thing: have you been able to record a sound
 and listen to it without problems using the emulator (older versions).
 I can create an instance and indeed record but when I try to play it
 the sound is completly messed up, distorted, chopped, 

 Gabriel


yes, i see the same issue on 1.6 emulator! on real phone 1.6, however,
it is fine.

by the way, your comment sounds like i should pray hard that T-mobile
wont upgrade my G1 to android 2.x.

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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: AudioRecord fails on Android 2.1

2010-04-12 Thread HeHe
i believe you should buy one for development, especially after you
country has discovered a huge oil field :-)

On Apr 12, 4:33 pm, Gabriel Simões gsim...@gmail.com wrote:
 Well  then I think I will need to hold 400 bucks to buy a real
 device here in Brazil ... and it´s gonna be a crap samsung 

 On 12 abr, 20:22, HeHe cnm...@gmail.com wrote:



   On Apr 12, 2:34 pm, Gabriel Simões gsim...@gmail.com wrote:
   I´d like to ask you one thing: have you been able to record a sound
   and listen to it without problems using the emulator (older versions).
   I can create an instance and indeed record but when I try to play it
   the sound is completly messed up, distorted, chopped, 

   Gabriel

  yes, i see the same issue on 1.6 emulator! on real phone 1.6, however,
  it is fine.

  by the way, your comment sounds like i should pray hard that T-mobile
  wont upgrade my G1 to android 2.x.

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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: Down Tab Bar in Android

2010-04-11 Thread HeHe
itself cannot cause program exception, i think.

you need to debug your apk and find out which object access causes np
exception.

On Apr 11, 9:22 pm, Sasikumar.S sasikumar.it1...@gmail.com wrote:
 Hi Hehe,

 I tried it but still it showing Null Pointer Exception.





 On Sun, Apr 11, 2010 at 7:38 AM, HeHe cnm...@gmail.com wrote:
  in case you still find no way to go, here is mine that you might like
  to try if you can bear the fly in the ointment -- the thin white bar
  of tabwidget is below instead of above the tab buttons. hope android
  team shall give more flexibility in this aspect :-@

  ?xml version=1.0 encoding=utf-8?

  TabHost xmlns:android=http://schemas.android.com/apk/res/android;
         android:id=@android:id/tabhost
         android:layout_width=fill_parent
         android:layout_height=fill_parent
          FrameLayout
                 android:id=@android:id/tabcontent
                 android:layout_width=fill_parent
                 android:layout_height=fill_parent
                  android:paddingBottom=60px
                 LinearLayout
                         android:id=@+id/calltabs_content
                          android:orientation=vertical
                         android:layout_width=fill_parent
                         android:layout_height=fill_parent
                  /LinearLayout
         /FrameLayout
         RelativeLayout
                  android:layout_width=fill_parent
                 android:layout_height=fill_parent
                  TabWidget
                         android:id=@android:id/tabs
                          android:layout_alignParentBottom=true
                          android:layout_width=fill_parent
                          android:layout_height=60px/
         /RelativeLayout
  /TabHost

  ho da la!!

  On Feb 18, 6:43 am, Sasikumar.S sasikumar.it1...@gmail.com wrote:
   Thanks for ur reply

   I will try it

   On Thu, Feb 18, 2010 at 7:12 PM, Dilli rao dilliraomca...@gmail.com
  wrote:
implement your own layout with *tabhost, framelayout *and *tabwidget*
  you
can arrange the tabs at bottom of the layout

On Thu, Feb 18, 2010 at 11:06 AM, Sasikumar S 
  sasikumar.it1...@gmail.comwrote:

Hi,

How to show tab bar in down in android like iphone ?

Any suggestion?

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

--
Thank you
Dilli Rao

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

   --
   Thanks  Regards
   Sasikumar.S

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

 --
 Thanks  Regards
 Sasikumar.S

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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: Down Tab Bar in Android

2010-04-10 Thread HeHe
in case you still find no way to go, here is mine that you might like
to try if you can bear the fly in the ointment -- the thin white bar
of tabwidget is below instead of above the tab buttons. hope android
team shall give more flexibility in this aspect :-@

?xml version=1.0 encoding=utf-8?

TabHost xmlns:android=http://schemas.android.com/apk/res/android;
android:id=@android:id/tabhost
android:layout_width=fill_parent
android:layout_height=fill_parent
FrameLayout
android:id=@android:id/tabcontent
android:layout_width=fill_parent
android:layout_height=fill_parent
android:paddingBottom=60px
LinearLayout
android:id=@+id/calltabs_content
android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=fill_parent
/LinearLayout
/FrameLayout
RelativeLayout
android:layout_width=fill_parent
android:layout_height=fill_parent
TabWidget
android:id=@android:id/tabs
android:layout_alignParentBottom=true
android:layout_width=fill_parent
android:layout_height=60px/
/RelativeLayout
/TabHost



ho da la!!


On Feb 18, 6:43 am, Sasikumar.S sasikumar.it1...@gmail.com wrote:
 Thanks for ur reply

 I will try it





 On Thu, Feb 18, 2010 at 7:12 PM, Dilli rao dilliraomca...@gmail.com wrote:
  implement your own layout with *tabhost, framelayout *and *tabwidget* you
  can arrange the tabs at bottom of the layout

  On Thu, Feb 18, 2010 at 11:06 AM, Sasikumar S 
  sasikumar.it1...@gmail.comwrote:

  Hi,

  How to show tab bar in down in android like iphone ?

  Any suggestion?

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

  --
  Thank you
  Dilli Rao

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

 --
 Thanks  Regards
 Sasikumar.S

-- 
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: Managing Google apiKeys

2010-04-09 Thread HeHe
regardless whatever others think, i still knees and begs for an SDK
function for an apk to see if it has been signed by debug signing key
or by release signing key, which seems of more humanity to me than
other approaches because MAP API key is associated with the signing
key. other approaches require good human memory :)

On Apr 9, 2:20 pm, Tom Opgenorth opgeno...@gmail.com wrote:
 Hi all,

 Perhaps I'm missing the boat here on something, so any advice/feedback
 would be appreciated.

 I have a simple app that uses a Google MapView.  Now in the layout
 file for my map activity, I created an apiKey for the debug keystore
 and use that.  However when I want to deploy my app, I need a seperate
 apiKey for production (based on when I sign my application), correct?

 What I'm wondering is how do people manage these two apiKeys.  When
 developing I want to use the emulator and the debug apiKey, but when
 I'm deploying / doing some integration testing with my phone, I want
 to use the production apiKey.  To me, it seems that I need to remember
 before compiling for production, to swap out the apiKeys in my layout
 file.  A very error prone process given my bad memory.

 Is there a better way to manage this?

 --http://www.opgenorth.net

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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: Virtual Keyboard

2010-04-07 Thread HeHe
//the keyboard now
((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(v.getWindowToken(),
0);


On Apr 7, 10:09 am, d...@rolph.com wrote:
 Hello,
 Is there a way to configure the virtual keyboard to hide once the return 
 key is pressed?  I have numerous EditText fields in my application and I want 
 the user to be able to enter a single line value, press return, and the 
 keyboard goes away.
 Is there a way to override the virtual keyboard return key?
 Thank you very much!
 Dan
  

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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: Virtual Keyboard

2010-04-07 Thread HeHe
Dan,

please add the line in OnFocusChange() or setOnEditorAction() listener
of your EditText view.

added there, it works for me.


On Apr 7, 11:08 am, d...@rolph.com wrote:
 HeHe,
 I added that line to my activity, and I still get the virtual keyboard after 
 the return key is pressed.  Pressing the return key only adds a new line to 
 my EditText.  Did I implement it improperly?  Here is a sample piece of code 
 testing the functionality:
 public class Login extends Activity {
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
     setContentView(R.layout.login);
    
     EditText usernameEditText = (EditText)findViewById(R.id.usernameVal);
     
     
 ((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(usernameEditText.getWindowToken(),
             0);
    
     }
 }
 Thanks,
 Dan

 On Apr 7, 2010,HeHecnm...@gmail.com wrote:

 //the keyboard now
 ((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(v.getWindowToken(),
 0);
 On Apr 7, 10:09 am,d...@rolph.comwrote:
  Hello,
  Is there a way to configure the virtual keyboard to hide once the return 
  key is pressed?  I have numerous EditText fields in my application and I 
  want the user to be able to enter a single line value, press return, and 
  the keyboard goes away.
  Is there a way to override the virtual keyboard return key?
  Thank you very much!
  Dan
   
 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email toandroid-develop...@googlegroups.com
 To unsubscribe from this group, send email 
 toandroid-developers+unsubscr...@googlegroups.com
 For more options, visit this group 
 athttp://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 at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: how to DEBUG build an APK?

2010-04-06 Thread HeHe
if you could share with me a template of the ant script, it will be
much appreciated!!

On Apr 5, 3:51 pm, Bob Kerns r...@acm.org wrote:
 You should ALWAYS look outside the IDE for production builds. Any IDE.
 Builds should always be automateable and as automated as possible.
 Including managing revision control stategy. IDEs are simply not
 designed for repeatability.

 However, the main part of the process is vanilla ant script produced
 by the 'android' tool. It's just the setup and how it's driven that's
 separate (and can be shared between projects).

 Remember, too, that ant scripts can integrate with the Eclipse IDE.

 On Apr 5, 10:27 am, HeHe cnm...@gmail.com wrote:



  Bob, sounds like you are going to devise some Makefile to achieve
  the purpose and i also have to look outside of Eclipse IDE and my code
  to find my machine gun. please forget my problem and have a nice
  breakfast :) thanks anyway for your comments.

  On Apr 5, 9:49 am, Bob Kerns r...@acm.org wrote:

   Your application is ALWAYS going to see Config.DEBUG as FALSE. You
   seem stuck on that. Config.DEBUG has nothing to do with your
   application whatsoever. It  has to do with your device.

   I need to get breakfast, I'm getting grumpy. In addition to the link I
   sent you, look at this link (which is linked from the link I sent
   you!):

  http://developer.android.com/intl/de/reference/android/content/pm/App...

   You get the package manager, and get the application info for your
   program, and examine its flags, to see the state of
   android:debuggable. Again, nothing whatsoever to do with Config.DEBUG,
   which you should forget you ever saw!

   The SDK tool chain provides NO WAY to identify a debug build of your
   application -- because that could mean almost anything.

   YOU need to decide what it means -- you could have a debug build, a
   test build, a build with extra logging, a build that contacts a debug
   version of your back-end service, etc. etc.

   The best way to distinguish them is through the manifest. You can use
   the android:debuggable attribute, but that's not its primary purpose.
   But if your needs align with it, you can use it.

   More generally, you can include metadata in your manifest, and examine
   that to determine how your program behaves. You can also use resources
   for the purpose, but I would prefer such things to be done through the
   manifest.

   I'm planning to start writing up my approach to building multiple
   versions of an application from a single source tree, sometime within
   the next couple days.  One aspect of my approach is that
   android:debuggable='true' is what appears in the manifest, unless I'm
   creating a production build, where it is automatically set to false
   instead. But I don't examine it in my code; I have metadata to control
   various aspects of that. (I also automatically manage build numbers,
   etc).

   On Apr 5, 9:12 am, HeHe cnm...@gmail.com wrote:

thanks for the good idea to turn debuggable apk to red. however, the
problem i am experiencing that even after i set debuggable attribute
in manifest to TRUE and build and launch my apk using Eclipse Run
Debug As, my apk still sees Config.DEBUG as FALSE. so right now i
don't know how my apk can programmatically learn that it is a debug
built. do you have a snippet teaching me how? thanks in adavance.

On Apr 5, 8:59 am, ~ TreKing treking...@gmail.com wrote:

 On Mon, Apr 5, 2010 at 10:42 AM, HeHe cnm...@gmail.com wrote:
  but what i need is some info telling my apk that it was a debug or 
  release
  built without changing the debuggable attribute in manifest each 
  time
  between debug/release builds.

 This is not possible. You will have to make sure to remember to 
 change that
 debuggable flag. Maybe add some code that sets your primary layout's
 background color to red in debug mode or something if you're so 
 worried
 about it so you always know that you have that flag set.

  i need it because in case i forget to change the debuggable 
  attribute of my
  release built to false my apk can still behave correctly.

 So you don't really NEED it ... you just have to be careful before
 publishing your app. Even a rudimentary test on your release APK 
 should
 alert you that you still have the debuggable flag set (for example, by
 setting your background to red in debug mode), in which case it takes 
 about
 2 seconds to switch it and rebuild.

 (1). i dont want to change the debuggable attribute in manifest 
 between

  debug and release builds.

 You 
 should.http://developer.android.com/intl/fr/guide/publishing/preparing.html
 Read section 4

 In fact, as far as Android is concerned, that debuggable flag is 
 pretty much
 what defines DEBUG vs RELEASE, AFAIK

[android-developers] Re: how to DEBUG build an APK?

2010-04-05 Thread HeHe
why do you think i am not being serious?!

On Apr 4, 9:28 pm, ~ TreKing treking...@gmail.com wrote:
 On Sun, Apr 4, 2010 at 9:38 PM, HeHe cnm...@gmail.com wrote:
  my apk stills gets a *false* Config.DEBUG value.

 Are you being serious? Which part of Xavier's post did you not understand?

 So once again:

 On Sun, Apr 4, 2010 at 3:35 PM, Xavier Ducrohet x...@android.com wrote:
  If you are talking about
 http://d.android.com/reference/android/util/Config.html#DEBUGthen it's
  based on whether the device build is a debug build. It has nothing to do
  with your app.

 --- 
 --
 TreKing - Chicago transit tracking app for Android-powered 
 deviceshttp://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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: how to DEBUG build an APK?

2010-04-05 Thread HeHe
i set debuggable flag in manifest.xml.

i launched my apk using Run Debug As menu cmd of Eclipse IDE.

could you or Xavier please elaborate what extra procedure (detailed
steps, please) i need to follow to get a true Config.DEBUG value?

thanks a lot!

On Apr 4, 9:28 pm, ~ TreKing treking...@gmail.com wrote:
 On Sun, Apr 4, 2010 at 9:38 PM, HeHe cnm...@gmail.com wrote:
  my apk stills gets a *false* Config.DEBUG value.

 Are you being serious? Which part of Xavier's post did you not understand?

 So once again:

 On Sun, Apr 4, 2010 at 3:35 PM, Xavier Ducrohet x...@android.com wrote:
  If you are talking about
 http://d.android.com/reference/android/util/Config.html#DEBUGthen it's
  based on whether the device build is a debug build. It has nothing to do
  with your app.

 --- 
 --
 TreKing - Chicago transit tracking app for Android-powered 
 deviceshttp://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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: how to DEBUG build an APK?

2010-04-05 Thread HeHe
Bob, thanks for reply. i am still still very very confusedthe link
you gave me is a constant FLAG_DEBUGGABLE, indicating the
application is manifested to be debuggable. but what i need is some
info telling my apk that it was a debug or release built without
changing the debuggable attribute in manifest each time between
debug/release builds. i need it because in case i forget to change the
debuggable attribute of my release built to false my apk can still
behave correctly.

in short,
(1). i dont want to change the debuggable attribute in manifest
between debug and release builds.
(2). i need to some programmatic method in my apk so that it can know
whether  it is built by Run Run As or Run Debug As, or by
Android Tools Export Signed Application.

On Apr 5, 12:27 am, Bob Kerns r...@acm.org wrote:
 TreKing -- He doesn't understand what a debug build is. The flag
 indicates that the DEVICE, not your APPLICATION is a debug build.

 HeHe -- That's why you can't get at it with Config.DEBUG -- you'd need
 to reflash your device. You don't make this in Eclipse -- or at least
 not using the SDK.

 What you're really looking for is 
 this:http://developer.android.com/intl/de/reference/android/content/pm/App...

 Just  little misunderstanding...

 On Apr 4, 9:28 pm, ~ TreKing treking...@gmail.com wrote:



  On Sun, Apr 4, 2010 at 9:38 PM, HeHe cnm...@gmail.com wrote:
   my apk stills gets a *false* Config.DEBUG value.

  Are you being serious? Which part of Xavier's post did you not understand?

  So once again:

  On Sun, Apr 4, 2010 at 3:35 PM, Xavier Ducrohet x...@android.com wrote:
   If you are talking about
  http://d.android.com/reference/android/util/Config.html#DEBUGthenit's
   based on whether the device build is a debug build. It has nothing to do
   with your app.

  --- 
  --
  TreKing - Chicago transit tracking app for Android-powered 
  deviceshttp://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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: how to DEBUG build an APK?

2010-04-05 Thread HeHe
thanks. now i understand it. Config.DEBUG is for DEVICE and not for
APK.

i need some info to tell my apk which of map api key to use.  here are
the 2 cases:

(1). build apk by selecting Eclipse Run Run As or Run Debug As
menu option. in this case, the apk is a DEBUG built and is signed by
Android Debug key. hence, the apk must use the map api key applied
with the md5 checksum of Android Debug key. no matter on which of
emulator or real handset the apk runs, it is a DEBUG built.

(2). build apk by selcting Android Tools Export Signed Application
menu option. in this case, the apk is a RELEASE built and is signed by
my key. so the apk must use the map api key applied with the md5
checksum of my key.

is there any way for my apk to programmatically know that it itself is
a DEBUG or RELEASE built without changing manifest debuggable
attribute so that my apk can choose the right map api key?

or, my question can be: is there any way for my apk to know by which
of DEBUG/RELEASE key it was signed?

On Apr 5, 7:41 am, ~ TreKing treking...@gmail.com wrote:
 On Mon, Apr 5, 2010 at 2:00 AM, HeHe cnm...@gmail.com wrote:
  why do you think i am not being serious?!

 Because you insist on asking the exact same question after an answer was
 posted (and then re-posted) about 3 times now.

 I thought Xavier's first post about the Config.DEBUG variable indicating the
 DEVICE was debug was clear that this was not something you could change or
 had anything to do with the debuggable flag.

 I hope Bob's post clears this up. And to add to that the link he posted
 refers to the debuggable flag in the manifest I mentioned earlier.

 If you're still confused, maybe explaining why you insist on using
 Config.DEBUG would help clear things up?

 --- 
 --
 TreKing - Chicago transit tracking app for Android-powered 
 deviceshttp://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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: how to DEBUG build an APK?

2010-04-05 Thread HeHe
thanks for the good idea to turn debuggable apk to red. however, the
problem i am experiencing that even after i set debuggable attribute
in manifest to TRUE and build and launch my apk using Eclipse Run
Debug As, my apk still sees Config.DEBUG as FALSE. so right now i
don't know how my apk can programmatically learn that it is a debug
built. do you have a snippet teaching me how? thanks in adavance.

On Apr 5, 8:59 am, ~ TreKing treking...@gmail.com wrote:
 On Mon, Apr 5, 2010 at 10:42 AM, HeHe cnm...@gmail.com wrote:
  but what i need is some info telling my apk that it was a debug or release
  built without changing the debuggable attribute in manifest each time
  between debug/release builds.

 This is not possible. You will have to make sure to remember to change that
 debuggable flag. Maybe add some code that sets your primary layout's
 background color to red in debug mode or something if you're so worried
 about it so you always know that you have that flag set.

  i need it because in case i forget to change the debuggable attribute of my
  release built to false my apk can still behave correctly.

 So you don't really NEED it ... you just have to be careful before
 publishing your app. Even a rudimentary test on your release APK should
 alert you that you still have the debuggable flag set (for example, by
 setting your background to red in debug mode), in which case it takes about
 2 seconds to switch it and rebuild.

 (1). i dont want to change the debuggable attribute in manifest between

  debug and release builds.

 You 
 should.http://developer.android.com/intl/fr/guide/publishing/preparing.html
 Read section 4

 In fact, as far as Android is concerned, that debuggable flag is pretty much
 what defines DEBUG vs RELEASE, AFAIK.

 --- 
 --
 TreKing - Chicago transit tracking app for Android-powered 
 deviceshttp://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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: Getting the amount of Audio data buffered in the device

2010-04-05 Thread HeHe
theoretically, AudioTrack.getPlaybackHeadPosition should do the job.

however, in my experience with SDK 1.5, the function seems broken
after you *pause the player. i removed it from my app then, so i have
no idea if the issue is gone for SDK 1.6+...

On Apr 5, 3:00 am, KK krishnakumar.ramachand...@gmail.com wrote:
 I am trying to write a streaming application. I have my own decoder
 and I am playing PCM audio using AudioTrack. At any point in time I
 want to know how much data is buffered with the device. I want to use
 this so that if the data with the device go below a level, I want to
 go into a buffering mode where I will buffer 2-3 seconds of data
 before continuing playback again. Can someone please tell me how to do
 this?

 Thanks in advance
 KK

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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: how to DEBUG build an APK?

2010-04-05 Thread HeHe
Bob, sounds like you are going to devise some Makefile to achieve
the purpose and i also have to look outside of Eclipse IDE and my code
to find my machine gun. please forget my problem and have a nice
breakfast :) thanks anyway for your comments.

On Apr 5, 9:49 am, Bob Kerns r...@acm.org wrote:
 Your application is ALWAYS going to see Config.DEBUG as FALSE. You
 seem stuck on that. Config.DEBUG has nothing to do with your
 application whatsoever. It  has to do with your device.

 I need to get breakfast, I'm getting grumpy. In addition to the link I
 sent you, look at this link (which is linked from the link I sent
 you!):

 http://developer.android.com/intl/de/reference/android/content/pm/App...

 You get the package manager, and get the application info for your
 program, and examine its flags, to see the state of
 android:debuggable. Again, nothing whatsoever to do with Config.DEBUG,
 which you should forget you ever saw!

 The SDK tool chain provides NO WAY to identify a debug build of your
 application -- because that could mean almost anything.

 YOU need to decide what it means -- you could have a debug build, a
 test build, a build with extra logging, a build that contacts a debug
 version of your back-end service, etc. etc.

 The best way to distinguish them is through the manifest. You can use
 the android:debuggable attribute, but that's not its primary purpose.
 But if your needs align with it, you can use it.

 More generally, you can include metadata in your manifest, and examine
 that to determine how your program behaves. You can also use resources
 for the purpose, but I would prefer such things to be done through the
 manifest.

 I'm planning to start writing up my approach to building multiple
 versions of an application from a single source tree, sometime within
 the next couple days.  One aspect of my approach is that
 android:debuggable='true' is what appears in the manifest, unless I'm
 creating a production build, where it is automatically set to false
 instead. But I don't examine it in my code; I have metadata to control
 various aspects of that. (I also automatically manage build numbers,
 etc).

 On Apr 5, 9:12 am, HeHe cnm...@gmail.com wrote:



  thanks for the good idea to turn debuggable apk to red. however, the
  problem i am experiencing that even after i set debuggable attribute
  in manifest to TRUE and build and launch my apk using Eclipse Run
  Debug As, my apk still sees Config.DEBUG as FALSE. so right now i
  don't know how my apk can programmatically learn that it is a debug
  built. do you have a snippet teaching me how? thanks in adavance.

  On Apr 5, 8:59 am, ~ TreKing treking...@gmail.com wrote:

   On Mon, Apr 5, 2010 at 10:42 AM, HeHe cnm...@gmail.com wrote:
but what i need is some info telling my apk that it was a debug or 
release
built without changing the debuggable attribute in manifest each time
between debug/release builds.

   This is not possible. You will have to make sure to remember to change 
   that
   debuggable flag. Maybe add some code that sets your primary layout's
   background color to red in debug mode or something if you're so worried
   about it so you always know that you have that flag set.

i need it because in case i forget to change the debuggable attribute 
of my
release built to false my apk can still behave correctly.

   So you don't really NEED it ... you just have to be careful before
   publishing your app. Even a rudimentary test on your release APK should
   alert you that you still have the debuggable flag set (for example, by
   setting your background to red in debug mode), in which case it takes 
   about
   2 seconds to switch it and rebuild.

   (1). i dont want to change the debuggable attribute in manifest between

debug and release builds.

   You 
   should.http://developer.android.com/intl/fr/guide/publishing/preparing.html
   Read section 4

   In fact, as far as Android is concerned, that debuggable flag is pretty 
   much
   what defines DEBUG vs RELEASE, AFAIK.

   ---
--
   TreKing - Chicago transit tracking app for Android-powered 
   deviceshttp://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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: how to DEBUG build an APK?

2010-04-05 Thread HeHe
Brill, thanks for comment. using your approach, do you run a DEBUG
build on a real device and still succeed in map api?

my apk has no problem telling itself if it is running on emulator or
not, because running on emulator an apk should always assume itself a
debug build. my release build has no problem running on real device
either.

AFAIK, the map api key that an apk should use is decided by the app
signing key used to sign the apk; it is not decided by which emulator/
device the apk runs on.

so, when a DEBUG build runs on my REAL phone, it fails map api key,
because there seems to me no way to tell build type of an apk, UNLESS
like Bob suggested i put some semi-auto attribute or metadata in my
code, and remember to remove it before formal RELEASE, or devise some
makefile to put/remove the metadata for me automatically.

OR, i should not run a debug build on a real device and hope map api
works...

On Apr 5, 10:39 am, Brill Pappin br...@pappin.ca wrote:
 actually i had the same issue with different Map keys for dev and
 production.

 My solution was a little bit of code that checks to see if your
 running in the emulator or not. It works for at least Android 2.1
 update 1:

 public static final boolean isEmulator() {
                 if (1.equals(System.getProperties()
                                 .getProperty(ro.kernel.qemu, 0))) {
                         // Emulator
                         return true;
                 }
                 return false;
         }

         public static final String getGoogleMapsAPiKey() {
                 if (isEmulator()) {
                         return YOUDEVKEY;
                 }
                 return YOURPRODKEY;
         }

 I've actually deployed this to a device and it seems to work just
 fine.

 - Brill Pappin

 On Apr 5, 1:27 pm, HeHe cnm...@gmail.com wrote:



  Bob, sounds like you are going to devise some Makefile to achieve
  the purpose and i also have to look outside of Eclipse IDE and my code
  to find my machine gun. please forget my problem and have a nice
  breakfast :) thanks anyway for your comments.

  On Apr 5, 9:49 am, Bob Kerns r...@acm.org wrote:

   Your application is ALWAYS going to see Config.DEBUG as FALSE. You
   seem stuck on that. Config.DEBUG has nothing to do with your
   application whatsoever. It  has to do with your device.

   I need to get breakfast, I'm getting grumpy. In addition to the link I
   sent you, look at this link (which is linked from the link I sent
   you!):

  http://developer.android.com/intl/de/reference/android/content/pm/App...

   You get the package manager, and get the application info for your
   program, and examine its flags, to see the state of
   android:debuggable. Again, nothing whatsoever to do with Config.DEBUG,
   which you should forget you ever saw!

   The SDK tool chain provides NO WAY to identify a debug build of your
   application -- because that could mean almost anything.

   YOU need to decide what it means -- you could have a debug build, a
   test build, a build with extra logging, a build that contacts a debug
   version of your back-end service, etc. etc.

   The best way to distinguish them is through the manifest. You can use
   the android:debuggable attribute, but that's not its primary purpose.
   But if your needs align with it, you can use it.

   More generally, you can include metadata in your manifest, and examine
   that to determine how your program behaves. You can also use resources
   for the purpose, but I would prefer such things to be done through the
   manifest.

   I'm planning to start writing up my approach to building multiple
   versions of an application from a single source tree, sometime within
   the next couple days.  One aspect of my approach is that
   android:debuggable='true' is what appears in the manifest, unless I'm
   creating a production build, where it is automatically set to false
   instead. But I don't examine it in my code; I have metadata to control
   various aspects of that. (I also automatically manage build numbers,
   etc).

   On Apr 5, 9:12 am, HeHe cnm...@gmail.com wrote:

thanks for the good idea to turn debuggable apk to red. however, the
problem i am experiencing that even after i set debuggable attribute
in manifest to TRUE and build and launch my apk using Eclipse Run
Debug As, my apk still sees Config.DEBUG as FALSE. so right now i
don't know how my apk can programmatically learn that it is a debug
built. do you have a snippet teaching me how? thanks in adavance.

On Apr 5, 8:59 am, ~ TreKing treking...@gmail.com wrote:

 On Mon, Apr 5, 2010 at 10:42 AM, HeHe cnm...@gmail.com wrote:
  but what i need is some info telling my apk that it was a debug or 
  release
  built without changing the debuggable attribute in manifest each 
  time
  between debug/release builds.

 This is not possible. You will have to make sure to remember to 
 change

[android-developers] Re: how to DEBUG build an APK?

2010-04-05 Thread HeHe
thanks and have a nice lunch :)

On Apr 5, 11:55 am, ~ TreKing treking...@gmail.com wrote:
 On Mon, Apr 5, 2010 at 12:39 PM, Brill Pappin br...@pappin.ca wrote:
  My solution was a little bit of code that checks to see if your running in
  the emulator or not.

 Running in the emulator IS NOT the same as running in debug. You can run a
 release APK on the emulator (and you should be for testing any
 configurations you don't have a device for before publishing your app).

 And running on a device IS NOT the same as running in release. You can (and
 should) run a debug APK on a real device while you're developing it.

 On Mon, Apr 5, 2010 at 1:31 PM, HeHe cnm...@gmail.com wrote:
  because there seems to me no way to tell build type of an apk

 I'm blown away by your inability or outright refusal to follow the advice
 posted here thus far.
 The easiest and most straightforward way to check for debug mode is the
 debuggable attribute in your manifest that has been mentioned about 50 times
 now, which Bob posted a link to so you can check it at run time.

 All you have to do is check for that one flag. That's it. You should be
 running in debug mode (i.e., debuggable=true) about 99% of the time. When
 you're ready to publish your app, it takes about 1 SECOND to switch that
 flag to false before you rebuild your app for a release version. This is
 so easy and happens so infrequently, that it really, truly IS NOT WORTH THE
 EFFORT you're spending trying to find some clever trick to determine this
 automatically.

 THAT'S IT. Why is that so flipping complicated to understand?

 --- 
 --
 TreKing - Chicago transit tracking app for Android-powered 
 deviceshttp://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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: how to DEBUG build an APK?

2010-04-04 Thread HeHe
yes, i was talking about Config.DEBUG constant.

how can i make a debug build in Eclipse IDE?

right now, no matter if i use RunRun As or RunDebug As menu
commands, i always see Config.DEBUG == false.

i am using Eclipse v3.4.1 and Android SDK 1.6.

thanks in advance for further answer!!

On Apr 4, 1:35 pm, Xavier Ducrohet x...@android.com wrote:
 If you are talking 
 abouthttp://d.android.com/reference/android/util/Config.html#DEBUG
 then it's based on whether the device build is a debug build. It has
 nothing to do with your app.

 BTW, if Config.DEBUG is true, (for example in the emulator), then
 putting debuggable=true in your manifest is not needed (the app will
 be debuggable by default).

 Xav





 On Sat, Apr 3, 2010 at 11:06 PM, HeHe cnm...@gmail.com wrote:
  thanks.

  i did, otherwise ADT build tool would complain it.

  do you get a true Config.DEBUG value with your apk?

  On Apr 3, 7:53 pm, JP joachim.pfeif...@gmail.com wrote:
  On Apr 3, 4:30 pm, HeHe cnm...@gmail.com wrote: yes, the flag is set to 
  true.

  In the right location? In the manifest, it must be placed like this:
  application
      android:debuggable=true

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

  To unsubscribe, reply using remove me as the subject.

 --
 Xavier Ducrohet
 Android SDK Tech Lead
 Google Inc.

 Please do not send me questions directly. Thanks!

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


[android-developers] Re: how to DEBUG build an APK?

2010-04-04 Thread HeHe
it does not work. here is the setting in my manifest.xml:

application
android:name=com.xxx.yyy
android:label=@string/app_name
android:icon=@drawable/icon_zzz
android:debuggable=true


my apk stills gets a *false* Config.DEBUG value.


On Apr 4, 6:40 pm, ~ TreKing treking...@gmail.com wrote:
 On Sun, Apr 4, 2010 at 6:20 PM, HeHe cnm...@gmail.com wrote:
  how can i make a debug build in Eclipse IDE?

 Use the debuggable flag in your manifest.

   right now, no matter if i use RunRun As or RunDebug As menu
  commands, i always see Config.DEBUG == false.

 Didn't Xavier just answer this for you?

 On Sun, Apr 4, 2010 at 3:35 PM, Xavier Ducrohet x...@android.com wrote:
  If you are talking about
 http://d.android.com/reference/android/util/Config.html#DEBUGthen it's
  based on whether the device build is a debug build. It has nothing to do
  with your app.

 --- 
 --
 TreKing - Chicago transit tracking app for Android-powered 
 deviceshttp://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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: how to DEBUG build an APK?

2010-04-04 Thread HeHe
thanks.

i did, otherwise ADT build tool would complain it.

do you get a true Config.DEBUG value with your apk?

On Apr 3, 7:53 pm, JP joachim.pfeif...@gmail.com wrote:
 On Apr 3, 4:30 pm, HeHe cnm...@gmail.com wrote: yes, the flag is set to 
 true.

 In the right location? In the manifest, it must be placed like this:
 application
     android:debuggable=true





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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: how to DEBUG build an APK?

2010-04-03 Thread HeHe
yes, the flag is set to true.

but Config.DEBUG seems always false no matter what.


On Apr 3, 12:13 pm, ~ TreKing treking...@gmail.com wrote:
 On Fri, Apr 2, 2010 at 6:55 PM, HeHe cnm...@gmail.com wrote:
  does anyone know how to DEBUG build an APK and launch it directly
  with Eclipse?

 Is the debuggable flag in your manifest set to true?

 --- 
 --
 TreKing - Chicago transit tracking app for Android-powered 
 deviceshttp://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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: Displays on emulator, not on phone

2010-04-02 Thread HeHe
perhaps need to check map api key.

map api key for emulator seems not usable for phone.

On Apr 2, 5:51 am, RMD rmdel...@gmail.com wrote:
 The following code will display location data  on the screen in the
 emulator but not on an actual device.  Any ideas on why?

 Thank you for any help.

 line from android manifest:
 uses-permission
 android:name=android.permission.ACCESS_FINE_LOCATION/uses-
 permission

 .java file:
 package xxx..;

 import java.util.ArrayList;
 import java.util.List;

 import android.app.Activity;
 import android.content.Context;
 import android.location.Location;
 import android.location.LocationListener;
 import android.location.LocationManager;
 import android.os.Bundle;
 import android.util.Log;
 import android.widget.TextView;

 public class xxx extends Activity {

         //Log of GPS data
         ListString stalker = new ArrayListString();

     /** Called when the activity is first created. */
     @Override
     public void onCreate(Bundle savedInstanceState) {

         //=
         //      Calling parent and pass in savedInstanceState
         //=
         super.onCreate(savedInstanceState);

     private void setupListener()
     {
         //
 =
         //      get locationMananger object from the system service map
         //
 =
         LocationManager locm = (LocationManager)
 getSystemService(Context.LOCATION_SERVICE);

                 //
 ==
                 //  Instantiate and override methods in the LocationListener
                 //      Could be done with subclassing
                 //
 ==
                 LocationListener onLocationChange=new LocationListener() {
                         public void onLocationChanged(Location location) {

                         } public void onProviderDisabled(String provider) {
                                 // required for interface, not used
                         }
                         public void onProviderEnabled(String provider) {
                                 // required for interface, not used
                         }
                         public void onStatusChanged(String provider, int 
 status,
 Bundle extras) {
                                 // required for interface, not used
                         }};
                         //
 ==
                         //      register the listener with the Location 
 Manager to
 receive
                         //      updates when the nav data changes
                         //
 ==

                 locm.requestLocationUpdates(gps, 0, 0,onLocationChange);
     }
     //addToLog add location information into already created List
 called Stalker
     public void addToLog(String v)
     {
         //=
         //      Instantiate TextView and pass in a pointer to myself
         //=
         TextView tv = new TextView(this);
         tv.setText(v);

         //=
         //      Calling parent setContentView
         //=
         setContentView(tv)
     }



 }

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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: Displays on emulator, not on phone

2010-04-02 Thread HeHe
Mark,

thanks for the information.

before it, i've been the wrong knowledge that apk running on real
phone is in 'production' mode and should use 'production' map api key -
_||

is there any way that an apk can know whether it is running in 'debug'
or 'production' mode?

thanks!

On Apr 2, 12:51 pm, Mark Murphy mmur...@commonsware.com wrote:
 HeHe wrote:
  perhaps need to check map api key.

  map api key for emulator seems not usable for phone.

 The same Google Maps add-on API key works fine on both the emulator and
 the device. Where things differ is when you change the APK signing from
 debug mode (normal) to production mode -- *then* you need to use
 different Maps API keys.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|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

To unsubscribe, reply using remove me as the subject.


[android-developers] how to DEBUG build an APK?

2010-04-02 Thread HeHe
does anyone know how to DEBUG build an APK and launch it directly with
Eclipse?

in my case, no matter whether i use Run or Debug menu command in
Eclipse, my apk always logs Config.DEBUG as false, although
obviously the apk is signed with the key in factory debug.store.

please help. thank you!

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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: Displays on emulator, not on phone

2010-04-02 Thread HeHe
someone said Config.DEBUG or Config.RELEASE may help.

however, when i build and run my apk by the Debug menu item within
Eclipse IDE, my apk always logs Config.DEBUG to be false.

do you or anyone else have an idea of how to have a DEBUG build and
have Config.DEBUG to have correct value (true)?

thank you.

On Apr 2, 3:54 pm, Mark Murphy mmur...@commonsware.com wrote:
 HeHe wrote:
  Mark,

  thanks for the information.

  before it, i've been the wrong knowledge that apk running on real
  phone is in 'production' mode and should use 'production' map api key -
  _||

  is there any way that an apk can know whether it is running in 'debug'
  or 'production' mode?

 I am not aware of a way to check whether you were signed with a debug or
 production key from inside the app. There might be a way, and I would
 expect it to be somewhere in the android.content.pm package, but I
 cannot find anything obvious.

 Sorry!

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

 Android Development Wiki:http://wiki.andmob.org

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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: real ip address

2010-03-30 Thread HeHe

you need a 'mirror' to tell you the real ip address.

the mirror may be a STUN server; or, any peer can do the work.


On Mar 30, 5:52 am, mscwd01 mscw...@gmail.com wrote:
 The only way I found to do this was by opening a socket connection and
 reading the IP that way. I couldn't find a nice getIP() method.

 On Mar 30, 11:32 am, Engin Arslan enginarsla...@gmail.com wrote:



  Hi All ,
  Can I get real ip address of android phone

  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

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


[android-developers] Re: Audio Flickering - my code, my computer or android emulator?

2010-03-23 Thread HeHe
(samples)

i can imagine that the write will block long enough for the
AudioRecord to overflow as you don't read in the next buffer of
samples early enough. You could try decreasing the number of samples
you read and write so the write will not block as long. No idea
whether that will solve the problem.

hth,
Mario

On 18 Mrz., 00:33, HeHe cnm...@gmail.com wrote:

 no, i havent, because my app runs ok on g1 with 1.6 firmware. it just
 runs weird on 1.6 emulator. so i am 90% happy already.

 btw, my app does not record and play audio at the same time, but it
 encodes audio with speex, which should take overhead no less than
 playback, i guess.

 anyway, i wish you lucks and hope goodle folks will help you solve the
 issue.

 On Mar 17, 8:55 am, Gabriel Simões gsim...@gmail.com wrote:

  Installing ubuntu 9.1 on my machine.
  I will try using linux to develop as I think it will be less 
  confusing
  to develop using NDK.

  Hehe: I was thinking about trying to get an answer from someone from
  Google tomorrow at irc. Have you ever tried it?

  Won´t anyone who is actually using AudioRecord with success show up
  and tell us what we are doing wrong? :(

  On 17 mar, 12:53, HeHe cnm...@gmail.com wrote:

   i heard that too. but some google folk seemed discouraging use of 
   the
   stuff.

   On Mar 17, 6:27 am, Gabriel Simões gsim...@gmail.com wrote:

Nope,

I´ve paid attention to see if GC was being called, but nothing 
shows
up on LogCat.
Well, I´ve found some posts on the internet about using 
AudioRecord´s
native implementation. Isn´t it supported anymore?

I still can´t believe we are spending so much time on something 
that
should be plug and play. It´s almost becoming plug and pray!

On 17 mar, 02:41, HeHe cnm...@gmail.com wrote:

 if you find any native audio interfaces in NDK, please share 
 it with
 me first :)

 for your issue, did you check GC? that is, around the time 
 when you
 see buffer overflow msgs, does GC happen too?

 On Mar 16, 7:33 pm, Gabriel Simões gsim...@gmail.com wrote:

  *** Idea ...
  Using the NDK native audio interfaces should solve this 
  problem?

  On 16 mar, 22:26, Gabriel Simões gsim...@gmail.com wrote:

   News, but no good news...

   I´ve tried the source code above on another machine 
   running the sdk
   2.1, an AVD with default parameters plus audio record and 
   audio
   playback capabilities, another operational system 
   (linux), etc.
   The results? the same we had before  audio delay 
   (long delay),
   chopping, distortion and a metalic voice.

   I can not believe nobody here in this forum hasn´t been 
   able to
   develop any app that can record from the microfone using 
   AudioRecord.
   Also, anyone here hasn´t even made a loop back from 
   microfone to line
   out to check the audio being recorded?

   Please, c´mon guys ... this is not a commercial secret, 
   this won´t
   increase competition, and I really can´t see any other 
   reasons not to
   see some posts from developers who work with audio or 
   other signal
   processing using Android.

   Please, show us a way to go because I´ve tried almost all 
   the
   possibilities here (the only one left is to try using a 
   real device)
   and revising the code I can´t find what else it could be.

   *Obs: once again, a program with a thread only to read 
   from
   AudioRecord and play with AudioTrack is giving warnings 
   about buffer
   overflows (Audio Record). There´s no processing going on 
   and since I
   haven´t found anything related to AudioTrack.play() 
   blocks until the
   audio stream is played, based on it´s actuall behavior 
   in my app I can
   ´t see how this class could be useful
   for online audio processing applications.

   Thank you,
   Gabriel

   On 15 mar, 20:53, Gabriel Simões gsim...@gmail.com 
   wrote:...

 read more »

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

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

[android-developers] Re: Audio Flickering - my code, my computer or android emulator?

2010-03-17 Thread HeHe
i heard that too. but some google folk seemed discouraging use of the
stuff.

On Mar 17, 6:27 am, Gabriel Simões gsim...@gmail.com wrote:
 Nope,

 I´ve paid attention to see if GC was being called, but nothing shows
 up on LogCat.
 Well, I´ve found some posts on the internet about using AudioRecord´s
 native implementation. Isn´t it supported anymore?

 I still can´t believe we are spending so much time on something that
 should be plug and play. It´s almost becoming plug and pray!

 On 17 mar, 02:41, HeHe cnm...@gmail.com wrote:



  if you find any native audio interfaces in NDK, please share it with
  me first :)

  for your issue, did you check GC? that is, around the time when you
  see buffer overflow msgs, does GC happen too?

  On Mar 16, 7:33 pm, Gabriel Simões gsim...@gmail.com wrote:

   *** Idea ...
   Using the NDK native audio interfaces should solve this problem?

   On 16 mar, 22:26, Gabriel Simões gsim...@gmail.com wrote:

News, but no good news...

I´ve tried the source code above on another machine running the sdk
2.1, an AVD with default parameters plus audio record and audio
playback capabilities, another operational system (linux), etc.
The results? the same we had before  audio delay (long delay),
chopping, distortion and a metalic voice.

I can not believe nobody here in this forum hasn´t been able to
develop any app that can record from the microfone using AudioRecord.
Also, anyone here hasn´t even made a loop back from microfone to line
out to check the audio being recorded?

Please, c´mon guys ... this is not a commercial secret, this won´t
increase competition, and I really can´t see any other reasons not to
see some posts from developers who work with audio or other signal
processing using Android.

Please, show us a way to go because I´ve tried almost all the
possibilities here (the only one left is to try using a real device)
and revising the code I can´t find what else it could be.

*Obs: once again, a program with a thread only to read from
AudioRecord and play with AudioTrack is giving warnings about buffer
overflows (Audio Record). There´s no processing going on and since I
haven´t found anything related to AudioTrack.play() blocks until the
audio stream is played, based on it´s actuall behavior in my app I can
´t see how this class could be useful
for online audio processing applications.

Thank you,
Gabriel

On 15 mar, 20:53, Gabriel Simões gsim...@gmail.com wrote:

 Well, just to try I´ve downloaded the SDK 1.6 (v. 4), created a new
 AVD based on that and then tried the source code from the first post
 in two different situations:

 - App compiled using SDK 1.6 on an AVD running 1.6
 - App compiled using SDK 1.6 on an AVD running 2.1

 Had exactly the same results as compiling and running on 2.1: audio
 chopping, distortion and artfacts even if I solo the microfone input
 level (using a 1 second buffer, sometimes the audio decays in a lot
 longer) and AudioRecord buffer overflow messages even if all I do in
 the thread is to read from AudioRecord and to play using AudioTrack.

 Tomorrow I will try to test my code using another computer and even
 on
 a real device. In the mean time, any other ideas?

 Gabriel

 On 15 mar, 01:31, HeHe cnm...@gmail.com wrote:

  no chopping, likely because my computer (Core2 E8400) is lightening
  fast.

  my AudioRecord.read() returns a value equal to my buffer size, too.

  however, it returns recorded samples in a speed faster than 8khz,
  which makes later playback sound like my voice is slowed.

  again, the same code works correctly on 1.5 emulator.

  so, seems your problem is not the same as mine :(

  On Mar 14, 6:53 pm, Gabriel Simões gsim...@gmail.com wrote:

   Audio chopping also?
   Could you please test the code above?

   I´ve checked and AudioRecord.read() returns a value equal to my 
   buffer
   size. Based on that I understand that AudioRecord.read() blocks 
   the
   execution, waits for the buffer to get a number of samples at 
   least
   equal to the buffer size and then it returns the audio stream 
   (older
   buffer size number of samples in the AudioRecord internal 
   buffer).

   On 14 mar, 22:34, HeHe cnm...@gmail.com wrote:

seems i am experiencing similar issue as you 
r.http://groups.google.com/group/android-developers/browse_thread/threa...

without any single line of code modification to my app, the 
count of
frames recorded by app running on sdk 1.6 emulator is 
significantly
more than that recorded by the same app running on sdk 1.5 
emulator.

however, the same app runs equally well on both 1.5/1.6 
emulators.

it is weird.

On Mar 14, 3:00 pm

[android-developers] Re: Audio Flickering - my code, my computer or android emulator?

2010-03-17 Thread HeHe
no, i havent, because my app runs ok on g1 with 1.6 firmware. it just
runs weird on 1.6 emulator. so i am 90% happy already.

btw, my app does not record and play audio at the same time, but it
encodes audio with speex, which should take overhead no less than
playback, i guess.

anyway, i wish you lucks and hope goodle folks will help you solve the
issue.

On Mar 17, 8:55 am, Gabriel Simões gsim...@gmail.com wrote:
 Installing ubuntu 9.1 on my machine.
 I will try using linux to develop as I think it will be less confusing
 to develop using NDK.

 Hehe: I was thinking about trying to get an answer from someone from
 Google tomorrow at irc. Have you ever tried it?

 Won´t anyone who is actually using AudioRecord with success show up
 and tell us what we are doing wrong? :(

 On 17 mar, 12:53, HeHe cnm...@gmail.com wrote:



  i heard that too. but some google folk seemed discouraging use of the
  stuff.

  On Mar 17, 6:27 am, Gabriel Simões gsim...@gmail.com wrote:

   Nope,

   I´ve paid attention to see if GC was being called, but nothing shows
   up on LogCat.
   Well, I´ve found some posts on the internet about using AudioRecord´s
   native implementation. Isn´t it supported anymore?

   I still can´t believe we are spending so much time on something that
   should be plug and play. It´s almost becoming plug and pray!

   On 17 mar, 02:41, HeHe cnm...@gmail.com wrote:

if you find any native audio interfaces in NDK, please share it with
me first :)

for your issue, did you check GC? that is, around the time when you
see buffer overflow msgs, does GC happen too?

On Mar 16, 7:33 pm, Gabriel Simões gsim...@gmail.com wrote:

 *** Idea ...
 Using the NDK native audio interfaces should solve this problem?

 On 16 mar, 22:26, Gabriel Simões gsim...@gmail.com wrote:

  News, but no good news...

  I´ve tried the source code above on another machine running the sdk
  2.1, an AVD with default parameters plus audio record and audio
  playback capabilities, another operational system (linux), etc.
  The results? the same we had before  audio delay (long delay),
  chopping, distortion and a metalic voice.

  I can not believe nobody here in this forum hasn´t been able to
  develop any app that can record from the microfone using 
  AudioRecord.
  Also, anyone here hasn´t even made a loop back from microfone to 
  line
  out to check the audio being recorded?

  Please, c´mon guys ... this is not a commercial secret, this won´t
  increase competition, and I really can´t see any other reasons not 
  to
  see some posts from developers who work with audio or other signal
  processing using Android.

  Please, show us a way to go because I´ve tried almost all the
  possibilities here (the only one left is to try using a real device)
  and revising the code I can´t find what else it could be.

  *Obs: once again, a program with a thread only to read from
  AudioRecord and play with AudioTrack is giving warnings about buffer
  overflows (Audio Record). There´s no processing going on and since I
  haven´t found anything related to AudioTrack.play() blocks until 
  the
  audio stream is played, based on it´s actuall behavior in my app I 
  can
  ´t see how this class could be useful
  for online audio processing applications.

  Thank you,
  Gabriel

  On 15 mar, 20:53, Gabriel Simões gsim...@gmail.com wrote:

   Well, just to try I´ve downloaded the SDK 1.6 (v. 4), created a 
   new
   AVD based on that and then tried the source code from the first 
   post
   in two different situations:

   - App compiled using SDK 1.6 on an AVD running 1.6
   - App compiled using SDK 1.6 on an AVD running 2.1

   Had exactly the same results as compiling and running on 2.1: 
   audio
   chopping, distortion and artfacts even if I solo the microfone 
   input
   level (using a 1 second buffer, sometimes the audio decays in a 
   lot
   longer) and AudioRecord buffer overflow messages even if all I do 
   in
   the thread is to read from AudioRecord and to play using 
   AudioTrack.

   Tomorrow I will try to test my code using another computer and 
   even
   on
   a real device. In the mean time, any other ideas?

   Gabriel

   On 15 mar, 01:31, HeHe cnm...@gmail.com wrote:

no chopping, likely because my computer (Core2 E8400) is 
lightening
fast.

my AudioRecord.read() returns a value equal to my buffer size, 
too.

however, it returns recorded samples in a speed faster than 
8khz,
which makes later playback sound like my voice is slowed.

again, the same code works correctly on 1.5 emulator.

so, seems your problem is not the same as mine :(

On Mar 14, 6:53 pm, Gabriel Simões gsim

[android-developers] Re: Audio Flickering - my code, my computer or android emulator?

2010-03-16 Thread HeHe
if you find any native audio interfaces in NDK, please share it with
me first :)

for your issue, did you check GC? that is, around the time when you
see buffer overflow msgs, does GC happen too?

On Mar 16, 7:33 pm, Gabriel Simões gsim...@gmail.com wrote:
 *** Idea ...
 Using the NDK native audio interfaces should solve this problem?

 On 16 mar, 22:26, Gabriel Simões gsim...@gmail.com wrote:



  News, but no good news...

  I´ve tried the source code above on another machine running the sdk
  2.1, an AVD with default parameters plus audio record and audio
  playback capabilities, another operational system (linux), etc.
  The results? the same we had before  audio delay (long delay),
  chopping, distortion and a metalic voice.

  I can not believe nobody here in this forum hasn´t been able to
  develop any app that can record from the microfone using AudioRecord.
  Also, anyone here hasn´t even made a loop back from microfone to line
  out to check the audio being recorded?

  Please, c´mon guys ... this is not a commercial secret, this won´t
  increase competition, and I really can´t see any other reasons not to
  see some posts from developers who work with audio or other signal
  processing using Android.

  Please, show us a way to go because I´ve tried almost all the
  possibilities here (the only one left is to try using a real device)
  and revising the code I can´t find what else it could be.

  *Obs: once again, a program with a thread only to read from
  AudioRecord and play with AudioTrack is giving warnings about buffer
  overflows (Audio Record). There´s no processing going on and since I
  haven´t found anything related to AudioTrack.play() blocks until the
  audio stream is played, based on it´s actuall behavior in my app I can
  ´t see how this class could be useful
  for online audio processing applications.

  Thank you,
  Gabriel

  On 15 mar, 20:53, Gabriel Simões gsim...@gmail.com wrote:

   Well, just to try I´ve downloaded the SDK 1.6 (v. 4), created a new
   AVD based on that and then tried the source code from the first post
   in two different situations:

   - App compiled using SDK 1.6 on an AVD running 1.6
   - App compiled using SDK 1.6 on an AVD running 2.1

   Had exactly the same results as compiling and running on 2.1: audio
   chopping, distortion and artfacts even if I solo the microfone input
   level (using a 1 second buffer, sometimes the audio decays in a lot
   longer) and AudioRecord buffer overflow messages even if all I do in
   the thread is to read from AudioRecord and to play using AudioTrack.

   Tomorrow I will try to test my code using another computer and even
   on
   a real device. In the mean time, any other ideas?

   Gabriel

   On 15 mar, 01:31, HeHe cnm...@gmail.com wrote:

no chopping, likely because my computer (Core2 E8400) is lightening
fast.

my AudioRecord.read() returns a value equal to my buffer size, too.

however, it returns recorded samples in a speed faster than 8khz,
which makes later playback sound like my voice is slowed.

again, the same code works correctly on 1.5 emulator.

so, seems your problem is not the same as mine :(

On Mar 14, 6:53 pm, Gabriel Simões gsim...@gmail.com wrote:

 Audio chopping also?
 Could you please test the code above?

 I´ve checked and AudioRecord.read() returns a value equal to my buffer
 size. Based on that I understand that AudioRecord.read() blocks the
 execution, waits for the buffer to get a number of samples at least
 equal to the buffer size and then it returns the audio stream (older
 buffer size number of samples in the AudioRecord internal buffer).

 On 14 mar, 22:34, HeHe cnm...@gmail.com wrote:

  seems i am experiencing similar issue as you 
  r.http://groups.google.com/group/android-developers/browse_thread/threa...

  without any single line of code modification to my app, the count of
  frames recorded by app running on sdk 1.6 emulator is significantly
  more than that recorded by the same app running on sdk 1.5 emulator.

  however, the same app runs equally well on both 1.5/1.6 emulators.

  it is weird.

  On Mar 14, 3:00 pm, Gabriel Simões gsim...@gmail.com wrote:

   Hello,

   Since my day 1 I´ve been facing problems with Android AudioRecord 
   API.
   After a lot of research and a lot more trial and error I´ve found 
   my
   way into the code and was able to write an asynctask for audio 
   streams
   recording which encapsules most of the audiorecord and asynctask
   features as a lib, so the developers doesn´t need to worry about
   finding the best audio parameters, work on stop and release, etc.
   So far, everything was right.
   Yesterday I started trying to process the audio I got from the
   microfone input and my code was reacting bad. I revisited it many
   times and decided then to check the audio I

[android-developers] Re: Audio Flickering - my code, my computer or android emulator?

2010-03-14 Thread HeHe
seems i am experiencing similar issue as you r.
http://groups.google.com/group/android-developers/browse_thread/thread/ad81d19418c8db1d/561f66e6b0cf2c79?show_docid=561f66e6b0cf2c79

without any single line of code modification to my app, the count of
frames recorded by app running on sdk 1.6 emulator is significantly
more than that recorded by the same app running on sdk 1.5 emulator.

however, the same app runs equally well on both 1.5/1.6 emulators.

it is weird.

On Mar 14, 3:00 pm, Gabriel Simões gsim...@gmail.com wrote:
 Hello,

 Since my day 1 I´ve been facing problems with Android AudioRecord API.
 After a lot of research and a lot more trial and error I´ve found my
 way into the code and was able to write an asynctask for audio streams
 recording which encapsules most of the audiorecord and asynctask
 features as a lib, so the developers doesn´t need to worry about
 finding the best audio parameters, work on stop and release, etc.
 So far, everything was right.
 Yesterday I started trying to process the audio I got from the
 microfone input and my code was reacting bad. I revisited it many
 times and decided then to check the audio I was getting from the mic.
 Created in instance of AudioTrack and tried to play it back. The sound
 was horrible, with lots of chopping, lots of distortion and giving me
 even the sensation of low samplerate playback (a single word spoken
 sometimes lasted for seconds on the earphone).
 To check if it was actually my code I went for the internet and found
 the code above. Tried it and got the same results. The only thing that
 comes to my mind actually is that, it doesn´t matter what I do and the
 configuration I try, I always get the buffer overflow message. Even if
 I don´t actually do anything but read from AudioRecord and write to
 AudioTrack (example above, and not in debug mode). If the emulator can
 ´t do it fast enought  then I´m completly lost here.

 Based on the output of my algorithm I think the audio streams I´m
 reading are not right.

 Have anyone faced this? does anyone know how to solve it? Could anyone
 try the code (copy and paste) and check if it´s actually my computer
 or my emulator?

 package com.example.test;

 import android.app.Activity;
 import android.content.Context;
 import android.media.AudioFormat;
 import android.media.AudioManager;
 import android.media.AudioRecord;
 import android.media.AudioTrack;
 import android.media.MediaRecorder;
 import android.os.Bundle;

 public class test extends Activity {

     boolean isRecording; //currently not used
     AudioManager am;

    /** Called when the activity is first created. */
   �...@override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        am = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
        Record record = new Record();
        record.run();

    }

       public class Record extends Thread
       {
              // SoundPower sndPower = new SoundPower();

               static final int bufferSize = 20;
               final short[] buffer = new short[bufferSize];
               short[] readBuffer = new short[bufferSize];

               public void run() {
                 isRecording = true;
                 android.os.Process.setThreadPriority
                 (android.os.Process.THREAD_PRIORITY_URGENT_AUDIO);

                 int buffersize = AudioRecord.getMinBufferSize(8000,
                 AudioFormat.CHANNEL_CONFIGURATION_MONO,
                 AudioFormat.ENCODING_PCM_16BIT);
                 buffersize = 2048;

                                AudioRecord arec = new
 AudioRecord(MediaRecorder.AudioSource.MIC,
                                                8000,

 AudioFormat.CHANNEL_CONFIGURATION_MONO,

 AudioFormat.ENCODING_PCM_16BIT,
                                                buffersize);

                                AudioTrack atrack = new
 AudioTrack(AudioManager.STREAM_VOICE_CALL,
                                                8000,

 AudioFormat.CHANNEL_CONFIGURATION_MONO,

 AudioFormat.ENCODING_PCM_16BIT,
                                                buffersize,

 AudioTrack.MODE_STREAM);

                                atrack.setPlaybackRate(8000);

                                byte[] buffer = new byte[buffersize];
                                arec.startRecording();
                                atrack.play();

                                while(isRecording) {
                                        arec.read(buffer, 0,
 buffersize);
                                        atrack.write(buffer, 0,
 buffer.length);
                                }

                                arec.stop();
                                atrack.stop();
                                isRecording = false;
               }
       }

 }

 This code is not mine. I´ve just cut and replaced some values (as the
 SampleRate) so it would work.

 

[android-developers] Re: Audio Flickering - my code, my computer or android emulator?

2010-03-14 Thread HeHe
no chopping, likely because my computer (Core2 E8400) is lightening
fast.

my AudioRecord.read() returns a value equal to my buffer size, too.

however, it returns recorded samples in a speed faster than 8khz,
which makes later playback sound like my voice is slowed.

again, the same code works correctly on 1.5 emulator.

so, seems your problem is not the same as mine :(



On Mar 14, 6:53 pm, Gabriel Simões gsim...@gmail.com wrote:
 Audio chopping also?
 Could you please test the code above?

 I´ve checked and AudioRecord.read() returns a value equal to my buffer
 size. Based on that I understand that AudioRecord.read() blocks the
 execution, waits for the buffer to get a number of samples at least
 equal to the buffer size and then it returns the audio stream (older
 buffer size number of samples in the AudioRecord internal buffer).

 On 14 mar, 22:34, HeHe cnm...@gmail.com wrote:



  seems i am experiencing similar issue as you 
  r.http://groups.google.com/group/android-developers/browse_thread/threa...

  without any single line of code modification to my app, the count of
  frames recorded by app running on sdk 1.6 emulator is significantly
  more than that recorded by the same app running on sdk 1.5 emulator.

  however, the same app runs equally well on both 1.5/1.6 emulators.

  it is weird.

  On Mar 14, 3:00 pm, Gabriel Simões gsim...@gmail.com wrote:

   Hello,

   Since my day 1 I´ve been facing problems with Android AudioRecord API.
   After a lot of research and a lot more trial and error I´ve found my
   way into the code and was able to write an asynctask for audio streams
   recording which encapsules most of the audiorecord and asynctask
   features as a lib, so the developers doesn´t need to worry about
   finding the best audio parameters, work on stop and release, etc.
   So far, everything was right.
   Yesterday I started trying to process the audio I got from the
   microfone input and my code was reacting bad. I revisited it many
   times and decided then to check the audio I was getting from the mic.
   Created in instance of AudioTrack and tried to play it back. The sound
   was horrible, with lots of chopping, lots of distortion and giving me
   even the sensation of low samplerate playback (a single word spoken
   sometimes lasted for seconds on the earphone).
   To check if it was actually my code I went for the internet and found
   the code above. Tried it and got the same results. The only thing that
   comes to my mind actually is that, it doesn´t matter what I do and the
   configuration I try, I always get the buffer overflow message. Even if
   I don´t actually do anything but read from AudioRecord and write to
   AudioTrack (example above, and not in debug mode). If the emulator can
   ´t do it fast enought  then I´m completly lost here.

   Based on the output of my algorithm I think the audio streams I´m
   reading are not right.

   Have anyone faced this? does anyone know how to solve it? Could anyone
   try the code (copy and paste) and check if it´s actually my computer
   or my emulator?

   package com.example.test;

   import android.app.Activity;
   import android.content.Context;
   import android.media.AudioFormat;
   import android.media.AudioManager;
   import android.media.AudioRecord;
   import android.media.AudioTrack;
   import android.media.MediaRecorder;
   import android.os.Bundle;

   public class test extends Activity {

       boolean isRecording; //currently not used
       AudioManager am;

      /** Called when the activity is first created. */
     �...@override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
          am = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
          Record record = new Record();
          record.run();

      }

         public class Record extends Thread
         {
                // SoundPower sndPower = new SoundPower();

                 static final int bufferSize = 20;
                 final short[] buffer = new short[bufferSize];
                 short[] readBuffer = new short[bufferSize];

                 public void run() {
                   isRecording = true;
                   android.os.Process.setThreadPriority
                   (android.os.Process.THREAD_PRIORITY_URGENT_AUDIO);

                   int buffersize = AudioRecord.getMinBufferSize(8000,
                   AudioFormat.CHANNEL_CONFIGURATION_MONO,
                   AudioFormat.ENCODING_PCM_16BIT);
                   buffersize = 2048;

                                  AudioRecord arec = new
   AudioRecord(MediaRecorder.AudioSource.MIC,
                                                  8000,

   AudioFormat.CHANNEL_CONFIGURATION_MONO,

   AudioFormat.ENCODING_PCM_16BIT,
                                                  buffersize);

                                  AudioTrack atrack = new
   AudioTrack

[android-developers] Re: More Map Troubles

2010-03-12 Thread HeHe
did you also get this error:

java.lang.IllegalAccessError: cross-loader access from pre-verified
class ??


On Mar 11, 10:39 am, Jason Kahler jason.kah...@gmail.com wrote:
 I have been trying to get a MapActivty to run properly in me app for a few
 days now. I have a class that extends MapActivity. I have my map api key
 properly defined in the layout xml file.
 I have built against the Google APi version 4? (whatever maps to android
 1.6) I can compile fine but My app throws a ClassDefNotFound error for my
 MyActivity class(the one that extends MapActivity
 ) I also added the uses-lib tag in the manifest. I have no idea what I'm
 missing please help.

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


[android-developers] Re: How to add my own Audio codec to AudioRecord?

2010-03-10 Thread HeHe
i believe you should use a short[] buffer in your AudioRecord.read().

on return, you pass the short[] buffer to you encoder and that is it.

On Mar 10, 3:39 am, draf...@gmail.com draf...@gmail.com wrote:
 I currently have a Loop back program for testing Audio on Android
 devices.

 It uses AudioRecord and AudioTrack to record PCM audio from the Mic
 and play PCM audio out the earpiece.

 Here is the code:

 public class Record extends Thread
   {

           static final int bufferSize = 20;
           final short[] buffer = new short[bufferSize];
           short[] readBuffer = new short[bufferSize];

           public void run() {
             isRecording = true;
             android.os.Process.setThreadPriority
             (android.os.Process.THREAD_PRIORITY_URGENT_AUDIO);

             int buffersize = AudioRecord.getMinBufferSize(11025,
             AudioFormat.CHANNEL_CONFIGURATION_MONO,
             AudioFormat.ENCODING_PCM_16BIT);

                            arec = new
 AudioRecord(MediaRecorder.AudioSource.MIC,
                                            11025,

 AudioFormat.CHANNEL_CONFIGURATION_MONO,

 AudioFormat.ENCODING_PCM_16BIT,
                                            buffersize);

                            atrack = new
 AudioTrack(AudioManager.STREAM_VOICE_CALL,
                                            11025,

 AudioFormat.CHANNEL_CONFIGURATION_MONO,

 AudioFormat.ENCODING_PCM_16BIT,
                                            buffersize,
                                            AudioTrack.MODE_STREAM);

                            atrack.setPlaybackRate(11025);

                            byte[] buffer = new byte[buffersize];
                            arec.startRecording();
                            atrack.play();

                            while(isRecording) {

                                    arec.read(buffer, 0, buffersize);
                                    atrack.write(buffer, 0,
 buffer.length);
                            }
           }
   }

 So as you can see in the creation of the AudioTrack and AudioRecord
 the Encoding is supplied via the AudioFormat but this only allows 16
 bit or 8 bit PCM.

 I have my own G711 Codec implementation now and I want to be able to
 encode the audio from the Mic and decode it going into the EarPiece,
 So I have encode(short lin[], int offset, byte enc[], int frames) and
 decode(byte enc[], short lin[], int frames) methods but I'm unsure as
 to how to use them to encode and the decode the audio from the
 AudioRecord and AudioTrack.

 Can anyone help me or point me in the right direction?

-- 
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: Will TCP Sockets work over cellular network?

2010-03-08 Thread HeHe
i believe opening tcp connections to your game server is ok, at least
with T-Mobile network in US.

just you need be prepared that your tcp connections may not be
persistent since ip of your phone can be frequently changed.

hope you the best.

On Mar 8, 4:53 pm, Gav gav.ai...@googlemail.com wrote:
 Hi All,

 I'm writing a small game for Android and was planning on using the
 Socket class to establish a connection to my server from the Client. I
 had been testing on the emulator only as I don't have an Android phone
 yet. A friend mentioned today that TCP socket connections may not be
 allowed over a cellular network at the network's discretion, is this
 true?

 I can try to use Http and long polling but sockets seem so much
 simpler, if anyone knows a good code sample or concerning the use of
 long polling for two way communication in games then please let me
 know.

 Kind regards,

 Gavin

-- 
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 create an AudioRecor der object

2010-03-07 Thread HeHe
what is the value of the variable SAMPLE_RATE?

On Mar 6, 7:15 pm, Gabriel Simões gsim...@gmail.com wrote:
 First off, thank you for you attention and your help!

 I´ve been trying to create a simple application to learn how android
 handles audio streams for computer music and digital audio processing
 applications.
 Before I start coding I´ve read a lot of material (threads and
 tutorials) about AudioRecorder so I could find my way but
 unfortunately I´m facing a problem that neither google search can find
 recurrencies. Believe it or not! hehehe

 Here is the deal ...
 When my application tries to create a new object from AudioRecorder I
 get 3 error messages (Logcat):

 03-07 02:58:43.048: ERROR/AudioRecord(371): Could not get audio input
 for record source 1
 03-07 02:58:43.048: ERROR/AudioRecord-JNI(371): Error creating
 AudioRecord instance: initialization check failed.
 03-07 02:58:43.109: ERROR/AudioRecord-Java(371):
 [ android.media.AudioRecord ] Error code -20 when initializing native
 AudioRecord object.

 Here is the code I´m using for creating a new AudioRecorder object:
 //---
 package com.examples.audio;

 import android.app.Activity;
 import android.media.AudioFormat;
 import android.media.AudioRecord;
 import android.media.MediaRecorder;
 import android.os.Bundle;
 import android.view.View;
 import android.widget.TextView;

 public class main extends Activity {
     /** Called when the activity is first created. */

     private TextView tvGravacao;
     private AudioRecord audioRecord;

     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.main);
         tvGravacao = (TextView) findViewById(R.id.tvGravacao);
         int BUFFER_SIZE = AudioRecord.getMinBufferSize(8000,
                 AudioFormat.CHANNEL_CONFIGURATION_MONO,
                 AudioFormat.ENCODING_PCM_16BIT);

         audioRecord = new AudioRecord(MediaRecorder.AudioSource.MIC,
                 SAMPLE_RATE,
                 AudioFormat.CHANNEL_CONFIGURATION_MONO,
                 AudioFormat.ENCODING_PCM_16BIT,
                 BUFFER_SIZE);
     }
 //---

 Does anyone have an idea of what could cause this error? My AVD has
 been set up to handle audio input and output, I have recreated it
 twice, have tried adding a permission in AndroidManifest.xml but none
 of them solved my problem.

 I hope someone has figured this out before.

 Thanks,
 Gabriel Simões

 things I have noticed: sample rate must be 8000 and audioformat must
 be ENCODING_PCM_16BIT. SR = 44100 or AF = 8 bit crashes app when
 running AudioRecord.getMinBufferSize();

-- 
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] don't panic in case you see exception java.net.SocketException: The socket level is invalid....

2010-03-07 Thread HeHe
just found this and would like to share my fix with you folks in case
you run into the exception:

if your app sees the exception:

  java.net.SocketException: The socket level is invalid

dont be panic. it occurs when ip of your phone has changed and your
app sends packets via a socket which is still bound to old ip.

refreshing ip value and rebinding the socket to the new ip will fix
the exception.

the exception likely occurs to only real phones, i guess.

happy weekend android coding to you folks ~.~

-- 
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] i was beaten by AudioRecord :-(

2010-03-06 Thread HeHe
after i upgraded SDK from 1.5r2 to 1.6, i found a serious problem:

1). on emulator 1.6, my app using AudioRecord records at a
significantly faster pace than on 1.5 emulator.

for example, after 30 seconds of audio recording (8kHz/mono) on 1.6
emulator, my app records 340,800 samples, which is equivalent to
348000/8000 = 42 secs of voice. playing back these samples at 8kHz
sounds obviously like slowed down spacewalks on the moon.

originally on 1.5 emulator, the same app recorded correctly 240,000
samples.

2). on my G1 phone, the same app built with SDK 1.6  records and plays
back audio frames correctly.

originally with SDK 1.5, the same app code always lost 5-10 secs of
voice frames after 30secs of recording, because the recorder seemed to
run out of G1 cpu power, which made AudioRecord.read() unable to read
off recorded frames *in time*.

though my app seems to run on G1 phone with my satisfaction, i am
confused with the weird and inconsistent behavior of AudioRecord class
described above.

could any Android fork or anyone who is knowledgeable of this issue
shed some light to me, telling how i can let AudioRecord sample voice
frames at identical paces on G1 and emulator?

thanks a lot in advance 

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


[android-developers] Re: ImageView can't be clicked... help!

2010-02-28 Thread HeHe
did you set it clickable?

On Feb 28, 9:41 am, Kofa elk...@gmail.com wrote:
 I tried several times to make it work... i tried searching on google
 but works for everyone but not for me

 Can anyone tell me how to make an image clickable?? i mean, I tried to
 use onClickListener and onClick but nothing seems to work
 onClickListener is always underlined and the error says:
 The type new DialogInterface.OnClickListener(){} must implement the
 inherited abstract method
 DialogInterface.OnClickListener.onClick(DialogInterface, int)

 thx!

-- 
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: AudioTrack.getPlaybackHeadPosi tion() is buggy????

2010-02-26 Thread HeHe
thank you again. yes, i found getPlaybackHeadPosition() in your
posts.

since my sampling rate is 8000, i have no problem with
getPlaybackHeadPosition() if pause() is NOT called.

On Feb 26, 1:06 am, blindfold seeingwithso...@gmail.com wrote:
  thanks, though therein i didnt find anything about
  getPlaybackHeadPosition() 

 Then you missed my posts 12 and 13 in that thread,

 http://groups.google.com/group/android-developers/tree/browse_frm/thr...

 as well as my bug report

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

 Regards

 On Feb 26, 12:33 am, HeHe cnm...@gmail.com wrote:



  thanks, though therein i didnt find anything about
  getPlaybackHeadPosition() 

  i just cannot believe that a simple function like
  getPlaybackHeadPosition() can go wrong.

  anyone has getPlaybackHeadPosition() work with pause()?

  On Feb 25, 12:38 am, blindfold seeingwithso...@gmail.com wrote:

   See the earlier 
   threadhttp://groups.google.com/group/android-developers/browse_frm/thread/5...

   I did not get useful results from trying to get the current playing
   position and gave up on it. I do not know if Android 2.1 is any better
   here.

   On Feb 25, 1:12 am, HeHe cnm...@gmail.com wrote:

folks,

does anybody use AudioTrack.getPlaybackHeadPosition()?
i found that, if i call AudioTrack.pause() in the middle of playing
audio frames, at end of playback getPlaybackHeadPosition() always
returns hundreds of frames less than the number of frames fed into
the
AudioTrack object .

did anybody also run into the same issue?

if you did, how did you work around this unexpected behavior?

thank u~

-- 
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] what is the CRITICAL POINT of view layout to get hit by StackOverflowError exception

2010-02-26 Thread HeHe
it is frustrating to get StackOverflowError exception when i just call
LinearLayout.setBackgroundResource(wallpaper) trying to to beautify
background of an activity.

after i comment out the setBackgroundResource() call, the exception
has gone.

it makes me wonder if my view layout has (easily) reached a critical
point of stack size limit.

could android team raise the stack size limit so that such a
background beautification wont get hit by the exception?

thanks!

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


[android-developers] Re: what is the CRITICAL POINT of view layout to get hit by StackOverflowError exception

2010-02-26 Thread HeHe
Mark, thank you so much for the pointer and information!!

you are right on the tabs and activity. the view hierarchy depth of my
activity is only 6 but, because the activity is 'hosted' by another
TabActivity, the total depth on StackOverflowError exception is 13
(6+7).

what i don't understand is:

1). is the critical point measured by the depth of hierarchy or by the
total memory size used by all the views on the hierarchy?

2). how does setBackgroundResource() increase the depth or memory
usage of 'the stack'?


thanks again!!



On Feb 26, 9:06 am, Mark Murphy mmur...@commonsware.com wrote:
 HeHe wrote:
  it makes me wonder if my view layout has (easily) reached a critical
  point of stack size limit.

 Use hierarchyviewer both to determine your View hierarchy depth and
 determine where you may be able to consolidate some containers, to
 reduce the hierarchy depth and in turn eliminate your stack size problem.

 One of the reasons I rail against the use of activities as the contents
 of tabs, for example, is because doing so is very wasteful from a View
 hierarchy standpoint. Just switching those to be Views in tabs, rather
 than Activities in tabs, can clear up problems.

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

 Android Development Wiki:http://wiki.andmob.org

-- 
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: what is the CRITICAL POINT of view layout to get hit by StackOverflowError exception

2010-02-26 Thread HeHe
thanks for the answers~_~

On Feb 26, 11:07 am, Mark Murphy mmur...@commonsware.com wrote:
 HeHe wrote:
  1). is the critical point measured by the depth of hierarchy or by the
  total memory size used by all the views on the hierarchy?

 For StackOverflowException, the depth is more critical than the total,
 AFAIK.

  2). how does setBackgroundResource() increase the depth or memory
  usage of 'the stack'?

 It presumably triggers a different code path that makes more/deeper
 nested set of calls.

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

 _The Busy Coder's Guide to Android Development_ Version 3.0
 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] Re: AudioTrack.getPlaybackHeadPosi tion() is buggy????

2010-02-25 Thread HeHe
thanks, though therein i didnt find anything about
getPlaybackHeadPosition() 

i just cannot believe that a simple function like
getPlaybackHeadPosition() can go wrong.

anyone has getPlaybackHeadPosition() work with pause()?

On Feb 25, 12:38 am, blindfold seeingwithso...@gmail.com wrote:
 See the earlier 
 threadhttp://groups.google.com/group/android-developers/browse_frm/thread/5...

 I did not get useful results from trying to get the current playing
 position and gave up on it. I do not know if Android 2.1 is any better
 here.

 On Feb 25, 1:12 am, HeHe cnm...@gmail.com wrote:

  folks,

  does anybody use AudioTrack.getPlaybackHeadPosition()?
  i found that, if i call AudioTrack.pause() in the middle of playing
  audio frames, at end of playback getPlaybackHeadPosition() always
  returns hundreds of frames less than the number of frames fed into
  the
  AudioTrack object .

  did anybody also run into the same issue?

  if you did, how did you work around this unexpected behavior?

  thank u~

-- 
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] AudioTrack.getPlaybackHeadPosi tion() is buggy????

2010-02-24 Thread HeHe
folks,

does anybody use AudioTrack.getPlaybackHeadPosition()?
i found that, if i call AudioTrack.pause() in the middle of playing
audio frames, at end of playback getPlaybackHeadPosition() always
returns hundreds of frames less than the number of frames fed into
the
AudioTrack object .

did anybody also run into the same issue?

if you did, how did you work around this unexpected behavior?

thank u~

-- 
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: Webview segfault causes process to restart and in rare cases take the Android platform down and turn the phone off

2010-02-12 Thread HeHe
i experienced this weeks ago.

it happened because my app calls WebView.loadUrl(url) with null url
value. after i added a null check, it seems never happens again.

On Feb 12, 4:03 pm, Mike michaeldouglaskra...@gmail.com wrote:
 Not to beat a dead horse... but obviously it's not dead enough since I
 haven't really seen any good explanation for this yet.  My game
 randomly restarts everyone once in a while, but only in the version of
 my game that is showing an ad (which uses a webview.)

 There are lots of other threads to back this up.  Namely:

 http://groups.google.com/group/android-developers/browse_thread/threa...

 http://groups.google.com.tw/group/android-developers/msg/0d9e92709ced...

 http://groups.google.com/group/android-developers/browse_thread/threa...

 http://groups.google.com/group/android-developers/browse_thread/threa...

 But I'm going to throw my 2 cents in as well.  I have been working
 with one of the AdSense for Mobile engineers on my issue since it
 seems to only occur in my game with the ads turned on and he suggested
 I post on the developer forum so I could have one of the framework
 engineers look at it as well.  I was able to build a small sample app
 that reproduces the problem.  I'd rather not post it here since it
 contains my ad sense client and channel ids.

 The restart issue has been seen by my users on at least the following
 configurations:

 Brand: tmobile
 Model: T-Mobile G1
 Version: 1.6

 Brand: tmobile
 Model: T-Mobile myTouch 3G
 Version: 1.6

 Brand: verizon
 Model: Droid Eris
 Version: 1.5

 Brand: verizon
 Model: Droid
 Version: 2.0.1

 I can get this to happen in the emulator as well as on my G1 with the
 test app.  Again - happy to send the test app, just don't want to post
 it here.

 Here is my trace log:

 02-08 23:03:36.330: INFO/ActivityManager(76): Displayed activity
 com.wm.wordfind.client/.WordUpOptionsActivity: 1191 ms (total 1191 ms)
 02-08 23:03:37.368: DEBUG/dalvikvm(1742): GC freed 1656 objects /
 254696 bytes in 217ms
 02-08 23:03:40.958: WARN/InputManagerService(76): Window already
 focused, ignoring focus gain of:
 com.android.internal.view.iinputmethodclient$stub$pr...@4399c5b0
 02-08 23:03:42.858: INFO/ActivityManager(76): Starting activity:
 Intent { cmp=com.wm.wordfind.client/.WordUpPlayActivity }
 02-08 23:03:43.018: INFO/ActivityManager(76): Starting activity:
 Intent { cmp=com.wm.wordfind.client/.WordUpNextPlayerActivity (has
 extras) }
 02-08 23:03:43.468: INFO/ActivityManager(76): Displayed activity
 com.wm.wordfind.client/.WordUpNextPlayerActivity: 299 ms (total 580
 ms)
 02-08 23:03:44.268: INFO/ActivityManager(76): Displayed activity
 com.wm.wordfind.client/.WordUpPlayActivity: 1377 ms (total 1377 ms)
 02-08 23:03:45.598: DEBUG/dalvikvm(1742): GC freed 20289 objects /
 1022512 bytes in 230ms
 02-08 23:03:45.638: INFO/DEBUG(48): *** *** *** *** *** *** *** ***
 *** *** *** *** *** *** *** ***
 02-08 23:03:45.638: INFO/DEBUG(48): Build fingerprint: 'android-
 devphone1/dream_devphone/dream/trout:1.6/DRC83/14721:userdebug/
 adp,test-keys'
 02-08 23:03:45.638: INFO/DEBUG(48): pid: 1742, tid: 1759  
 com.wm.wordfind.client 
 02-08 23:03:45.638: INFO/DEBUG(48): signal 11 (SIGSEGV), fault addr
 
 02-08 23:03:45.638: INFO/DEBUG(48):  r0 0007  r1 411bdd58  r2
 411bdd58  r3 
 02-08 23:03:45.638: INFO/DEBUG(48):  r4 411bdd58  r5 0023c998  r6
   r7 45e87abc
 02-08 23:03:45.638: INFO/DEBUG(48):  r8 45e87da0  r9 4247ff54  10
 4247ff40  fp 0001
 02-08 23:03:45.638: INFO/DEBUG(48):  ip 0011  sp 45e87a80  lr
 ad047361  pc ad03fc86  cpsr 0030
 02-08 23:03:45.658: DEBUG/webviewglue(1742): nativeDestroy view:
 0x28bfd8
 02-08 23:03:46.208: DEBUG/CubeGridSolver(1742): Solved board in 3166
 milliseconds
 02-08 23:03:46.298: INFO/DEBUG(48):          #00  pc 0003fc86  /
 system/
 lib/libdvm.so
 02-08 23:03:46.338: INFO/DEBUG(48):          #01  pc 001f3c3a  /
 system/
 lib/libwebcore.so
 02-08 23:03:46.338: INFO/DEBUG(48):          #02  pc 00260be6  /
 system/
 lib/libwebcore.so
 02-08 23:03:46.348: INFO/DEBUG(48):          #03  pc 00260c48  /
 system/
 lib/libwebcore.so
 02-08 23:03:46.348: INFO/DEBUG(48):          #04  pc 00260d80  /
 system/
 lib/libwebcore.so
 02-08 23:03:46.348: INFO/DEBUG(48):          #05  pc 001c7de2  /
 system/
 lib/libwebcore.so
 02-08 23:03:46.358: INFO/DEBUG(48):          #06  pc 001aac3a  /
 system/
 lib/libwebcore.so
 02-08 23:03:46.358: INFO/DEBUG(48):          #07  pc 002426a4  /
 system/
 lib/libwebcore.so
 02-08 23:03:46.358: INFO/DEBUG(48):          #08  pc 00228e04  /
 system/
 lib/libwebcore.so
 02-08 23:03:46.358: INFO/DEBUG(48):          #09  pc 0024273c  /
 system/
 lib/libwebcore.so
 02-08 23:03:46.368: INFO/DEBUG(48):          #10  pc 0021f072  /
 system/
 lib/libwebcore.so
 02-08 23:03:46.368: INFO/DEBUG(48):          #11  pc 0021f0ea  /
 system/
 lib/libwebcore.so
 02-08 23:03:46.368: INFO/DEBUG(48):          #12  pc 001ac08e  /
 system/
 lib/libwebcore.so
 02-08 

[android-developers] Re: continuous audio recording in memory

2010-01-06 Thread HeHe
a look at .../framework/base/media/.../AudioRecord.cpp should be
helpful~

On Jan 6, 10:11 am, frantz lohier floh...@gmail.com wrote:
 Dear All,

 I'm trying to write an App that continuously record audio in memory (in a
 circular buffer).

 Could anyone point me towards a piece of code (perhaps in the kernel) that
 shows how to best to this ?

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

[android-developers] Re: NDK all from within Eclipse

2009-12-15 Thread HeHe
thanks! thanks! thanks!

On Dec 15, 3:02 pm, Robert Green rbgrn@gmail.com wrote:
 I was going to post this to the group but figured I'd write up a how-
 to on my website instead.  Basically, here's how you configure Eclipse
 to do nice C/C++ editing and automatically build your native code for
 you on-save.  It also automatically refreshes your lib directory and
 consequently ADT puts it straight into your APK.

 http://www.rbgrn.net/content/348-get-your-eclipse-integrated-ndk-on

 I'll post this to the NDK dev group as well.  I can't believe I didn't
 set that up sooner.  It cut my native development time in half.  Let
 me know if you have problems/questions with it.

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


[android-developers] Re: Localization for simplified and traditional chinese

2009-12-14 Thread HeHe
killing your app in DDMS and re-run it should work, too.

On Dec 14, 4:50 am, Kit yingkity...@gmail.com wrote:
 Sorry, i just realized that i have to restart the emulator after
 changing the locale.
 the localization works now. Thanks.

 On 12月14日, 上午10時11分, Kit yingkity...@gmail.com wrote:



  Hi HeHe,

  Thanks for your reply and sorry for the misleading. let me clarify my
  question.

  i didn't make any coding on localization. what it want to do is to let
  my application shows either traditional chinese/simplified chinese
  depending on the phone locale. currently i got the following two
  strings.xml in my /res folder
      - /values/strings.xml (default)
      - /values-zh/strings.xml  (for locale with language code = zh)

  so what i have done now is if the phone locale is not with language
  code zh, default strings.xml is shown. and if the locale is zh-TW
  (Taiwan) or zh-CN(China), /values-zh/strings.xml is shown.

  i supposed zh-TW should show the Traditional Chinese and zh-CN should
  show the Simplified Chinese. so i modified the /res folder as follow
      - /values/strings.xml (default)
      - /values-zh-rCN/strings.xml  (for locale = zh-CN)
      - /values-zh-rTW/strings.xml  (for locale = zh-TW)

  but this doesn't wok, now only default strings.xml is shown no matter
  which locale is set.

  Thanks,

  Regards,
  Kit

  On Dec 14, 8:56 am, HeHe cnm...@gmail.com wrote:

   not quite get your question.

   selection of the resource folder should be automatic, as indicated in

           android-sdk-windows/docs/guide/topics/resources/resources-
   i18n.html

   the current locale of your phone/emulator can be learned by

                   Locale.getDefault();

   hope this helpful to you.

   On Dec 12, 11:25 pm, Kit yingkity...@gmail.com wrote:

i want to create an application which supports both simplified and
traditional chinese. so i created 2 strings.xml in values-zh-rCN (sim.
chi) and values-zh-rTW (tra. chi). but then i run the application in
the emulator, it seems that only the default strings.xml is loaded.

i tried to use values-zh as the strings.xml folder. it will be loaded
for both zh-CN and zh-TW locales. so is that i cannot add region code
for the strings.xml?

Thanks for your answer

Regards,
Kit

-- 
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: Localization for simplified and traditional chinese

2009-12-13 Thread HeHe
not quite get your question.

selection of the resource folder should be automatic, as indicated in

android-sdk-windows/docs/guide/topics/resources/resources-
i18n.html

the current locale of your phone/emulator can be learned by

Locale.getDefault();

hope this helpful to you.


On Dec 12, 11:25 pm, Kit yingkity...@gmail.com wrote:
 i want to create an application which supports both simplified and
 traditional chinese. so i created 2 strings.xml in values-zh-rCN (sim.
 chi) and values-zh-rTW (tra. chi). but then i run the application in
 the emulator, it seems that only the default strings.xml is loaded.

 i tried to use values-zh as the strings.xml folder. it will be loaded
 for both zh-CN and zh-TW locales. so is that i cannot add region code
 for the strings.xml?

 Thanks for your answer

 Regards,
 Kit

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


[android-developers] Re: How to set tooltip to a button

2009-12-01 Thread HeHe
yes, it it possible.

i used PopupWindow and TextView together.

On Dec 1, 4:43 am, saikiran n saikiran@gmail.com wrote:
 Hi,
 I want to set tool tip to a Button..
 Is it possible in android
 if so please give me some sample code

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


[android-developers] Re: How to read a file provided by a different Android application

2009-11-20 Thread HeHe
try ContentProvider, i guess.

On Nov 20, 12:17 am, jaime jjja...@gmail.com wrote:
 I need some mechanism so that an Android application can read a file
 which is provided by a different Android application. I know that it's
 possible if both applications have the same userid, but it's not
 feasible because it would require to sign both applications with the
 same key.
 The idea is that one application has a zip file which is uncompressed;
 the uncompressed files must be available to a different Android
 application. By default, it's not possible because that directory is
 not readable by the latter application.
 Is there any directory which can be readable/writable by both
 applications without hacks?
 Is there any other mechanism suggested by Android?

-- 
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: Certificate webpage problem when using WebView

2009-11-18 Thread HeHe
perhaps you need to combine raw tcp socket i/o, fake X509TrustManger
and webView.load() to achieve it.

On Nov 18, 11:21 am, Mark term...@gmail.com wrote:
 Isn't anybody know that solutions?

 On Nov 16, 11:07 am, Mark term...@gmail.com wrote:



  Hi, folks

  i have aproblemto show specific web page (https://
  emocion.movistar.es/mstore/index.jsp) withcertificatewhen iusingWebView..
  i searched that some guy done fake X509TrustManger, but in my case no
  luck.
  i can only see empty screen and there is no errors on that.

  Android browser can show a dialog for notice acertificate,

  I am testing at 1.6 donut now

  my simple code is like below

                  web = (WebView) findViewById(R.id.main);
                  web.getSettings().setJavaScriptEnabled(true);
                  web.setWebViewClient(mWebViewClient);
                  web.loadUrl(https://emocion.movistar.es/mstore/index.jsp;);

  There is no onReceivedSslError() callback like in BrowserActivity.java

  Could you share a idea for solving thisproblem?

  Thanks in advance...

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


[android-developers] Re: Got 12 Google Wave invitations to use, let me know if you need

2009-11-09 Thread HeHe
no, thanks.

On Nov 9, 8:12 am, dave dayong...@gmail.com wrote:
 Hi all,

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

 Cheers.

 Dave

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


[android-developers] Re: Request to official ADC2 team.

2009-09-14 Thread HeHe

++

On Sep 14, 11:40 am, Mobidev android.mobi...@gmail.com wrote:
 .               Once upon a time, we had this little 
 group…http://groups.google.com/group/android-challengeAndroid Challenge:
 Discuss the Android Developer Challenge, including questions on
 contest details. You can also seek other developers to join a team
 effort.
                …then came this 
 message…http://groups.google.com/group/android-challenge/browse_thread/thread...
                …and the group was closed for ever.

 A humble request to ADC2 team to officially start and moderate a new
 ADC2 group similar to the previous android-challenge group. ADC2
 messages are scattered in android-developers and android-discuss
 groups. ADC2 discussions does not fit in either of these groups. There
 will be hundreds of queries, comments, news and PR pitches once the
 ADC2 judging app goes live. So please could you start a ADC2
 discussion group at the earliest.

 Thanks.
 P.S. Droids of the planet please vote with '+' or '–' for this
 request.
--~--~-~--~~~---~--~~
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: Please help _Confused_Server Side For android mobile application

2009-09-13 Thread HeHe

try mason. amazon uses it. easy and fast.

and, mysql.

u need replication/cluster if u r serious about ur server.

good lucks!!

On Sep 13, 9:17 am, Mohith K M mohith3...@gmail.com wrote:
 Thanks
 i was Checking JBOSS,But found out Glassfish application server is
 equally good,and have good support,will be helpful for me to learn via
 Ebook (Beginning Java™ EE 6 Platform with GlassFish™ 3 From Novice to
 Professional.pdf)

 So i decided to Go ahead with
 Java EE 6 n GlassFish™ 3

 But,Like i have mentioned before,I am Beginner in Android App side too

 Which Protocol Should we use to communicate with Server
 SOAP Protocol is supportted @Android...ryt

 On Sep 4, 9:33 pm, Yusuf Saib (T-Mobile USA) yusuf.s...@t-



 Mobile.com wrote:
  There are many many ways to do this, so it partially depends on your
  capabilities. PHP is fine, but if you prefer Java then JBOSS is one
  way; there are a number of Java-based solutions including JavaEE and
  Google App Engine.

  Yusuf Saib
  Android
  ·T· · ·Mobile· stick together
  The views, opinions and statements in this email are those of the
  author solely in their individual capacity, and do not necessarily
  represent those of T-Mobile USA, Inc.

  On Sep 3, 11:38 pm, Mohith K M mohith3...@gmail.com wrote:

   Thanks alot!

   On Sep 4, 8:36 am, dilli rao dilliraomca...@gmail.com wrote:

Hi Mohith K M*
*
*
*you  may use php for your request page design at server side and for
interaction with mysql and do the large processing at server side and 
send
back the results to the client (ANDROID)

use post or get request methods while sending the request to the server 
and
process the response from the server

right now i am doing in the same way ( it works fine for me)

Thank you

Dilli

On Fri, Sep 4, 2009 at 1:02 AM, Mohith K M mohith3...@gmail.com wrote:

 I am beginner (Both Android and Server side programming),

 Am having doubt about Server side for my Android mob application

 My requirements are
 1. Receive request from android mob application
 2.Run algorithm on Huge Database Depending on some variable xxx
 inside query request from mob app
 3. Send back the result produced to Android mob application.

 What type of Server should i run?
 Database-mysql??How can i combine algorithm and database
 how can i parse the request from mobile application and run
 appropriate algorithm

 Will JBOSS satisfy my need?
 or please Tell me which one i should use..
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: is possible mapview and list exist in same activity

2009-07-27 Thread HeHe

beside the suggestion from Cao Minh, you could also do some try-n-
error experiment on your layout xml file of the map activity. i have a
gut feeling that HorizontalScrollView may fit more of your purpose
because . i don't know, though.

On Jul 26, 10:18 am, tstanly tsai.sta...@gmail.com wrote:
 thank you for your reply,

 so I want to ask the next question,
 that's how to put list with themapview??

 I just think it must extends ListActivity,
 is there another methods?

 thanks so much!!

 On Jul 26, 3:02 am, HeHe cnm...@gmail.com wrote:



  afail, you could combine amapviewand listview (or any other sort of
  views) in a map activity.

  as for how-to, you should do some experiment.

  On Jul 23, 10:34 pm,tstanlytsai.sta...@gmail.com wrote:

   hi all,

   for now i have a list,
   using extends listactivity,
   and now i want to addmapviewon the same activity using framelayout
   probably,

   but if i want to use themapview, the activity must extends
   mapactivity,

   one must extends mapactivity,the other must extends list activity,

   if it possible to do that???

   thanks!!!- Hide quoted text -

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



[android-developers] Re: is possible mapview and list exist in same activity

2009-07-25 Thread HeHe


afail, you could combine a mapview and listview (or any other sort of
views) in a map activity.

as for how-to, you should do some experiment.

On Jul 23, 10:34 pm, tstanly tsai.sta...@gmail.com wrote:
 hi all,

 for now i have a list,
 using extends listactivity,
 and now i want to addmapviewon the same activity using framelayout
 probably,

 but if i want to use themapview, the activity must extends
 mapactivity,

 one must extends mapactivity,the other must extends list activity,

 if it possible to do that???

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



[android-developers] nullPointerException in android.webkit.WebView.onTouchEvent

2009-07-03 Thread HeHe

I override dispatchTouchEvent() like this:

public boolean dispatchTouchEvent(MotionEvent ev)
{
WebView v=findViewById(R.id.detail);
return v.dispatchTouchEvent(ev);
}

I am getting intermittent NullPointerException like this:

07-03 18:03:54.530: ERROR/AndroidRuntime(1681):
java.lang.NullPointerException
07-03 18:03:54.530: ERROR/AndroidRuntime(1681): at
android.webkit.WebView.onTouchEvent(WebView.java:3566)
07-03 18:03:54.530: ERROR/AndroidRuntime(1681): at
android.view.View.dispatchTouchEvent(View.java:3368)
07-03 18:03:54.530: ERROR/AndroidRuntime(1681): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:831)
07-03 18:03:54.530: ERROR/AndroidRuntime(1681): at
com.wth.xxxView.dispatchTouchEvent(xxxView.java:118)
07-03 18:03:54.530: ERROR/AndroidRuntime(1681): at
com.android.internal.policy.impl.PhoneWindow
$DecorView.dispatchTouchEvent(PhoneWindow.java:1691)
07-03 18:03:54.530: ERROR/AndroidRuntime(1681): at
android.view.ViewRoot.handleMessage(ViewRoot.java:1525)
07-03 18:03:54.530: ERROR/AndroidRuntime(1681): at
android.os.Handler.dispatchMessage(Handler.java:99)
07-03 18:03:54.530: ERROR/AndroidRuntime(1681): at
android.os.Looper.loop(Looper.java:123)
07-03 18:03:54.530: ERROR/AndroidRuntime(1681): at
android.app.ActivityThread.main(ActivityThread.java:3948)
07-03 18:03:54.530: ERROR/AndroidRuntime(1681): at
java.lang.reflect.Method.invokeNative(Native Method)
07-03 18:03:54.530: ERROR/AndroidRuntime(1681): at
java.lang.reflect.Method.invoke(Method.java:521)
07-03 18:03:54.530: ERROR/AndroidRuntime(1681): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:782)
07-03 18:03:54.530: ERROR/AndroidRuntime(1681): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
07-03 18:03:54.530: ERROR/AndroidRuntime(1681): at
dalvik.system.NativeStart.main(Native Method)

I verify that the variable v is never null. How come there can be
nullpointer exception happening in
android.webkit.WebView.onTouchEvent
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to know where a HorizontalScrollView is flinted?

2009-07-03 Thread HeHe

anyone there

On Jul 2, 9:56 am, HeHe cnm...@gmail.com wrote:
 Hello folks,

 Could somebody teach me how to get current left x-position relative to
 a HorizontalScrollView view after a Flint event is processing by
 HorizontalScrollView's factory onFlint handler?

 There seems to me no such API in current SDK. Am I correct?

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



[android-developers] How to know where a HorizontalScrollView is flinted?

2009-07-02 Thread HeHe

Hello folks,

Could somebody teach me how to get current left x-position relative to
a HorizontalScrollView view after a Flint event is processing by
HorizontalScrollView's factory onFlint handler?

There seems to me no such API in current SDK. Am I correct?

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



[android-developers] Re: BufferedReader.readLine hangs after HTTP connection has ended

2009-06-22 Thread HeHe

Does T-Mobile proxy HTTP connection on its 3G/Edge network?

I have this question because my server always sends HTTP message body
in chunks with a Transfer-Encoding: chunked header. But when the
message arrives at my G1 phone, the header is gone and  message body
is not chunked!!

Is it possible that TM proxy hold HTTP connections toward my G1 after
my server has say bye-bye to the proxy?

Can anybody confirm this?

On Jun 22, 5:49 pm, HeHe cnm...@gmail.com wrote:
 I found my application run differently on G1 from Android emulator.

 I used Ethereal to capture HTTP messages. I saw in both cases that the
 server ended HTTP connection in 3 seconds after it finished sending
 data.

 Here is the related code snippet in my Android  application:

                         InputStreamReader  br=new BufferedReader(new 
 InputStreamReader
 (sock.getInputStream()));
                         String line;
                         while ((line=br.readLine())!=null)
                         {
                         ...code to process each line
                         }

 When the code runs on Android emulator, the while loop exits almost
 immediately after HTTP connection terminates.

 However, when it runs on G1 phone, the while loop does not exit until
 60+ seconds after TTP connection terminates.

 Using G1,  have you experienced similar problem??? If you have, how
 did you work around the problem?

 Thanks in advance for any advice!!!
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---