[android-developers] Re: Able to install file without adding MIME type in webserver - Very strange!!

2009-02-16 Thread mnj

Hi,

Could someone respond.  Is this the right group  or should I move this
discussion to android-platform/ android-discuss

Thanks,
Manoj

On Feb 12, 2:16 pm, mnj manojgopa...@gmail.com wrote:
 Hi,

 I kept my  .apk file in my apache webserver at Document root path.
 This is the only file at Document Root . I had removed index.html file
 at this location. If I keep the index.html file then other files where
 not displayed if I open the URL i.e http://ip_address using a web
 browser

 Now from my Google phone browser I'm able to download the apk file and
 and install it in Google phone.
 Note 1: I had not done any settings to add theMIMEtypeapplication/
 vnd.android.package-archive  in apache webserver.

 Note 2: I was connecting to my webserver through WiFi.

 But the same apk file I was not able to download from my Gmail (as
 attachment) and I got unknown filetype error in this case.

 After reading few related topics, I came to know about theMIMEtype
 support required in webserver for android applications.

 Now I'm wondering how come file gets installed sucessfully from my
 apache webserver even without adding theMIMEtypeapplication/
 vnd.android.package-archive .

 Any clues what's happening here?

 Regards,
 Manoj
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: DEVICE_POWER permission denied for using goToSleep

2009-02-16 Thread mnj

Hi,

Could someone respond to this DEVICE_POWER issue. Is this supported
in SDK. If not any plans to support this.

Regards,
Manoj

On Feb 3, 3:48 pm, shahzad ahmad shahzad.s.ah...@gmail.com wrote:
 Did u find a way to lock the phone ?



 On Fri, Jan 30, 2009 at 3:31 PM, mnj manojgopa...@gmail.com wrote:

  Yes this permission is set in androidmanifest

  On Jan 29, 5:10 pm, Phill Midwinter ph...@grantmidwinter.com wrote:
   Is it set in the androidmanifest?

   2009/1/29 mnj manojgopa...@gmail.com

Hi,

I wanted to use the funcion goToSleep() in PowerManager Class to force
the device to sleep. But I'm getting an exception and the application
crashes when I call this function. I already have added the
DEVICE_POWER permission in Androidmanifest.xml. When I checked the
logs I could see below error

E/AndroidRuntime( 2158): Caused by: java.lang.SecurityException:
Neither user 10
020 nor current process has android.permission.DEVICE_POWER.

Has anyone faced this issue before. Does application have
DEVICE_POWER permission. or is it disabled.

Regards,
Manoj

   --
   Phill Midwinter
   Director
   Grant Midwinter Limited
   d: 0844 736 5234 x: 0
   m: 07538 082156
   e: ph...@grantmidwinter.com- Hide quoted text -

   - Show quoted text -- 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] Able to install file without adding MIME type in webserver - Very strange!!

2009-02-12 Thread mnj

Hi,

I kept my  .apk file in my apache webserver at Document root path.
This is the only file at Document Root . I had removed index.html file
at this location. If I keep the index.html file then other files where
not displayed if I open the URL i.e http://ip_address using a web
browser

Now from my Google phone browser I'm able to download the apk file and
and install it in Google phone.
Note 1: I had not done any settings to add the MIME type application/
vnd.android.package-archive  in apache webserver.

Note 2: I was connecting to my webserver through WiFi.


But the same apk file I was not able to download from my Gmail (as
attachment) and I got unknown file type error in this case.


After reading few related topics, I came to know about the MIME type
support required in webserver for android applications.

Now I'm wondering how come file gets installed sucessfully from my
apache webserver even without adding the MIME type application/
vnd.android.package-archive .

Any clues what's happening here?

Regards,
Manoj
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Test apk on G1

2009-02-12 Thread mnj

Refer this link  -- 
http://code.google.com/android/intro/develop-and-debug.html#developingondevicehardware

Make sure you install the USB driver.

You can install the apk using command line using adb tool adb insatll
app name or using Eclipse

Regards,
Manoj


On Feb 12, 2:42 pm, Pooja apooj...@gmail.com wrote:
 Hi:

 Need to test apk file on actual G1 device urgently.

 Could any anyone with the device please help me on this?

 Thanks,
 Pooja
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: DEVICE_POWER permission denied for using goToSleep

2009-01-30 Thread mnj

Yes this permission is set in androidmanifest

On Jan 29, 5:10 pm, Phill Midwinter ph...@grantmidwinter.com wrote:
 Is it set in the androidmanifest?

 2009/1/29 mnj manojgopa...@gmail.com







  Hi,

  I wanted to use the funcion goToSleep() in PowerManager Class to force
  the device to sleep. But I'm getting an exception and the application
  crashes when I call this function. I already have added the
  DEVICE_POWER permission in Androidmanifest.xml. When I checked the
  logs I could see below error

  E/AndroidRuntime( 2158): Caused by: java.lang.SecurityException:
  Neither user 10
  020 nor current process has android.permission.DEVICE_POWER.

  Has anyone faced this issue before. Does application have
  DEVICE_POWER permission. or is it disabled.

  Regards,
  Manoj

 --
 Phill Midwinter
 Director
 Grant Midwinter Limited
 d: 0844 736 5234 x: 0
 m: 07538 082156
 e: ph...@grantmidwinter.com- 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] DEVICE_POWER permission denied for using goToSleep

2009-01-28 Thread mnj

Hi,

I wanted to use the funcion goToSleep() in PowerManager Class to force
the device to sleep. But I'm getting an exception and the application
crashes when I call this function. I already have added the
DEVICE_POWER permission in Androidmanifest.xml. When I checked the
logs I could see below error

E/AndroidRuntime( 2158): Caused by: java.lang.SecurityException:
Neither user 10
020 nor current process has android.permission.DEVICE_POWER.

Has anyone faced this issue before. Does application have
DEVICE_POWER permission. or is it disabled.

Regards,
Manoj
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: When does my thread die?

2009-01-26 Thread mnj

Hi,

I did a simple test where I start a service from an activity after
acquiring PARTIAL_WAKE_LOCK. Then a 100% charged phone will drain
completely in 10 hours when CPU is always on.

Regards,
Manoj

On Jan 24, 3:13 am, Dianne Hackborn hack...@android.com wrote:
 The alarm manager would probably be overkill for that.  It might make more
 sense to do this in a Service, which holds a partial wake lock to keep
 itself running.  Note that this will have a noticeably impact on battery
 life because you are preventing the CPU from going to sleep, though I can't
 tell you exactly how much.





 On Fri, Jan 23, 2009 at 2:01 PM, John Bohumil jbohu...@gmail.com wrote:
   Finally, for something like a countdown timer, you really might want to
  consider using the alarm manager so you don't need to keep your app running
  at all while it is in the background.  That is the kind of thing a well
  behaving Android app will do.  To be able to show the remaining time if the
  user returns to your activity, you can store on SharedPreferences the time
  the countdown was started.

  Using the alarm manager is also the only way you can make sure you execute
  when the time expires, even if the user has turned off the phone.

  As it happens I am writting a countdown timer that implements a repeating
  notification at quite short interface.  For example the application might
  chirp every 10 seconds.  This is used for certain breathing excercises where
  you hold the breath for 10 seconds, breathe out for 10 seconds, in for 10
  seconds etc.

  For such short intervals would I still be better off using the alarm
  manager?  The handler technique seems to work great for my purposes but I
  want to make sure I write a well behaved app.

  John

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

 Note: please don't send private questions to me, as I don't have time to
 provide private support.  All such questions should be posted on public
 forums, where I and others can see and answer them.- 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] Getting NullPointer Execption when adding Chronometer element

2009-01-16 Thread mnj

Hi,

I'm getting NullPointer Execption message in Eclipse layout window
when adding Chronometer element in LinearLayout. But interesting part
is that chronometer still works when I run my application . But the
issue is because of this message I'm not able to see the GUI in
layoutwindow.

Is this a known issue?

Regards,
Manoj
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Design approach - Single/multiple service

2009-01-09 Thread mnj

Hi,

I need to create an application which has got a mina controller module
and 2-3 sub-modules which should run as seperate threads.

The entire application needs to be run as a background service.

The job of main controller module(main controller service) is to start/
stop other sub-modules and sends messages to these sub-modules. These
sub-modules also share data among themselves. Note: There is no
Activity . the main controller service will start after boot complete.

I'm considering two options

1) Run each of these sub-modules as seperate service and each will
create a new thread for its execution i.e main controller service will
call startService() for each of the sub-modules which would inturn
create a new thread for its execution.

2) Have a single controller service which creates 2-3 threads which
corrsponds to the sub modules.

Once main controller service is stopped I want to stop all other sub-
modules. I prefer approach 2.

In general, is there any design guidelines for building an android
application which uses background services.

Your comments are welcome

Regards,
Manoj
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] service stops when phone goes idle

2009-01-02 Thread mnj

Hi,

I need to run a service at periodic intervals even after phones goes
idle (i.e CPU turn off).
For this I'm scheduling an alarm using Alarm Manager using setRepeating
() API and RTC_WAKEUP flag

But its not working as expected. Only when phone screen is on the
alarm is getting scheduled and service is getting executed. But when
the screen goes off, the service is not getting executed.

code
==
Intent i = new Intent();
i.setClassName( com.mydomain.AlarmSample,
com.mydomain.AlarmSample.myservice );
PendingIntent mAlarmSender = PendingIntent.getService(battMonitor.this,
0, i, 0);

AlarmManager am = (AlarmManager)getSystemService(ALARM_SERVICE);
am.setRepeating(AlarmManager.RTC_WAKEUP,
firstTime, delay*1000, mAlarmSender);
==

Do I need ot use PARTIAL_WAKE_LOCK to keep the phone from getting
turned off.. If so where should I acquire the lock. Is there any
sample code for WAKE_LOCK.

Regards,
Manoj
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: service stops when phone goes idle

2009-01-02 Thread mnj

Hi,

The issue got resolved after PARTIAL_WAKE_LOCK is acquired.

Regards,
Manoj

On Jan 2, 1:32 pm, mnj manojgopa...@gmail.com wrote:
 Hi,

 I need to run a service at periodic intervals even after phones goes
 idle (i.e CPU turn off).
 For this I'm scheduling an alarm using Alarm Manager using setRepeating
 () API and RTC_WAKEUP flag

 But its not working as expected. Only when phone screen is on the
 alarm is getting scheduled and service is getting executed. But when
 the screen goes off, the service is not getting executed.

 code
 ==
 Intent i = new Intent();
 i.setClassName( com.mydomain.AlarmSample,
 com.mydomain.AlarmSample.myservice );
 PendingIntent mAlarmSender = PendingIntent.getService(battMonitor.this,
 0, i, 0);

 AlarmManager am = (AlarmManager)getSystemService(ALARM_SERVICE);
 am.setRepeating(AlarmManager.RTC_WAKEUP,
                         firstTime, delay*1000, mAlarmSender);
 ==

 Do I need ot use PARTIAL_WAKE_LOCK to keep the phone from getting
 turned off.. If so where should I acquire the lock. Is there any
 sample code for WAKE_LOCK.

 Regards,
 Manoj
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Debug multi process android app in eclipse

2008-12-16 Thread mnj

Hi,

When I do to DDMS-Device Menu and try to select the service process
by clicking the green bug, I get error as No open project found for
com.example.testservice:remote. Debug session failed.
Actually both the service and activity process is part of same
project  and both source files are present in same folder.

I can see  following port numbers

Activity - com.example.testservice, port number as 8611
Service - com.example.testservice:remote , port number as 8614/8700


Few more info if it helps -  I have an an AIDL file and in service
class I'm implementing the AIDL interface functions in Interface stub
class.

Note: I'm trying to run the service in different process for 2
reasons :
1) For general understanding and how to debug multiprocess activity/
service
2) If activty is closed I still need to run service in background say
running music in background. Activity will allow user to select the
music. Service in different process would run the music in background
if user is doing other things on phone.

Regards,
Manoj

On Dec 17, 12:47 am, Xavier Ducrohet x...@google.com wrote:
 One of the things that you can do is put
 android.os.Debug.waitForDebugger() in the starting code of your
 service.

 By doing this, the Android VM will pause and wait for a debugger to be
 connected. Eclipse/ADT will notice this and automatically connect a
 debugger to your service process.

 If you do not want to change your code, you can go into the DDMS
 perspective in Eclipse, then, in the Device view, you can select your
 service process and click the green bug icon (or choose debug
 process from the view menu). This will automatically connect a
 debugger to the process.

 The advantage of the first method is that you can put breakpoints
 earlier in your code and make sure you'll stop on them without having
 timing issue.

 Xav



 On Mon, Dec 15, 2008 at 11:17 PM, mnj manojgopa...@gmail.com wrote:

  Hi,

  I have a activity and service which are running as a seperate process.
  I'm able to see the logs of activity(process1) and service(process2)
  in logcat.

  But when I keep breakpoint in service process its not hitting there.
  Breakpoint works only in activity process.

  Can someone tell me how can I debug multi process in eclipse.
  Currently, for debugging purpose I'm making service and activity to
  run as same process.

  Regards,
  Manoj- 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] Debug multi process android app in eclipse

2008-12-15 Thread mnj

Hi,

I have a activity and service which are running as a seperate process.
I'm able to see the logs of activity(process1) and service(process2)
in logcat.

But when I keep breakpoint in service process its not hitting there.
Breakpoint works only in activity process.

Can someone tell me how can I debug multi process in eclipse.
Currently, for debugging purpose I'm making service and activity to
run as same process.

Regards,
Manoj


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Breakpoint not getting hit in Interface function implemented in Service

2008-12-14 Thread mnj

Hi,

Btwn I'm running the service in a different process. My
AndroidManifest.xml has

service android:name=.MyTestService android:process=:remote

But If I don't run service as different process, I don't get below
issue. Not sure if the service is getting destroyed.

Can someone point me to some sample code which runs service as
independent process. I mean the entire package including the src and
Androidmanifiest.xml.

Thanks,
Manoj

On Dec 12, 5:31 pm, mnj manojgopa...@gmail.com wrote:
 Hi,

 I'm trying to connect to a service from an Activity. I wrote an AIDL
 file with functions that will be implemented in the Service. The
 function onServiceConnected() is getting called.

 private ServiceConnection mConnection = new ServiceConnection()
 {
public void onServiceConnected(ComponentName className,
 IBinder service) {
 mpInterface = 
 MytestInterface.Stub.asInterface((IBinder)service);
 mpInterface.clearPlaylist(); --- its breaks here (1)
 
}
 }

 Now when I try to step through the function clearPlayList(), it first
 goes to the MytestInterface.java file which was auto-generated by
 eclipse

 public void clearPlaylist() throws android.os.RemoteException
 {
 android.os.Parcel _data = android.os.Parcel.obtain();
 android.os.Parcel _reply = android.os.Parcel.obtain();
 try {
 _data.writeInterfaceToken(DESCRIPTOR);
 mRemote.transact(Stub.TRANSACTION_clearPlaylist, _data, _reply, 0); --- 
 Control comes here (2)

 _reply.readException();}

 finally {
 _reply.recycle();
 _data.recycle();

 }

 Now the actual implementation of this function is in Service class.
 But the breakpoint never comes to this function.
 Instead the control goes back to onServiceConnected() function.

 Service class
 =
 private final MytestInterface.Stub mBinder = new MytestInterface.Stub
 () {

 public void clearPlaylist() {
 songs.clear();
 }

 }

 What could be the issue. Is there any error happening in
 mRemote.transact() function.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Breakpoint not getting hit in Interface function implemented in Service

2008-12-12 Thread mnj

Hi,

I'm trying to connect to a service from an Activity. I wrote an AIDL
file with functions that will be implemented in the Service. The
function onServiceConnected() is getting called.


private ServiceConnection mConnection = new ServiceConnection()
{
   public void onServiceConnected(ComponentName className,
IBinder service) {
mpInterface = 
MytestInterface.Stub.asInterface((IBinder)service);
mpInterface.clearPlaylist(); --- its breaks here (1)

   }
}

Now when I try to step through the function clearPlayList(), it first
goes to the MytestInterface.java file which was auto-generated by
eclipse

public void clearPlaylist() throws android.os.RemoteException
{
android.os.Parcel _data = android.os.Parcel.obtain();
android.os.Parcel _reply = android.os.Parcel.obtain();
try {
_data.writeInterfaceToken(DESCRIPTOR);
mRemote.transact(Stub.TRANSACTION_clearPlaylist, _data, _reply, 0); ---
 Control comes here (2)
_reply.readException();
}
finally {
_reply.recycle();
_data.recycle();
}

Now the actual implementation of this function is in Service class.
But the breakpoint never comes to this function.
Instead the control goes back to onServiceConnected() function.

Service class
=
private final MytestInterface.Stub mBinder = new MytestInterface.Stub
() {

public void clearPlaylist() {
songs.clear();
}
}

What could be the issue. Is there any error happening in
mRemote.transact() function.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: need help for MediaRecorder

2008-12-09 Thread mnj

Hi,

Check the link  http://code.google.com/android/devel/security.html
and http://code.google.com/android/reference/android/Manifest.permission.html

A central design point of the Android security architecture is that
no application, by default, has permission to perform any operations
that would adversely impact other applications, the operating system,
or the user. This includes reading or writing the user's private data
(such as contacts or e-mails), reading or writing another
application's files, performing network access, keeping the device
awake, etc

Regards,
Manoj


On Dec 10, 10:07 am, Lei [EMAIL PROTECTED] wrote:
 wow!

 Thank you, mnj.
 It works well now.

 And one more question, how can I know that where it needs a
 permission?

 Regards,
 Lei.

 On Dec 10, 12:36 pm, mnj [EMAIL PROTECTED] wrote:



  Hi,

  Did you set the below permission in AndroidManifest.xml

  uses-permission android:name=android.permission.RECORD_AUDIO /

  Regards,
  Manoj

  On Dec 10, 9:30 am, Lei [EMAIL PROTECTED] wrote:

   Hi all,
   I want to record the audio from the micphone. But I failed.
   I reference the document. And the link 
   is:http://code.google.com/android/toolbox/apis/media.html

   I got the file. Its size is always 1666B. I played it but hear
   nothing.

   Thanks in advance.
   Regards,
   Lei

   The code is :

   public class MediaRecorderDemo extends Activity {

       private static final String TAG = MediaPlayerDemo;
       private MediaPlayer mMediaPlayer;
       private String path;

           /** Called when the activity is first created. */

           @Override
       public void onCreate(Bundle savedInstanceState) {
           super.onCreate(savedInstanceState);
           setContentView(R.layout.main);

           mPlay = (Button) findViewById(R.id.play);
           mStart = (Button) findViewById(R.id.start);
           mStop = (Button) findViewById(R.id.stop);

           mPlay.setOnClickListener(mPlayListener);
           mStart.setOnClickListener(mStartListener);
           mStop.setOnClickListener(mStopListener);
       }

       @Override
       protected void onDestroy() {
           super.onDestroy();
           // TODO Auto-generated method stub
           if (mMediaPlayer != null) {
               mMediaPlayer.release();
               mMediaPlayer = null;
           }

       }

       private OnClickListener mStopListener = new OnClickListener() {
           public void onClick(View v) {
                   recorder.stop();
                   recorder.release();
           }
       };

       private OnClickListener mPlayListener = new OnClickListener() {
           public void onClick(View v) {
               try {
                       path = /sdcard/audio4;
                       if (path == ) {
                           // Tell the user to provide an audio file URL.
                           Toast
                                   .makeText(
                                           MediaRecorderDemo.this,
                                           Please edit MediaPlayer_Audio
   Activity, 
                                                   + and set the path
   variable to your audio file path.
                                                   +  Your audio file
   must be stored on sdcard.,
                                           Toast.LENGTH_LONG).show();

                       }
                       mMediaPlayer = new MediaPlayer();
                       mMediaPlayer.setDataSource(path);
                       mMediaPlayer.prepare();
                       mMediaPlayer.start();

               } catch (Exception e) {
                   Log.e(TAG, error:  + e.getMessage(), e);
               }

           }
       };

       private OnClickListener mStartListener = new OnClickListener() {
           public void onClick(View v) {
                   String path = /sdcard/audio4;

                   //ContentResolver contentResolver;
                   recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
                   recorder.setOutputFormat
   (MediaRecorder.OutputFormat.THREE_GPP);
                   
   recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
                   recorder.setOutputFile(path);

                   recorder.prepare();
                   recorder.start();
                   }
       };

       private Button mPlay;
       private Button mStop;
       private Button mStart;
       private MediaRecorder recorder = new MediaRecorder();

   }- Hide quoted text -

   - Show quoted text -- 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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Debug Boot complete Broadcast event on phone

2008-12-01 Thread mnj

Hi,

I have a class BootTest which extends BroadcastReceiver. I want to
put a breakpoint in onReceive method and debug from Eclipse IDE when
phone(G1) boots up. What I observe is that the onReceive() method is
getting called but the control is not coming to the breakpoint.
Probably the debugger is not yet connected when BOOT_COMPLETE event
is received. This is just my guess.

Has anyone of you tried debugging such scenario where a receiver is
waiting for BOOT_COMPLETE event.

Thanks,
Manoj

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



[android-developers] Re: Debug Boot complete Broadcast event on phone

2008-12-01 Thread mnj

Thanks. it's working now.


On Dec 2, 1:02 am, Dianne Hackborn [EMAIL PROTECTED] wrote:
 You can call waitForDebugger() at the beginning of the function to give
 yourself a chance to attach the debugger:

 http://code.google.com/android/reference/android/os/Debug.html#waitFo...()





 On Mon, Dec 1, 2008 at 4:23 AM, mnj [EMAIL PROTECTED] wrote:

  Hi,

  I have a class BootTest which extends BroadcastReceiver. I want to
  put a breakpoint in onReceive method and debug from Eclipse IDE when
  phone(G1) boots up. What I observe is that the onReceive() method is
  getting called but the control is not coming to the breakpoint.
  Probably the debugger is not yet connected when BOOT_COMPLETE event
  is received. This is just my guess.

  Has anyone of you tried debugging such scenario where a receiver is
  waiting for BOOT_COMPLETE event.

  Thanks,
  Manoj

 --
 Dianne Hackborn
 Android framework engineer
 [EMAIL PROTECTED]

 Note: please don't send private questions to me, as I don't have time to
 provide private support.  All such questions should be posted on public
 forums, where I and others can see and answer them.- 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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---