[android-developers] Re: Start ACTION_CALL activity from service on Motorola Milestone

2010-07-15 Thread alex.tchumel
Hi!
I'm sorry, looks like the problem is not related with activity or
service.
I have this problem if I have a running MediaRecorder in my service or
some binded service.
The ACTION_CALL activity doesn't appear while the MediaRecorder is
running!
The ACTION_CALL activity appears right after that as the MediaRecorder
is stopped!

Here is my sample
// service's thread...
MediaRecorder recorder = new MediaRecorder();
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setOutputFile('/dev/null');
recorder.prepare();
recorder.start();

Intent dialIntent = new Intent((Intent.ACTION_CALL),
Uri.parse(tel:// + dialOutNumber));
dialIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(dialIntent);

//some activity or sleep... ACTION_CALL doesn't appear, screen is
black and locked, but the call is going well

recorder.stop();
// right after that screen is unlocked and ACTION_CALL activity
appears
recorder.reset();
recorder.release();
recorder = null;
...

NB! I can reproduce this problem only with Motorola Milestone wiith
firmware version 2.1-update1.

The problem is localized.. need a solution!
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: Start ACTION_CALL activity from service on Motorola Milestone

2010-07-04 Thread alex.tchumel
Activity can't be started from the service without
FLAG_ACTIVITY_NEW_TASK flag. Probably there is some alternative to
this flag, but activity from the service doesn't started simple
without this flag and without any other flag.
Read about this flag here 
http://developer.android.com/guide/topics/fundamentals.html
and here 
http://developer.android.com/reference/android/content/Context.html#startActivity(android.content.Intent)
Note that if this method is being called from outside of an Activity
Context, then the Intent must include the FLAG_ACTIVITY_NEW_TASK
launch flag. This is because, without being started from an existing
Activity, there is no existing task in which to place the new activity
and thus it needs to be placed in its own separate task.

Anyway, I have experimented with some combinations of flags,
unfortunately without result.

On Jul 3, 11:38 pm, Mark Murphy mmur...@commonsware.com wrote:
 On Sat, Jul 3, 2010 at 5:54 AM, alex.tchumel alex.tchu...@gmail.com wrote:
  Could you say more about your idea - what kind of the flags can be
  helpfull?

 Position the cursor of  your editor at the end of the line containing
 you setFlags() call. Press the backspace key enough times to eliminate
 all characters on that line. Save the file. Recompile, and test the
 modified application.

  Do you think an alternative to FLAG_ACTIVITY_NEW_TASK flag or some
  additional flag(s) to FLAG_ACTIVITY_NEW_TASK?

 Most startActivity() calls do not need setFlags(). Hence, I am
 suggesting that perhaps the flag you are presently setting is not
 merely not needed but also may be interfering with what you are
 trying to accomplish.

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

 Android 2.2 Programming Books:http://commonsware.com/books

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


[android-developers] Re: Start ACTION_CALL activity from service on Motorola Milestone

2010-07-03 Thread alex.tchumel
Could you say more about your idea - what kind of the flags can be
helpfull?
Do you think an alternative to FLAG_ACTIVITY_NEW_TASK flag or some
additional flag(s) to FLAG_ACTIVITY_NEW_TASK?
I spent a lot of time to fix this problem without of understandig it :
(
I started a simple launcher activity from the service and started
ACTION_CALL from the it. But it also doesn't work. My launcher
activity is fine, but ACTION_CALL hangs up like from the service.
I sent a broadcast message from the service to my activity and started
ACTION_CALL from the it - not help - same bull...:(

I think that it can be solved after understanding - why it happens.
Probably the service should be running with some spesific
attribute(s)?
Probably it's a bug in InCallScreen activity?
May be you know where I can find sources of 2.1-update1 firmware?

Anyway, thank you very much!

On Jul 3, 9:26 am, Mark Murphy mmur...@commonsware.com wrote:
 On Fri, Jul 2, 2010 at 6:11 PM, alex.tchumel alex.tchu...@gmail.com wrote:
  I have a problem with starting ACTION_CALL activity from my service on
  Motorola Milestone after upgrade to 2.1 - update1 firmware version.

  I have a very simple (worked before) code.

  code
  Intent dialIntent = new Intent(Intent.ACTION_CALL, Uri.parse(tel://
  + dialOutNumber));
  dialIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  startActivity(dialIntent);
  /code

 Try getting rid of the setFlags() call and see if that helps.

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

 Android Training...At Your Office:http://commonsware.com/training

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


[android-developers] Start ACTION_CALL activity from service on Motorola Milestone

2010-07-02 Thread alex.tchumel
Hi!
I have a problem with starting ACTION_CALL activity from my service on
Motorola Milestone after upgrade to 2.1 - update1 firmware version.

I have a very simple (worked before) code.

code
Intent dialIntent = new Intent(Intent.ACTION_CALL, Uri.parse(tel://
+ dialOutNumber));
dialIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(dialIntent);
/code

Now looks like InCallScreen hangs up after set audio mode or
ActivityManager blocks InCallScreen activity
The phone does call, but the screen is black and locked.

If I start ACTION_CALL activity from my activity - all right.

Looks at the log:

07-01 00:42:39.617: INFO/ActivityManager(1282): Starting activity:
Intent { act=android.intent.action.CALL dat=tel:5247519 flg=0x1000
cmp=com.android.phone/.OutgoingCallBroadcaster }
07-01 00:42:39.664: DEBUG/PhoneUtils(6381):
checkAndCopyPhoneProviderExtras: some or all extras are missing.
...
07-01 00:42:40.679: DEBUG/InCallScreen(6381): placeCall()...  intent =
Intent { act=android.intent.action.CALL dat=tel:5247519 flg=0x1080
cmp=com.android.phone/.InCallScreen (has extras) }
07-01 00:42:40.679: DEBUG/InCallScreen(6381):
checkIfOkToInitiateOutgoingCall: ServiceState = 0
07-01 00:42:40.679: DEBUG/PhoneUtils(6381): placeCall: '5247519'...
...
07-01 00:42:40.710: DEBUG/PhoneUtils(6381): === phone.dial()
returned:  incoming: false state: DIALING post dial state: NOT_STARTED
07-01 00:42:40.710: DEBUG/PhoneUtils(6381):
setAudioMode(MODE_IN_CALL)...
07-01 00:42:40.710: DEBUG/AudioHardwareMot(1055):
AudioMgr:setMode(IN_CALL)
07-01 00:42:40.710: DEBUG/AudioHardwareMot(1055): AudioMgr:setMode
MODE_IN_CALL
07-01 00:42:40.710: INFO/MYPhoneService(6437): Telephony OFFHOOK
...
Here the screen is black and locked ~ 3 min. Only status panel
available. Call ends. After some timeout see InCallScreen... If start
from the Activity - the InCallScreen apears right after call start.
...
07-01 00:45:14.031: DEBUG/InCallScreen(6381): placeCall:
PhoneUtils.placeCall() succeeded for regular call '5247519'.
07-01 00:45:14.031: DEBUG/DTMFTwelveKeyDialer(6381): closeDialer()...
07-01 00:45:14.031: DEBUG/DTMFTwelveKeyDialer(6381): clearDigits()...
07-01 00:45:14.031: DEBUG/PhoneApp(6381): updateProximitySensorMode:
state = OFFHOOK
07-01 00:45:14.031: DEBUG/PhoneApp(6381): updateProximitySensorMode:
lock already released.
07-01 00:45:14.031: DEBUG/PhoneApp(6381): isInDockMode bInDockMode
is : false
07-01 00:45:14.039: DEBUG/StatusBar(1282): DISABLE_EXPAND: yes

I can send full log, but it is really big.

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] Poor audio quality captured from microphone with MediaRecorder

2009-08-11 Thread alex.tchumel

Hi!
I've implemented Audio Capture Setup and Start example (http://
developer.android.com/guide/topics/media/index.html) with small
modification - the output format is MPEG_4 not  THREE_GPP.

The result - records with extremely poor audio quality. :(

Could you help me to understand where is error and how is possible to
do really good audio records with Android?

I've done an experiment with Camcorder - standard Android application.
Sound quality of the video is same poor. The audio signal is extremely
low (quite).

Is it by design or may be some hardware problem (T-Mobile G1)?

I've found description similar problem here -
http://osdir.com/ml/AndroidDevelopers/2009-06/msg00752.html -
Microphone audio capture with emulator is of very poor quality. In
my case this problem reproduces on the real device. Unfortunately I
have not found answer. I read about some custom encoders.. but have
not found any example how implement them.

Thanks in advance,
AT

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Poor audio quality captured from microphone with MediaRecorder

2009-08-11 Thread alex.tchumel

Hi!
I've implemented Audio Capture Setup and Start example (http://
developer.android.com/guide/topics/media/index.html) with small
modification - the output format is MPEG_4 not  THREE_GPP.

The result - records with extremely poor audio quality. :(

Could you help me to understand where is error and how is possible to
do really good audio records with Android?

I've done an experiment with Camcorder - standard Android application.
Sound quality of the video is same poor. The audio signal is extremely
low (quite).

Is it by design or may be some hardware problem (T-Mobile G1)?

I've found description similar problem here -
http://osdir.com/ml/AndroidDevelopers/2009-06/msg00752.html -
Microphone audio capture with emulator is of very poor quality. In
my case this problem reproduces on the real device. Unfortunately I
have not found answer. I read about some custom encoders.. but have
not found any example how implement them.

Thanks in advance,
AT

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