[android-developers] Re: how to Play music from AudioTrack

2010-02-15 Thread skink


On Feb 16, 6:36 am, kavitha  wrote:
> Thanks skink,,
>
> There is very small gaps in between playing of 2 files.May be MediaPlayer
> takes milliseconds time to start in between.
>
> when listening to continous stream,you can make out,,You feel like music is
> not continuous.Itz stucking sometime.
>
> In iphone,they have option of storing audio directly to stream and play from
> it,so there is no need to start mediaplayer again and again.
>
> Unfortunately we don't have such option in Android.
>
> Thanks
> Kavitha
>
>
>
> On Tue, Feb 16, 2010 at 12:22 AM, skink  wrote:
>
> > On Feb 15, 2:05 pm, kavitha  wrote:
> > > yes,i am aware about that
>
> > > If i download into files from continous music online link and then play
> > from
> > > MediaPlayer,,,i notice some gap between switching over of 2 media
> > > players/files,
>
> > > so i thought of decoding audio into stream and play from audiotrack
>
> > > How to play files from media players without gap so that user feel music
> > > flow is continuous?
>
> > > Thanks
> > > Kavitha
>
> > i see (hear) no gaps:
>
> > final MediaPlayer p2 = MediaPlayer.create(Test.this,
> > Uri.parse("file:///sdcard/02.ogg"));
> > final MediaPlayer p3 = MediaPlayer.create(Test.this,
> > Uri.parse("file:///sdcard/03.ogg"));
> > p2.setOnCompletionListener(new OnCompletionListener() {
> >        public void onCompletion(MediaPlayer mp) {
> >                p3.start();
> >        }
> > });
> > p2.start();
>
> > do you hear any gaps?
>
> > pskink
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en

have you tried my code?

did you use ogg files instead of mp3'

ogg files are mauch better handled by MediaPlayer so i didn't have
*any* gap

in fact, when using mp3 i noticed small delay between tracks

pskink

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


[android-developers] Re: PVMFFailure when using MediaPlayer for radio streams

2010-02-15 Thread Kamal Hasan
Hi,

 Any one has tried with HTTPS on media player

I am getting "Command PLAYER_SET_DATA_SOURCE completed with an error
or info PVMFErrNotSupported" Error.

I am able to play the file on http but failed to play on HTTPS. Can
you help me in this regard.

Kamal




On Feb 11, 10:42 pm, Steve  wrote:
> I can make this work on 1.6 with this 
> linkhttp://www.colorado.edu/AmStudies/lewis/Design/blue.mp3
>
> What is the url you are trying to connect to?
>
> On Jan 29, 6:08 am, David  wrote:
>
>
>
> > ps-I am using version 1.5 on a HTC phone
>
> > On Jan 14, 9:48 pm, Tanmay  wrote:
>
> > > I tried doing this in 1.6 but still gave me the Prepare Failed 0x1
> > > error along with thePVMFFailurein the log.
> > > Has there been any solution to this one developed yet?
>
> > > On Dec 14 2009, 10:13 pm, YaushiIizuka  wrote:
>
> > > > Hi.
>
> > > > String url = "http://your.url";;
> > > > MediaPlayer mp = new MediaPlayer();
> > > > mp.setDataSource(url);
> > > > mp.setAudioStreamType(AudioManager.STREAM_MUSIC);
> > > > mp.prepare();
> > > > mp.start();
>
> > > > On 10月23日, 午後3:28, dede  wrote:
>
> > > > > Hi,
> > > > > In 1.6,I also try to play stream through setDataSource(http://
> > > > > xxx/.mp3),
> > > > > but also it return IOException: prepare failed, status=0x1.
> > > > > If set the url into windowsmediaplayer, it can play correctly, I
> > > > > wanna know your problem whether be resolved?
> > > > > If yes, can u tell me the solution,thanks very much.
>
> > > > > On 10月7日, 上午5时41分, iwhoyt  wrote:
>
> > > > > > In 1.5 I was able to stream an mp3 over http by passing the url to
> > > > > > setDataSource(). However I started gettingPVMFFailures in 1.6. For
> > > > > > me the issue was the Content-Type http header. If the header was set
> > > > > > correctly (Content-Type: audio/mpeg), the stream played. Otherwise 
> > > > > > if
> > > > > > failed during PLAYER_INIT.
>
> > > > > > On Sep 2, 2:32 am, siliconeagle  wrote:
>
> > > > > > > Also the URl is a http (MP3) stream URL - as opposed tioo other 
> > > > > > > opost
> > > > > > > where RTSP is being tried. It looks like it should just work. Has
> > > > > > > anyone else got streaming working via a streaming URL?
>
> > > > > > > On Sep 1, 1:24 pm, siliconeagle  wrote:
>
> > > > > > > > I am trying to build streaming radio into my app, which works 
> > > > > > > > fines
> > > > > > > > streaming files over the internet, but when i try to use a 
> > > > > > > > shoutcast
> > > > > > > > url in get the error below, which from the soruce code looks 
> > > > > > > > liek the
> > > > > > > > mediaPlayer is looking for the duration in the header. Does 
> > > > > > > > anyone
> > > > > > > > know if shoutcast urls will work withthe defaultmediaplayer? Or 
> > > > > > > > do i
> > > > > > > > have to download chunks into a ping-pong buffer sor something? 
> > > > > > > > The url
> > > > > > > > has no porblems downloading via the browser.
>
> > > > > > > > the error is:-
>
> > > > > > > > 09-01 11:53:25.634 E/MediaPlayer(16972): stop called in state 1
> > > > > > > > 09-01 11:53:27.324 D/BatteryWidget(15623): Updating Views
> > > > > > > > 09-01 11:53:30.445 E/PlayerDriver(   35): Command PLAYER_INIT
> > > > > > > > completed with an error or infoPVMFFailure
> > > > > > > > 09-01 11:53:30.445 E/MediaPlayer(16972): error (1, -1)
> > > > > > > > 09-01 11:53:30.504 I/NotificationService(   55): enqueueToast
> > > > > > > > pkg=net.robmunro.mypod 
> > > > > > > > callback=android.app.ITransientNotification$Stub
> > > > > > > > $pr...@4323b8f8 duration=1000
> > > > > > > > 09-01 11:53:30.514 W/System.err(16972): java.io.IOException: 
> > > > > > > > Prepare
> > > > > > > > failed.: status=0x1
> > > > > > > > 09-01 11:53:30.644 W/System.err(16972): at
> > > > > > > > android.media.MediaPlayer.prepare(Native Method)
> > > > > > > > 09-01 11:53:30.644 W/System.err(16972): at
> > > > > > > > net.robmunro.mypod.util.MediaPlayerWrapper.playMedia
> > > > > > > > (MediaPlayerWrapper.java:111)
>
> > > > > > > > the code i use is:-
> > > > > > > > try {
> > > > > > > > mPlayer.stop();
> > > > > > > > mPlayer.reset();} catch (Exception e) {
>
> > > > > > > > e.printStackTrace();}
>
> > > > > > > > this.source=source;
> > > > > > > > if (source.equals(Globals.SOURCE_LOCAL)) {
> > > > > > > >  mPlayer.setDataSource(f.path);
> > > > > > > >  buffered = 0;} else if 
> > > > > > > > (source.equals(Globals.SOURCE_STREAM)) {
>
> > > > > > > > mPlayer.setDataSource(f.remoteUrl);
> > > > > > > >  buffered = 100;}
>
> > > > > > > > mPlayer.prepare();
> > > > > > > > mPlayer.start();- 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 

Re: [android-developers] Hint for Spinner?

2010-02-15 Thread Chirayu Dalwadi
Hey TreKing, Can u show the 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] expanding android.jar

2010-02-15 Thread saru
Some classes are NOT PUBLIC like android.os.ServiceManager,
android.view.IWindowManager, etc, they are implemented in the mobile
devices, but not present in the SDK .jar. This is because these
classes are private APIs .
now please tell me is there any way like compiling source code or
importing private class file into android.jar so that i can use this
private APIs

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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: Example that prints 1 2 3 4 on A A A A?

2010-02-15 Thread BobG
Thanks for the reply. Can you flesh it out a little? I see some
examples that dont use override, so there must be a reason? Do I stick
this in the activity or the view or the onCreate or ?? I get this
event, and 'do some stuff' like increment a count and print it out.
Then what? When I hit the key a 2nd time, does the count 'or' over the
old count? So do I need to do an invalidate somewhere to redraw the
background? (Its a png of a dial face... I want to rotate the needle
in 1 deg increments using the az keys for up, down).

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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: programatically press a button

2010-02-15 Thread saru
hi  Houcem Berrayana,
 thanks for sharing with me and helping me. But unfortunately i am not
getting output by running your code.Can you please send me the whole
sample code.if you can then please mail me.my mail id,
sarucs...@gmail.com


On Feb 15, 4:52 pm, Houcem Berrayana 
wrote:
> Hi saru,
> I posted the same question last Friday. I found the solution which
> consists on dispatching the event using the event dispatcher of the
> activity. If you would like to read some advanced technical details
> about event processing you can read this excellent 
> post:http://letsgoustc.spaces.live.com/blog/cns!89AD27DFB5E249BA!488.entry
>
>                  public void onClick(View v) {
>
>                                 new Thread(new Runnable() {
>
>                                         @Override
>                                         public void run() {
>                                                 KeyEvent backEvtDown = new 
> KeyEvent(KeyEvent.ACTION_DOWN,
> KeyEvent.KEYCODE_BACK);
>                                                 KeyEvent backEvtUp = new 
> KeyEvent(KeyEvent.ACTION_UP,
> KeyEvent.KEYCODE_BACK);
>                                                 
> mActivity.dispatchKeyEvent(backEvtDown);
>                                                 
> mActivity.dispatchKeyEvent(backEvtUp);
>
>                                         }
>                                 }).start();
>                         }
>
> Best Regards,
>
> On 15 fév, 10:28, saru  wrote:
>
> > hey, Please tell me 
> > abouthttp://davanum.wordpress.com/2007/12/19/android-simulate-key-strokes/.
> > How they did it
>
> > On Feb 14, 7:17 pm, Mark Murphy  wrote:
>
> > > saru wrote:
> > > > Hey i want to write a program in android to press  menu button or end
> > > > button or answer button automatically.
>
> > > You can't, sorry.
>
> > > --
> > > Mark Murphy (a Commons 
> > > Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> > > Android Consulting/App Development:http://commonsware.com/consulting
>
>

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


[android-developers] Re: Popping up a custom Dialog from a Widget (AppWidget)

2010-02-15 Thread Roland
Maybe setting android:theme="@android:style/Theme.Dialog" in the
manifest entry for the QuickConnectActivity will give you the look you
want.

Roland

On Feb 8, 10:07 am, Nik Bhattacharya  wrote:
> I am developing a desktopwidget.  I would like to pop up a custom
> dialog when a remote view is clicked (much like the Facebookwidgeton
> Android when the user clicks in the update status field).  I know how
> to usependingintents to launch an activity and have that currently
> hooked up.  I would prefer a custom dialog instead, so any help would
> be much appreciated.
>
> My current code is:
>
> Intentintent= newIntent(context, 
> QuickConnectActivity.class);intent.setData(Uri.withAppendedPath(People.CONTENT_URI,
>  person._id));
> PendingIntent pendingIntent = PendingIntent.getActivity(context, 0,intent, 0);
> remoteViews.setOnClickPendingIntent(viewId, pendingIntent);
>
> Thanks,
>
> Nik Bhattacharya

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


Re: [android-developers] Re: how to Play music from AudioTrack

2010-02-15 Thread kavitha
Thanks skink,,

There is very small gaps in between playing of 2 files.May be MediaPlayer
takes milliseconds time to start in between.

when listening to continous stream,you can make out,,You feel like music is
not continuous.Itz stucking sometime.

In iphone,they have option of storing audio directly to stream and play from
it,so there is no need to start mediaplayer again and again.

Unfortunately we don't have such option in Android.

Thanks
Kavitha






On Tue, Feb 16, 2010 at 12:22 AM, skink  wrote:

>
>
> On Feb 15, 2:05 pm, kavitha  wrote:
> > yes,i am aware about that
> >
> > If i download into files from continous music online link and then play
> from
> > MediaPlayer,,,i notice some gap between switching over of 2 media
> > players/files,
> >
> > so i thought of decoding audio into stream and play from audiotrack
> >
> > How to play files from media players without gap so that user feel music
> > flow is continuous?
> >
> > Thanks
> > Kavitha
> >
> >
> >
>
> i see (hear) no gaps:
>
> final MediaPlayer p2 = MediaPlayer.create(Test.this,
> Uri.parse("file:///sdcard/02.ogg"));
> final MediaPlayer p3 = MediaPlayer.create(Test.this,
> Uri.parse("file:///sdcard/03.ogg"));
> p2.setOnCompletionListener(new OnCompletionListener() {
>public void onCompletion(MediaPlayer mp) {
>p3.start();
>}
> });
> p2.start();
>
> do you hear any gaps?
>
> pskink
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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: system hangs while giving Android build

2010-02-15 Thread Saikat
No no..I am telling about eclipse build. I am building the full source
code in Ubuntu. Though I have eclipse installed in Ubuntu, but I think
it is not related to eclipse.

On Feb 16, 2:26 am, Bob Kerns  wrote:
> When I change the SDK version for a project, it hangs. I end up
> killing Eclipse and restarting, then doing  a Clean, and all is fine.
>
> (I have to start remembering to turn off the automatic build in these
> cases).
>
> Perhaps you're seeing something similar? Maybe if a build tool gets an
> error at the wrong point in the process, Eclipse ends up waiting for
> something that's not going to happen?
>
> On Feb 15, 4:05 am,Saikat wrote:
>
>
>
> > But other people here, are using 1 GB RAM and the build is fine in
> > their system. Nobody is seeing any system stuck kind of problem. My
> > hard disk is also fine.
>
> > On Feb 10, 5:13 pm, James Wang  wrote:
>
> > > I did have the same experience before. I think 1G is not enough and
> > > your disk should be good enough.

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


Re: [android-developers] Re: Emulator Loading Error

2010-02-15 Thread Sasikumar.S
Hi Gino,

Me too same.
My system configuration is 1GB RAM.
ganymade eclipse

On Tue, Feb 16, 2010 at 10:26 AM, g...@devicedriven wrote:

> hi sasikumar..
>
> whats your s/m configuration??
> even i get almost 4 such errors..
> clicking on wait will resume them...i think this is due to limited
> resources..
> im working on windows xp machine/1gb ram and using ganymade eclipse
>
> Regards
> Gino
>
> On Feb 15, 4:33 pm, "Sasikumar.S"  wrote:
> > Hi,
> >
> > When i try to load my emulator it is showing 2 errors with 'Force Close'
> &
> > 'wait' Button.
> >
> > Error are :-
> >
> > Appplication Android Keyboard (in process com.android.inputmethod.latin)
> is
> > not responding
> >
> > Application Settings (in process com.android.settings) is not responding
> >
> > How to stop showing this?...
> >
> > Any suggestions?..
> >
> > --
> > 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




-- 
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: Emulator Loading Error

2010-02-15 Thread g...@devicedriven
hi sasikumar..

whats your s/m configuration??
even i get almost 4 such errors..
clicking on wait will resume them...i think this is due to limited
resources..
im working on windows xp machine/1gb ram and using ganymade eclipse

Regards
Gino

On Feb 15, 4:33 pm, "Sasikumar.S"  wrote:
> Hi,
>
> When i try to load my emulator it is showing 2 errors with 'Force Close' &
> 'wait' Button.
>
> Error are :-
>
> Appplication Android Keyboard (in process com.android.inputmethod.latin) is
> not responding
>
> Application Settings (in process com.android.settings) is not responding
>
> How to stop showing this?...
>
> Any suggestions?..
>
> --
> 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: Search options for Market?

2010-02-15 Thread Benn
Right, thanks!

On Feb 15, 3:48 pm, TreKing  wrote:
> On Sun, Feb 14, 2010 at 11:49 PM, Benn  wrote:
> > I'm looking for details (documents, posts, or even just a list)
> > regarding what options Market supports (for ex: 'pub') to restrict or
> > target the search.
>
> http://developer.android.com/intl/fr/guide/publishing/publishing.html...
>
> --- 
> --
> 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


[android-developers] Re: Serious android app problem in Canada

2010-02-15 Thread markusn82
I'm in the exact same boat as you Ian. I don't know why Google hasn't
at least given us a timeline on when Canadians will be able to sell
apps. For all we know, this will never happen. C'mon Google.. Give us
at least some answer to keep us devoted to the platform!

On Jan 21, 4:57 pm, Streets Of Boston  wrote:
> Some (very) small consolation.
> Try, for now, to offer your app through other markets, such as
> SlideMe, Handango, MobiHand, etc.
>
> On Jan 21, 12:57 pm, Alex  wrote:
>
>
>
> > No, you cannot either upload or download paid apps from android market
> > in Canada.
> > We are in the same boat and I've been waiting for this for the last
> > one year.
>
> > ~ Sad Android Developer from Canada
>
> > On Jan 19, 8:11 am, ian  wrote:
>
> > > Hey Candroid developers:
>
> > > Now I hope I'm wrong but it appears as an Android developer in Canada
> > > I cannot sell my apps through the |Market, nor can a Canadian customer
> > > purchase my paid apps.
>
> > > Are these dire concerns valid?
>
> > > Maybe somebody from the Google mothership could clarify this important
> > > matter as soon as possible.
>
> > > The Android Market accepted my developer fee of $25 no problem.  And I
> > > don't recall any restrictions mentioned for Canadian developers or for
> > > paid apps in Canada.
>
> > > I worry that  hundreds of hours of my work may have been wasted.
>
> > > Like most Canadian Android developers who share these concerns, I am
> > > considering putting my Android development on hold immediately and
> > > perhaps permanently, and porting my apps to iPhone and/or Pre.
>
> > > Any other Canucks feel the same way?- 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] DRM support for Ringtones on Android

2010-02-15 Thread Iroid
Hi,

I am trying to create an application that downloads ringtones to the
phone and I am trying to support Forward Locking on the downloaded
ringtones. Currently I am saving the contents as .mp3 on
externalDirectory.Reading forums and other articles online, it seems
like android does have DRM 1.0 and DRM 2.0 support using
libdrm1_jni.so or libdrm2_jini.so

e.g 
http://groups.google.com/group/android-platform/browse_thread/thread/12a3083e9ed21d6f

I have played around little bit with this. Approach that I tried
1.  I have downloaded the package android.drm.mobile1 and tried to
call one of its function DrmRawContent() from my app.

Issues that this gives is, it loads one library which is
libdrm1_jni.so but it depends on others libraries which i have trouble
to load. Here is the snapshot:

D/dalvikvm( 6176): Trying to load lib /system/lib/libdrm1_jni.so
0x46aaa218
D/dalvikvm( 6176): Added shared lib /system/lib/libdrm1_jni.so
0x46aaa218
D/dalvikvm( 6176): +++ not scanning '/system/lib/libwebcore.so' for
'nativeConstructDrmContent' (wrong CL)
D/dalvikvm( 6176): +++ not scanning '/system/lib/libmedia_jni.so' for
'nativeConstructDrmContent' (wrong CL)
D/dalvikvm( 6176): +++ not scanning '/system/lib/libexif.so' for
'nativeConstructDrmContent' (wrong CL)
D/dalvikvm( 6176): +++ not scanning '/system/lib/libsrec_jni.so' for
'nativeConstructDrmContent' (wrong CL)
W/dalvikvm( 6176): No implementation found for native Lmobile1/
DrmRawContent;.nativeConstructDrmContent (Ljava/io/InputStream;II)I

Questions that I have:
1. Is there any approach I can follow to support DRM using the
existing code from Android?
2. The approach I followed, is it correct or am I missing anything?
3. If there is nothing already available on Android, Can someone
please point me to where I can find on "how to create DRM support"
specially for Forwar Lock?

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


[android-developers] Tab Index

2010-02-15 Thread Sasikumar.S
Hi,

How to set Tab Index for elements in android ?..


In my layout i'm having more than 5 textview.

I need to set focus first on 2nd textview then 4th then 3th...
Like that i need to focus.

How to set tab index for that?...

Any suggestion or example program ?..

-- 
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: how to crop an image in android 2.x

2010-02-15 Thread Streets Of Boston
First, don't set the class-name.
Your customer's phone may not have this particular activity
(com.android.camera.CropImage) installed.

But this should not give you the 'permission denial' error.
Maybe the CROP action can only crop public images. You set yours to
PRIVATE.

On Feb 12, 9:18 am, Vaibhav Goel  wrote:
> I need to crop an image whose Uri is known.
>
> In 1.6 I used the below code.
>
>  Intent i = new Intent("com.android.camera.action.CROP");
>  i.setClassName("com.android.camera", "com.android.camera.CropImage");
>  i.setData(imageUri);      // imageUri = 
> content://media/external/images/media/40
>  i.putExtra("noFaceDetection", false);
>  i.putExtra("outputX", 75);
>  i.putExtra("outputY", 75);
>  i.putExtra("aspectX", 1);
>  i.putExtra("aspectY", 1);
>  i.putExtra("scale", true);
>
>  ContentValues values = new ContentValues();
>  values.put(Media.TITLE, "User_t" + "_Image");
>  values.put(Media.BUCKET_ID, "User-T");
>  values.put(Media.BUCKET_DISPLAY_NAME, "image_t");
>  values.put(Media.IS_PRIVATE, 1);
>  userThumbnailUri = getContentResolver().insert(
>                         Media.EXTERNAL_CONTENT_URI, values);
>  i.putExtra(MediaStore.EXTRA_OUTPUT, userThumbnailUri);
> startActivityForResult(i, CROP_IMAGE);
>
> It worked fine on 1.6 but when i tested it on 2.1 it give error as
> shown below.
>
> 02-12 19:09:43.504: ERROR/AndroidRuntime(851):
> java.lang.RuntimeException: Failure delivering result
> ResultInfo{who=null, request=1, result=-1, data=Intent { dat=content://
> media/external/images/media/40 }} to activity {net.urbansignals/
> net.urbansignals.activity.user.SignUpActivity}:
> java.lang.SecurityException: Permission Denial: starting Intent
> { act=com.android.camera.action.CROP dat=content://media/external/
> images/media/40 cmp=com.android.camera/.CropImage (has extras) } from
> ProcessRecord{44ae1ac8 851:net.urbansignals/10045} (pid=851,
> uid=10045) requires null
> 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> android.app.ActivityThread.deliverResults(ActivityThread.java:3329)
> 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> android.app.ActivityThread.handleSendResult(ActivityThread.java:3371)
> 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> android.app.ActivityThread.access$2700(ActivityThread.java:119)
> 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1893)
> 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> android.os.Handler.dispatchMessage(Handler.java:99)
> 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> android.os.Looper.loop(Looper.java:123)
> 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> android.app.ActivityThread.main(ActivityThread.java:4363)
> 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> java.lang.reflect.Method.invokeNative(Native Method)
> 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> java.lang.reflect.Method.invoke(Method.java:521)
> 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> com.android.internal.os.ZygoteInit
> $MethodAndArgsCaller.run(ZygoteInit.java:860)
> 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
> 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> dalvik.system.NativeStart.main(Native Method)
> 02-12 19:09:43.504: ERROR/AndroidRuntime(851): Caused by:
> java.lang.SecurityException: Permission Denial: starting Intent
> { act=com.android.camera.action.CROP dat=content://media/external/
> images/media/40 cmp=com.android.camera/.CropImage (has extras) } from
> ProcessRecord{44ae1ac8 851:net.urbansignals/10045} (pid=851,
> uid=10045) requires null
> 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> android.os.Parcel.readException(Parcel.java:1218)
> 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> android.os.Parcel.readException(Parcel.java:1206)
> 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:
> 1214)
> 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> android.app.Instrumentation.execStartActivity(Instrumentation.java:
> 1373)
> 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> android.app.Activity.startActivityForResult(Activity.java:2749)
> 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> net.urbansignals.activity.user.SignUpActivity.onActivityResult(SignUpActivi­ty.java:
> 326)
> 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> android.app.Activity.dispatchActivityResult(Activity.java:3828)
> 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> android.app.ActivityThread.deliverResults(ActivityThread.java:3325)
> 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     ... 11 more
>
> Can any body suggest the proper way do crop an image in 2.x ?
>
> Thanks for your suggestions.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group,

[android-developers] Re: how to crop an image in android 2.x

2010-02-15 Thread Vaibhav Goel
Thanks, Tuhin, for your intrest. But I want to crop the image, not re-
scale the image, where user can select the area to be croped form the
full size image.

On Feb 15, 2:40 pm, Tuhin subhra  wrote:
> Bitmap bitmapOrg = BitmapFactory.decodeFile(Location_Image.filename);
>                         int width = bitmapOrg.getWidth();
>                 int height = bitmapOrg.getHeight();
>                 int newWidth = 200;
>                 int newHeight = 200;
>
>                 // calculate the scale - in this case = 0.4f
>                 float scaleWidth = ((float) newWidth) / width;
>                 float scaleHeight = ((float) newHeight) / height;
>
>                 // createa matrix for the manipulation
>                 Matrix matrix = new Matrix();
>                 // resize the bit map
>                 matrix.postScale(scaleWidth, scaleHeight);
>                 // rotate the Bitmap
>                 matrix.postRotate(90);
>
>                 // recreate the new Bitmap
>                 Bitmap resizedBitmap = Bitmap.createBitmap(bitmapOrg, 0, 0,
>                                   width, height, matrix, true);
>                 resizedBitmap.compress(CompressFormat.JPEG, 50, new
> FileOutputStream( Location_Image.filename2 ));
>
> On Feb 12, 7:18 pm, Vaibhav Goel  wrote:
>
>
>
> > I need tocropan image whose Uri is known.
>
> > In 1.6 I used the below code.
>
> >  Intent i = new Intent("com.android.camera.action.CROP");
> >  i.setClassName("com.android.camera", "com.android.camera.CropImage");
> >  i.setData(imageUri);      // imageUri = 
> > content://media/external/images/media/40
> >  i.putExtra("noFaceDetection", false);
> >  i.putExtra("outputX", 75);
> >  i.putExtra("outputY", 75);
> >  i.putExtra("aspectX", 1);
> >  i.putExtra("aspectY", 1);
> >  i.putExtra("scale", true);
>
> >  ContentValues values = new ContentValues();
> >  values.put(Media.TITLE, "User_t" + "_Image");
> >  values.put(Media.BUCKET_ID, "User-T");
> >  values.put(Media.BUCKET_DISPLAY_NAME, "image_t");
> >  values.put(Media.IS_PRIVATE, 1);
> >  userThumbnailUri = getContentResolver().insert(
> >                         Media.EXTERNAL_CONTENT_URI, values);
> >  i.putExtra(MediaStore.EXTRA_OUTPUT, userThumbnailUri);
> > startActivityForResult(i, CROP_IMAGE);
>
> > It worked fine on 1.6 but when i tested it on 2.1 it give error as
> > shown below.
>
> > 02-12 19:09:43.504: ERROR/AndroidRuntime(851):
> > java.lang.RuntimeException: Failure delivering result
> > ResultInfo{who=null, request=1, result=-1, data=Intent { dat=content://
> > media/external/images/media/40 }} to activity {net.urbansignals/
> > net.urbansignals.activity.user.SignUpActivity}:
> > java.lang.SecurityException: Permission Denial: starting Intent
> > { act=com.android.camera.action.CROPdat=content://media/external/
> > images/media/40 cmp=com.android.camera/.CropImage (has extras) } from
> > ProcessRecord{44ae1ac8 851:net.urbansignals/10045} (pid=851,
> > uid=10045) requires null
> > 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> > android.app.ActivityThread.deliverResults(ActivityThread.java:3329)
> > 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> > android.app.ActivityThread.handleSendResult(ActivityThread.java:3371)
> > 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> > android.app.ActivityThread.access$2700(ActivityThread.java:119)
> > 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> > android.app.ActivityThread$H.handleMessage(ActivityThread.java:1893)
> > 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> > android.os.Handler.dispatchMessage(Handler.java:99)
> > 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> > android.os.Looper.loop(Looper.java:123)
> > 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> > android.app.ActivityThread.main(ActivityThread.java:4363)
> > 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> > java.lang.reflect.Method.invokeNative(Native Method)
> > 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> > java.lang.reflect.Method.invoke(Method.java:521)
> > 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> > com.android.internal.os.ZygoteInit
> > $MethodAndArgsCaller.run(ZygoteInit.java:860)
> > 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
> > 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> > dalvik.system.NativeStart.main(Native Method)
> > 02-12 19:09:43.504: ERROR/AndroidRuntime(851): Caused by:
> > java.lang.SecurityException: Permission Denial: starting Intent
> > { act=com.android.camera.action.CROPdat=content://media/external/
> > images/media/40 cmp=com.android.camera/.CropImage (has extras) } from
> > ProcessRecord{44ae1ac8 851:net.urbansignals/10045} (pid=851,
> > uid=10045) requires null
> > 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> > android.os.Parcel.readException(Parcel.java:1218)
> > 02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
> > android.os.

[android-developers] Re: custom seek bar

2010-02-15 Thread Vaibhav Goel
Thanks skink

On Feb 16, 1:21 am, skink  wrote:
> Vaibhav Goel wrote:
> > Hi
>
> > I want to make a custom seek bar having color gradient as shown in the
> > below image url.
>
> >http://i49.tinypic.com/2mi5lsh.jpg
>
> > For this I tried to make background as
>
> > seek_background.xml
>
> > http://schemas.android.com/apk/res/android";
> > android:shape="rectangle">
> >      > android:endColor="#"
> >             android:angle="0"/>
> >     
> >      >             android:right="7dp" android:bottom="7dp" />
> >     
> > 
>
> > and Seekbar in layout xml as
>
> >      >     android:layout_width="fill_parent"
> >     android:layout_height="wrap_content"
> >     android:padding="20sp"
> >     android:progressDrawable="@drawable/seek_background"/>
>
> > But it makes the complete background colored as shown in below url.
>
> >http://i47.tinypic.com/104ktxe.jpg
>
> > Please help me out.
>
> > Thanks
>
> Hi,
>
> for more extensive/sophisticated customization you coukd take a look
> into tutorial i once wrote @anddev
>
> http://www.anddev.org/decorated_and_animated_seekbar_tutorial-t10937
>
> i'm not sure if you can download sources attached if you are not
> logged
>
> pskink

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


[android-developers] Re: custom seek bar

2010-02-15 Thread Vaibhav Goel
Thanks Mark.

By changing in  drawable resource, I got the desired
result.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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: Media Player not working on HTTPS as Data source

2010-02-15 Thread Kamal Hasan
Hi ,

Whether Android Media Player supports HTTPS protocol ?

Kamal

On Feb 15, 7:34 pm, Kamal Hasan  wrote:
> Hi,
>
> I am able to play mp3 files from a HTTP server.I have given the link
> as Datasource and it is working fine.When I
>
> replaced the link with HTTPS then media player is not working.Please
> help to resolve this issue.
>
> Thanks in advance.
>
> Cheers,
> Kamal

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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] the correct hprof file location

2010-02-15 Thread Fred Grott(Android Expert, http://mobilebytes.wordpress.com)
Is Google aware that docs are listing two hrprof file locations?

hprof dump method gives /sdcard/dump.hprof as the default in docs
whereas monkey dev page indicate data/misc..

ahem  which one is correct?

Assuming that it might be the monkey dev page being wrong..can that be
turned in as a bug report against docs?

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

2010-02-15 Thread Christopher Walker
I forgot. That was the problem. Thank you.

On Feb 15, 7:33 pm, TreKing  wrote:
> On Mon, Feb 15, 2010 at 6:27 PM, Christopher Walker <
>
> sven.hakons...@gmail.com> wrote:
> > The app appears to crash shortly after I reach
> > startActivityForResult(i, NEW_GAME);
> > but before I make it into the constructor.
>
> Did you remember to declare this activity in your manifest?
>
> --- 
> --
> 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


Re: [android-developers] Re: Intents

2010-02-15 Thread TreKing
On Mon, Feb 15, 2010 at 6:27 PM, Christopher Walker <
sven.hakons...@gmail.com> wrote:

> The app appears to crash shortly after I reach
> startActivityForResult(i, NEW_GAME);
> but before I make it into the constructor.
>

Did you remember to declare this activity in your manifest?

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

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

Re: [android-developers] Re: port forwarding

2010-02-15 Thread linux newbie
Hi Mark & Bob,

Thanks very much for your expert suggestions.

:)

On Tue, Feb 16, 2010 at 12:33 PM, Bob Kerns  wrote:

> Never say never -- it would be appropriate for a mySQLAdmin tool, say,
> talking over wifi.
>
> Anyway, my answer to Mr. L. Newbie's question, is:
>
> 1. You could probably find and/or port such a thing. MySQL's Connector/
> J is pure Java. It might rely on some standard J2SE stuff that's not
> present on Android, in which case you'd have to come up with
> substitutes.
>
> 2. GET/POST is *not* the only way -- but it is the best way, the tried
> and true way, and what most other people are doing. Google
> "RESTful" (I'm surprised it's that easy to get a good search result,
> but it is). The alternative would be to use SOAP, but I wouldn't do
> that unless you already know why you want to do that (such as
> compatibility with an existing service or environment).
>
> This will also drive the design of your application in a direction
> which is more mobile-friendly. It's not really a matter of mobile vs
> LAN -- really, I don't recommend the use of direct database
> connections except between tightly-coupled components -- such as
> between your web service, and its back-end database server. Doing
> direct SQL poses everything from security risks to temptations to
> depend on aspects of your data model which shouldn't be exposed,
> leading to massive compatibility problems, and the need to update all
> clients at the same timethe list of reasons goes on and on.
>
> On Feb 15, 3:55 pm, Mark Murphy  wrote:
> > linux newbie wrote:
> > > 1. Is there mysql-connector/jdbc for android?
> >
> > It doesn't matter -- you shouldn't use it even if it exists.
> >
> > As I've now written for the third time in the past 36 hours or so
> > (previous two on StackOverflow):
> >
> > "Never never never use a database driver across an Internet connection,
> > for any database, for any platform, for any client, anywhere. That goes
> > double for mobile. Database drivers are designed for LAN operations and
> > are not designed for flaky/intermittent connections or high latency."
> >
> > --
> > Mark Murphy (a Commons Guy)http://commonsware.com|
> http://twitter.com/commonsguy
> >
> > Android Consulting/App Development:http://commonsware.com/consulting
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

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

Re: [android-developers] Re: Smaller tabs, such as the Facebook official app

2010-02-15 Thread Mark Murphy
Bob Kerns wrote:
> My Nexus is rooted, so as keianhzo points out, perhaps that has
> something to do with it. Or perhaps doing 'adb root' first would
> suffice.

"adbd cannot run as root in production builds", so I'm guessing it rolls
back to your Nexus One being rooted.

Well, when I eventually root one of my devices, that'll be something
I'll look forward to being able to use.

Thanks for the tip!

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

Warescription: Three Android Books, Plus Updates, One Low Price!

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


[android-developers] Re: port forwarding

2010-02-15 Thread Bob Kerns
Never say never -- it would be appropriate for a mySQLAdmin tool, say,
talking over wifi.

Anyway, my answer to Mr. L. Newbie's question, is:

1. You could probably find and/or port such a thing. MySQL's Connector/
J is pure Java. It might rely on some standard J2SE stuff that's not
present on Android, in which case you'd have to come up with
substitutes.

2. GET/POST is *not* the only way -- but it is the best way, the tried
and true way, and what most other people are doing. Google
"RESTful" (I'm surprised it's that easy to get a good search result,
but it is). The alternative would be to use SOAP, but I wouldn't do
that unless you already know why you want to do that (such as
compatibility with an existing service or environment).

This will also drive the design of your application in a direction
which is more mobile-friendly. It's not really a matter of mobile vs
LAN -- really, I don't recommend the use of direct database
connections except between tightly-coupled components -- such as
between your web service, and its back-end database server. Doing
direct SQL poses everything from security risks to temptations to
depend on aspects of your data model which shouldn't be exposed,
leading to massive compatibility problems, and the need to update all
clients at the same timethe list of reasons goes on and on.

On Feb 15, 3:55 pm, Mark Murphy  wrote:
> linux newbie wrote:
> > 1. Is there mysql-connector/jdbc for android?
>
> It doesn't matter -- you shouldn't use it even if it exists.
>
> As I've now written for the third time in the past 36 hours or so
> (previous two on StackOverflow):
>
> "Never never never use a database driver across an Internet connection,
> for any database, for any platform, for any client, anywhere. That goes
> double for mobile. Database drivers are designed for LAN operations and
> are not designed for flaky/intermittent connections or high latency."
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android Consulting/App Development:http://commonsware.com/consulting

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


[android-developers] Re: Multitouch seems badly broken on Nexus One 2.1-update1

2010-02-15 Thread Robert Green
Droid handles better than the rest so far but my tests still showed
errors.  Occasionally it still flips axis and has some small
interactions between the two fingers on near-axis touches.  It's
better but doesn't seem as good as iPhone/iPod touch's screen.

On Feb 15, 5:51 pm, Dianne Hackborn  wrote:
> On Mon, Feb 15, 2010 at 3:16 PM, Mario Zechner wrote:
>
> > It's not so much an issue of gestures that may be impossible to
> > recognize on certain screens but more that the API exposes
> > functionality that is broken on all screens at the moment.
>
> The Droid screen handles two fully independent fingers.
>
> --
> 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, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.

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


[android-developers] Re: bricked

2010-02-15 Thread Thomas

Hi,
One of my Android G1s in a similar state and could stand to be brought
back into a condition where I could use it for development or I could
sell it.  So if anyone can achieve this I would like to talk.




On Feb 13, 1:05 am, Nick  wrote:
> Hi, i have a bricked Htc magic and i have tried all possible ways on
> the internet to unbrick by phone(sadly ther are none)
> .i am preety sure some one here is smart enough to come up with a
> sloution and really need one...this is one of the most expensive
> phones i have bought out of my budget and i had to dig very deep into
> my pocket...
> i know a lot of people say you cant do much now and someone will come
> with a fix..my question is when, i have been waiting for more than 3
> months now...
> i write this to anyone here you has a fix or can fix a bricked htc
> magic to please help
> i know this is not the best place to put this post  but i am tired to
> going to useless forms and doing it..you could be my last chance
> before i break my heart and thouw this phone in the bin!
> help me Android Group..Google i hope you are listening.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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 style text in string array?

2010-02-15 Thread jotobjects
Thanks. That works. FWIW it does not work with ordinary String
resources (non arrays) in 2.0.1 unless the gt/lt notation is used.  So
maybe the change was in 2.1.  Further in 2.0.1 the  tag
doesn't work for Html.fromHtml although it does work when referenced
in the XML layout as show above.   (and I preseume  and )
work with both Html.fromHtml and when String resources are referenced
in layout.

On Feb 15, 4:15 pm, Mark Murphy  wrote:
> jotobjects wrote:
> > You are right it doesn't seem to work. Context.getString() strips out
> > the format tags.  The documentation implies it should work but the
> > mechanism is not explained or it is a bug.
>
> > It does work with the XML directly like -
>
> > my name is sue > string>
>
> > android:text="@string/foobar"
>
> The OP also posted this to StackOverflow. The workaround I posted there
> for string-array resources is to escape the HTML (e.g., ). It
> used to be you had to do that for string resources as well -- not sure
> when they changed string resources to work sans escaping.
>
> http://stackoverflow.com/questions/2267118/how-to-style-text-in-a-str...
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> _Android Programming Tutorials_ Version 1.0 In Print!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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 Class Problem: Callback is never called

Hi,

Last I checked the AudioRecord read is a blocking operation, you don't
need to have to "poll" for data..just set up a second thread that
constantly reads. It will read as fast as possible. The amount of
"blocking" in the read is the size of the buffer chosen


-niko

On Feb 15, 7:35 am, Wanderer  wrote:
> Hello Android Developers!
>
> My Android Java Application needs to record audio data into the RAM
> and process it. This is why I use the class "AudioRecord" and not the
> "MediaRecorder" (records only to file).
>
> Till now, I used a busy loop polling with "read()" for the audio data.
> this has been working so far, but it peggs the CPU too much. Between
> two polls, I put the thread to sleep to avoid 100% CPU usage. However,
> this is not really a clean solution, since the time of the sleep is
> not guaranteed and you must subtract a security time in order not to
> loose audio snippets. This is not CPU optimal. I need as many free CPU
> cycles as possible for a parallel running thread.
>
> Now I implemented the recording using the
> "OnRecordPositionUpdateListener". This looks very promising and the
> right way to do it according the SDK Docs. Everything seems to work
> (opening the audio device, read()ing the data etc.) but the Listner is
> never called.
>
> Does anybody know why?
>
> Info: I am working with a real Device, not under the Emulator. The
> Recording using a Busy Loop basically works (however not satifiying).
> Only the Callback Listener is never called.
>
> Here is a snippet from my Sourcecode:
>
> __ snip!
> public class myApplication extends Activity {
>
>   /* audio recording */
>   private static final int AUDIO_SAMPLE_FREQ = 16000;
>   private static final int AUDIO_BUFFER_BYTESIZE = AUDIO_SAMPLE_FREQ *
> 2 * 3; // = 3000ms
>   private static final int AUDIO_BUFFER_SAMPLEREAD_SIZE =
> AUDIO_SAMPLE_FREQ  / 10 * 2; // = 200ms
>
>   private short[] mAudioBuffer = null; // audio buffer
>   private int mSamplesRead; // how many samples are recently read
>   private AudioRecord mAudioRecorder; // Audio Recorder
>
>   ...
>
>   private OnRecordPositionUpdateListener mRecordListener = new
> OnRecordPositionUpdateListener() {
>
>     public void onPeriodicNotification(AudioRecord recorder) {
>       mSamplesRead = recorder.read(mAudioBuffer, 0,
> AUDIO_BUFFER_SAMPLEREAD_SIZE);
>       if (mSamplesRead > 0) {
>
>         // do something here...
>
>       }
>     }
>
>     public void onMarkerReached(AudioRecord recorder) {
>       Error("What? Hu!? Where am I?");
>     }
>   };
>
>   ...
>
>   public void onCreate(Bundle savedInstanceState) {
>
>   try {
>       mAudioRecorder = new AudioRecord(
>           android.media.MediaRecorder.AudioSource.MIC,
>           AUDIO_SAMPLE_FREQ,
>           AudioFormat.CHANNEL_CONFIGURATION_MONO,
>           AudioFormat.ENCODING_PCM_16BIT,
>           AUDIO_BUFFER_BYTESIZE);
>     } catch (Exception e) {
>       Error("Unable to init audio recording!");
>     }
>
>     mAudioBuffer = new short[AUDIO_BUFFER_SAMPLEREAD_SIZE];
>
> mAudioRecorder.setPositionNotificationPeriod(AUDIO_BUFFER_SAMPLEREAD_SIZE);
>     mAudioRecorder.setRecordPositionUpdateListener(mRecordListener);
>     mAudioRecorder.startRecording();
>
>     /* test if I can read anything at all... (and yes, this here
> works!) */
>     mSamplesRead = mAudioRecorder.read(mAudioBuffer, 0,
> AUDIO_BUFFER_SAMPLEREAD_SIZE);
>
>   }
>
> }
>
> __ snip!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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: Regarding expansion of google market

I  must be missing something. What do you mean by the "expansion of
google market"?

I presume you're referring to Google's Marketplace? If you go to
flurry.com or admob.com, you can find nice charts of the explosive
growth in the Google Marketplace.

New apps are added at a very high rate.

So I'm guessing I'm not understanding what you mean by "expansion". Is
this some promised expansion of capabilities? That would be most
welcome!  For example, being limited to just two screenshots does both
the seller and the buyer a grave disservice.

On Feb 15, 9:24 am, karthikr  wrote:
> Hi Guys,
>
> I have been waiting for the expansion of google market and to my shock
> I see that there is almost no activity on the same for the past couple
> of months. We just keep hearing that expansion will happen, but
> absolutely no news on the same.
>
> Does someone out there have any updates, and can comeone from google
> reply for this query that we have been asking a million time, just
> once...
>
> Regards,
> R.Karthik

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


Re: [android-developers] Re: Best Way To Implement An Activity That Lists Recipes

erturne wrote:
> I may have to pick up your book. Does it cover accessing data over the
> network? 

:: begin brief commercial pitch ::

Yes, it does. Actually, two do, if you count the _Android Programming
Tutorials_. Grab the Warescription, and you get both (and a third book,
and a fourth in the not-too-distant future, and...), so long as you're
willing to live with digital formats.

If you have additional questions, hop over to the [cw-android] Google
Group, as I don't want to clutter up this list with CommonsWare-specific
stuff.

:: end brief commercial pitch ::

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

_Android Programming Tutorials_ Version 1.9 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


Re: [android-developers] Re: How to start an Activity from a Service and getting a result from it

jotobjects wrote:
> Are the resources of the another application package essentially
> public - can any application call Context.createPackageContext() to
> get the context of a different application?

Yes. It shocked the heck out of me when I realized it. It's possible
there are some limits, but I'm not aware of any.

-- 
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: Best Way To Implement An Activity That Lists Recipes



On Feb 15, 6:56 pm, Mark Murphy  wrote:
> erturne wrote:
> > Let's say I create a recipe_list_item_layout.xml file containing
> > something like:
>
> > 
> > 
> >    
> >       
> >    
> > ...
> > 
>
> > What would I do in my adapter's getView() method to return an instance
> > of TableLayout that uses this XML with the title set in the TextView?
> > Sorry, but I'm just a bit lost here!
>
> Well, I'll point you to this free excerpt from one of my books:
>
> http://commonsware.com/Android/excerpt.pdf
>
> The excerpt covers all of that and more.
>
> In a nutshell, you inflate the layout using a LayoutInflater, which
> gives you your TableLayout.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android Consulting/App Development:http://commonsware.com/consulting

Thanks! Got it working. I think I'm off and running with Android
development.

I may have to pick up your book. Does it cover accessing data over the
network? I'm thinking about exposing a RESTful service and having the
app get its recipe data from that. Also considering having the app get
its recipe data from Google or Amazon storage. Will have to consider
caching recipes locally in case the user is temporarily without
network connectivity. This could get interesting. :)

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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 start an Activity from a Service and getting a result from it



On Feb 13, 11:36 am, Dianne Hackborn  wrote:
> This sounds much more complicated than you need.  If you just want to load
> resources from another .apk, you don't need any code in it at all -- just
> use Context.createPackageContext() to get the context for the other package
> and load its resources from there.

Are the resources of the another application package essentially
public - can any application call Context.createPackageContext() to
get the context of a different application?

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


Re: [android-developers] Re: Intents

Christopher Walker wrote:
> The app appears to crash shortly after I reach
> startActivityForResult(i, NEW_GAME);
> but before I make it into the constructor. I discovered this using
> breakpoints, but I don't know how to examine the stack trace.

Well, I don't use Eclipse much. If you eliminate the breakpoints, the
DDMS perspective will have a LogCat pane that will show you, in red, the
stack trace associated with the exception.

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

The app appears to crash shortly after I reach
startActivityForResult(i, NEW_GAME);
but before I make it into the constructor. I discovered this using
breakpoints, but I don't know how to examine the stack trace.

On Feb 15, 1:38 pm, Mark Murphy  wrote:
> Christopher Walker wrote:
> > I am new to android development. To introduce myself to android
> > development, I am writing a simple game involving vikings.In this
> > game, I presently have to activities: one entitled "Vikings" for the
> > menu and one entitled "Campaign" for the game itself. The menu is
> > rather basic; it includes a button for quitting and a button for
> > beginning the game. As part of the code for newGame's onClick() event,
> > there is a call to the Campaign activity. Here is the code (Note that
> > NEW_GAME is defined in the Vikings class):
>
> >             public void onClick(View v) {
> >                    /** TODO
> >                     * Call Campaign activity. */
> >                    Intent i = new Intent(Vikings.this, Campaign.class);
> >                    startActivityForResult(i, NEW_GAME);
> >             }
>
> > I assume this should lead into the constructor for the Campaign class,
> > which so far looks like this:
>
> >     @Override
> >     public void onCreate(Bundle savedInstanceState) {
> >            /** TODO */
> >         super.onCreate(savedInstanceState);
> >         setContentView(R.layout.campaign);
> >     }
>
> > As far as I can tell, there should be nothing wrong with this code;
> > however, I get a crash whenever I try the program on either a physical
> > device or the emulator.
>
> You will want to examine your Java stack trace, using adb logcat, DDMS,
> or the DDMS perspective in Eclipse, to figure out where your crash is
> and its cause.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android Training in US: 14-18 June 2010:http://bignerdranch.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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] 9-patch background image affects margins?

i have list views with image views and text views etc in them, and 
i'm trying to fix up a situation where the background image of a list 
element changes in the "pressed" state.


if there's a straightforward way of doing that, please let me know!

right now, i override onTouchEvent() in the topmost view, and also in 
those child views who don't just delegate to their parents -- which 
would be image views. i have to check for long clicks myself, but 
basically this scheme works.


the list views are potentially different sizes depending on how much 
text is in the views etc, so i thought i would use a 9-patch as the 
background. however, when the background changes from flat white to 
the 9-patch, this seems to indent the view a bit -- ie give it 
margins.


eh? if i change the image to a non-9-patch, the margins remain as 
they are. i've tried different sizes of 9-patch, from 320x150 or so 
down to 100x30 etc, no change.


what's going on?

thanks
--
jason.vp.engineering.particle

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


Re: [android-developers] Re: How to style text in string array?

jotobjects wrote:
> You are right it doesn't seem to work. Context.getString() strips out
> the format tags.  The documentation implies it should work but the
> mechanism is not explained or it is a bug.
> 
> It does work with the XML directly like -
> 
> my name is sue string>
> 
> android:text="@string/foobar"

The OP also posted this to StackOverflow. The workaround I posted there
for string-array resources is to escape the HTML (e.g., ). It
used to be you had to do that for string resources as well -- not sure
when they changed string resources to work sans escaping.

http://stackoverflow.com/questions/2267118/how-to-style-text-in-a-string-array/2267602#2267602

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

_Android Programming Tutorials_ Version 1.0 In Print!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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 style text in string array?

You are right it doesn't seem to work. Context.getString() strips out
the format tags.  The documentation implies it should work but the
mechanism is not explained or it is a bug.

It does work with the XML directly like -

my name is sue

android:text="@string/foobar"

On Feb 15, 5:59 am, Chrissshen  wrote:
> Hi,
>
> I have a string array and was trying to style certain parts of the
> text with tags like , , ... but it doesn't work.
> The array looks like this:
>
> 
>         
>                 blabla\nblabla
>         
> 
>
> The text is displayed in the textview like this:
> tTitel.setText(Html.fromHtml(Text[ii]));
>
> I tried it without Html.fromHtml too but this had no effect. The
> styling tags do work if i use them directly in the code, like:
> tTitel.setText(Html.fromHtml("blablablabla");
>
> Any ideas how to style the text in an array??
>
> Cheers,
> Chris

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


Re: [android-developers] Hint for Spinner?

On Mon, Feb 15, 2010 at 3:11 PM, Mark Wyszomierski  wrote:

> I have a Spinner. Is there a way to display some hint text on it?


What I do is add dummy object as the first entry in the list with the prompt
for the user and ignore the selection when it's 0. Crude but functional.

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

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

Re: [android-developers] Re: Best Way To Implement An Activity That Lists Recipes

erturne wrote:
> Let's say I create a recipe_list_item_layout.xml file containing
> something like:
> 
> 
> 
>
>   
>
> ...
> 
> 
> What would I do in my adapter's getView() method to return an instance
> of TableLayout that uses this XML with the title set in the TextView?
> Sorry, but I'm just a bit lost here!

Well, I'll point you to this free excerpt from one of my books:

http://commonsware.com/Android/excerpt.pdf

The excerpt covers all of that and more.

In a nutshell, you inflate the layout using a LayoutInflater, which
gives you your TableLayout.

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

Android Consulting/App Development: http://commonsware.com/consulting

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


Re: [android-developers] port forwarding

linux newbie wrote:
> 1. Is there mysql-connector/jdbc for android?

It doesn't matter -- you shouldn't use it even if it exists.

As I've now written for the third time in the past 36 hours or so
(previous two on StackOverflow):

"Never never never use a database driver across an Internet connection,
for any database, for any platform, for any client, anywhere. That goes
double for mobile. Database drivers are designed for LAN operations and
are not designed for flaky/intermittent connections or high latency."

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

Android Consulting/App Development: http://commonsware.com/consulting

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


[android-developers] Re: Best Way To Implement An Activity That Lists Recipes



On Feb 15, 3:37 pm, Mark Murphy  wrote:
> erturne wrote:
> > I'm working on my first Android app, and would appreciate any guidance
> > to make sure I'm doing this the best way. Basically I want an Activity
> > to list recipes. Eventually I'll have another Activity to display an
> > individual recipe selected from the list, but I'm not worrying about
> > that yet. I apologize if this is a really noob question!
>
> > The list of recipes should show each recipe's title, description,
> > rating, and date added. For each recipe in the list I'd like the title
> > on the top left of the list entry, rating on the top right,
> > description on the bottom left, and date added on the bottom right. I
> > may want to add photo, icons representing properties of the recipe
> > (e.g. vegetarian), etc. The makes me think that each item in the list
> > should be a TableLayout.
>
> > With all that in mind, here's what I'm planning to write:
>
> > 1. Write class RecipesDataAdapter extends BaseAdapter. Override the
> > getView() method to return an instance of TableLayout. Populate each
> > instance of TableLayout with two TableRows, the first row containing
> > cells for title and rating, and the second row containing cells for
> > description and date added. For now I'll just pass the Recipe
> > instances to the adapter in an array.
>
> > 2. Write class ListRecipesActivity that extends ListActivity. Override
> > the onCreate() method to obtain instances of the Recipe class and call
> > the setListAdapter() method with an instance of the RecipesDataAdapter
> > class.
>
> > Notice that all this is done in code without any layout XML files. All
> > the examples of Activities that I've seen use a layout XML file and
> > call setContentView(R.layout.layout_name) but I'm not sure if I need
> > to do that for this, or even how I would do that considering my main
> > Activity is a list of non-trivial things (TableLayout).
>
> > Please let me know if you think I'm on the right track, or if there is
> > a better way to approach this problem.
>
> You definitely want to use layout XML files for your rows and your
> activity, to make it easier to support different screen sizes and
> orientations. Otherwise, in a quick read, what you have here seems OK.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android Training in US: 14-18 June 2010:http://bignerdranch.com

Let's say I create a recipe_list_item_layout.xml file containing
something like:



   
  
   
...


What would I do in my adapter's getView() method to return an instance
of TableLayout that uses this XML with the title set in the TextView?
Sorry, but I'm just a bit lost here!

Thanks,
Eric

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


Re: [android-developers] Re: Multitouch seems badly broken on Nexus One 2.1-update1

On Mon, Feb 15, 2010 at 3:16 PM, Mario Zechner wrote:

> It's not so much an issue of gestures that may be impossible to
> recognize on certain screens but more that the API exposes
> functionality that is broken on all screens at the moment.


The Droid screen handles two fully independent fingers.

-- 
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, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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

Re: [android-developers] port forwarding

No. I am trying to connect Emulator. Sorry for not being clear.

Based on recent developments, I like to re-frame the question.

1. Is there mysql-connector/jdbc for android?
2. Is running the webserver on top of mysql database and accessing it via
_GET & _POST the only way to get database table info?

Thanks
On Mon, Feb 15, 2010 at 6:43 PM, Kevin Duffey  wrote:

> Little confused.. are you trying to allow your mobile app connect across
> the network to your database?
>
>   On Sun, Feb 14, 2010 at 4:12 PM, linux newbie 
> wrote:
>
>>   Hi,
>>
>> I am running mysql server (on remote machine) and I can able to connect to
>> it from my host machine. I written a java code to connect and read some
>> table values.
>>
>> Now I compiled the same java code in Android and on running it in emulator
>> it is unable to connect to server.
>>
>> I believe I need to do port forwarding as emulator couldnt see the ip
>> address of server.
>>
>> can anyone let me know how to accomplish this task?
>>
>> 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
>>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

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

[android-developers] ItemizedOverlay.onTap() imprecise?

Hello,
I'm using Google maps. I put the markers on map and my inherited
ItemizedOverlay overrides onTap() method.

Markers are 32x32 images.

However, I can tap quite a bit away from the marker and still receive
the event.
This becomes a problem when markers are close to each other.

Anybody knows why this is?

Thanks.

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


Re: [android-developers] Search options for Market?

On Sun, Feb 14, 2010 at 11:49 PM, Benn  wrote:

> I'm looking for details (documents, posts, or even just a list)
> regarding what options Market supports (for ex: 'pub') to restrict or
> target the search.
>

http://developer.android.com/intl/fr/guide/publishing/publishing.html#marketintent

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

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

[android-developers] Any APIs support configuring specific PDE server ?

Carrier want it's navigator use specific PDE server to get location
information
so we need  API that can configure PDE server(IP, Port)
Is it 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: Multitouch seems badly broken on Nexus One 2.1-update1

It's not so much an issue of gestures that may be impossible to
recognize on certain screens but more that the API exposes
functionality that is broken on all screens at the moment. Especially
the coordinate flipping/confusion is something that can't be solved
according to Dianne. And it is exactly this functionality (just
tracking two fingers that are not close to each other on the screen)
that is needed by us game developers to create more elaborate input
schemes. It's kind of sad really :/

On 15 Feb., 10:22, Sean Hodges  wrote:
> The Nexus One uses the Synaptics ClearPad 2000 
> series:http://www.synaptics.com/about/press/press-releases/synaptics-clearpa...
>
> According to this 
> reference:http://www.synaptics.com/solutions/products/clearpad#benefits-2000
> this model has support for a maximum of 2 simultaneous touches, the
> 3000 series supports up to 10. The Synaptics site also describes some
> of the gestures that are possible with its 
> products:http://www.synaptics.com/solutions/technology/gestures/touchpad.
>
> The touchscreen technology is very diverse across handsets, some of
> the more complex gestures are going to be limited or impossible on
> certain devices (e.g. ones that have obtrusive dead-zones or 
> singletouchonly). For this reason, I don't believe the interface can be
> normalised to be compatible with all devices, primarily because you
> will cripple the devices with the superior functionality (we'd 
> losemulti-touchfor a start, to support handsets like the HTC Magic /
> Dream). I think you just have to be conservative about the complexity
> of the gestures you require in your app, and provide alternative
> methods of control for the devices that can't support those gestures.
> The Dolphin Browser is a good example of this in action.
>
> On Sun, Feb 14, 2010 at 7:14 PM, Dianne Hackborn  wrote:
> > G1, myTouch, and Passion use a Synaptics screen.  Droid uses one from
> > another company (I can't recall).
> > Even for a particular company, there are a wide variety of screens you will
> > encounter.  For example here is what I found for Synaptics:
> >http://www.synaptics.com/solutions/products/clearpad
>
> > On Sat, Feb 13, 2010 at 9:11 PM, Kevin Duffey  wrote:
>
> >> So are they all using the same company for the screen?
>
> >> On Sat, Feb 13, 2010 at 5:10 PM, Lance Nanek  wrote:
>
> >>> A more capable multitouch screen probably costs more. If that is the
> >>> case, it isn't really surprising that multiple manufacturers would go
> >>> with a cheaper, less capable one.
>
> >>> On Feb 13, 6:51 pm, Kevin Duffey  wrote:
> >>> > So Robert.. is this a platform issue in your mind.. being that it
> >>> > happens on
> >>> > all android devices currently regardless of manufacturer? Or is it a
> >>> > driver
> >>> > issue for each hand set and just oddly happens to be coincidental that
> >>> > various manufacturers have the exact same issue withmulti-touch? I am
> >>> > sure
> >>> > what Diane says is accurate... but yet it seems odd that different
> >>> > manufacturers have the same problem.
>
> >>> > On a slightly different note.. what is the stance of the Android
> >>> > platform
> >>> > team as a whole towards game developers? By this I mean, if this is
> >>> > indeed
> >>> > an issue on different manufacturer's handsets.. is it important enough
> >>> > that
> >>> > game developers, which for sure will be a large segment of popularity
> >>> > for
> >>> > android as it is on iPhone.. can get this escalated enough to get some
> >>> > platform/driver developers looking into it and if possible, tap the
> >>> > community (such as Robert) to help, so we can figure out exactly what
> >>> > is
> >>> > going on? It just seems too crucial of an issue to overlook being that
> >>> > it
> >>> > directly makes it impossible as of now for game developers to really
> >>> > utilize
> >>> >multitouch.
>
> >>> > Robert (et all)... an app I want to eventually get around doing is a
> >>> > drum
> >>> > machine app.. with multiple drum pads. On the iPhone, an app called
> >>> > BeatMaker allows for 5 pads at once to be touched. Would this issue
> >>> > possibly
> >>> > make an app like this not work? I don't even know if Android can handle
> >>> > more
> >>> > than two touches at once.. but there are plenty of apps out there that
> >>> > will
> >>> > use more than two simultaneous touches at once.
>
> >>> > On Fri, Feb 12, 2010 at 4:20 PM, Robert Green 
> >>> > wrote:
> >>> > > Ok if you guys want to see what I'm talking about, check out the app
> >>> > > I
> >>> > > just published called "Multitouch Visible Test."  Play around with
> >>> > > that and you'll see the problems. If you're interested in developing
> >>> > > a
> >>> > > multitouch app, check that out first so that you know the limitations
> >>> > > of the data you'll be working with.
>
> >>> > > On Feb 12, 4:55 pm, Robert Green  wrote:
> >>> > > > Luke's code cleans up some basic stuff like gestures involving
> >>> > > > pinching but it can not f

[android-developers] How can I configure TextView to draw text like an anchor

Hi,

Is it possible to setText in TextView to draw like html anchor? (i.e
text in blue with a blue underline)

Thank you.
Sam

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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] Prevent EditText focus

How can we prevent an edittext from getting focus and displaying the
soft keyboard.

I have an searchbox which should not be focussed by default and should
have focus only when user clicks on it to enter something. But right
now it takes focus and shows the keyoard as soon as I open the
activity.

Is this a bug or can this be changed to behave in the way we want?

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


Re: [android-developers] SD Card not available to apps when mounted?

Nathan wrote:
> I just want to confirm the behavior I'm seeing.
> 
> Is it true that when the SD Card is mounted as a USB volume, it is
> unavailable to applications?
> 
> (This is Windows: the behavior may be different for a Linux desktop)

Correct. The SD card can either be available as mass storage or
available to Android internally, not both.

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

_The Busy Coder's Guide to *Advanced* Android Development_
Version 1.3 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] SD Card not available to apps when mounted?

I just want to confirm the behavior I'm seeing.

Is it true that when the SD Card is mounted as a USB volume, it is
unavailable to applications?

(This is Windows: the behavior may be different for a Linux desktop)

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 at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Force Close just restarts the app?



On Feb 13, 12:45 pm, Steeler  wrote:
> I only have one activity in this app, but it still does it.
>

What Dianne's saying is that multiple instances of the Activity reside
on the activity stack, right on top of each other.
I have a similar problem when the activity stack does not seem to
clear on HOME. Next time the user exits through BACK, the previous
instance of the activity is revealed as it sits on top now. To the
user it looks as if the BACK button didn't work.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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] TextView, autoLink, and RemoteViews?

I have a TextView in an AppWidget where the text is set by a user.
This text can include one or more URL links (i.e http:/
www.google.com). I want these URLs to be clickable and open the
browser and go to whatever link was clicked. I have accomlished this
partially.The code I have at this point is as follows:

Intent clickIntent = new Intent();
clickIntent.setAction(Intent.ACTION_VIEW);
clickIntent.setData(Uri.parse(textViewContent.toString()));
clickIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

PendingIntent pendingIntentClick = PendingIntent.getActivity(context,
0, clickIntent, Intent.FLAG_ACTIVITY_NEW_TASK);

views.setOnClickPendingIntent(R.id.widget_textview,
pendingIntentClick);


This code will open the browser and go to the correct URL if the
content of the TextView contains only one link and no other links or
text of any kind. This is because setData uses everything in the
TextView as the URI.

So, how would I go about having a method to tell if what was clicked
is a link and which link it is if there are multiple links etc?
Basically, I need the browser to open to the correct link that is
clicked.


Also, I have tried to go about this a different way. I tried using the
XML property, android:autoLink="web", on the TextView of the
AppWidget. This of course makes the URLs look like links and makes
them clickable but an error occurs when a link is clicked. This error
is as follows:

"android.util.AndroidRuntimeException: Calling startActivity() from
outside of an Activity  context requires the FLAG_ACTIVITY_NEW_TASK
flag. Is this really what you want?"

Using android:autoLink="web", the browser activity tries to start
without any additional code (meaning the browser activity tries to
start without the clickIntent code above). So, I do not know where I
would add a FLAG_ACTIVITY_NEW_TASK in this case. Is there something I
can do in the manifest.xml or another XML file?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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: while onLongClick'ed

Why not catch a MotionEvent and check for ACTION_DOWN (start rolling
the dice) and for ACTION_UP (stop rolling the dice).

On Feb 13, 12:11 pm, Ricky  wrote:
> i have search and have not found a solution to my problem.
>
> my problem is that, i am trying to create a loop while the button is
> LongClicked. currently when i long click, the moreDice() method is
> only called once. i need to create a loop that will keep calling the
> moreDice() untill the user nolonger LongClick's the buttton.
>
>        here is my simple code example:
>
>         // + Button on LongClick
>         up.setOnLongClickListener(new View.OnLongClickListener() {
>                         @Override
>                         public boolean onLongClick(View v) {
>                                 moreDice();
>                                 //return true because event has been handled, 
> do not pass onto any
> other listeners
>                                 return true;
>                         }
>                 });
>
> thanks in advanced,
> -ricky

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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] Deprecated Absolute layout ?

Hi all
the absolute layout class is deprecated
but still can write it in code and it works.
will there be any problems if I use this class ? will the application
work correctly after I deploy it on a 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


[android-developers] Re: static context access

I presume you're setting this up in the Application, right? Indeed,
passing in the application at that point is just what I was about to
suggest.

Actually, I see nothing at all wrong with doing this. Just post it to
the main thread's Handler, and do everything except interception
there.

Just make sure that your code that runs in the main thread is bullet-
proof. (And anything it then passes off to other threads). That's just
a matter of having a catch (Throwable ex) {...} and logging, but not
passing on, any errors that occur.

I've done this sort of thing in a number of environments. I would even
go so far as to term this a cross-platform "best practice".

In terms of thread handling and communication, this is no different
than anything else you'd do in another thread. When you have something
to do in the normal context, you post it.

The one thing that CAN get tricky, is trying to recover from failures.

Another possibility is to set up your own Handler in your own thread.
Then you can do things like post Toast notifications, etc. while
leaving the main thread alone.

I've done this, and it worked, but then decided I didn't have any good
reason for it. However, this could be useful if the main thread is
stuck in a loop. But if you do it right, you can start off going to
the main thread, and switch to this later.

On Feb 15, 12:20 pm, laphroaig15  wrote:
> Didn't eat my wheaties this morning.  I can simply pass in the
> reference during the construction of the handler.
>
> Mark, thanks for the feedback.  I agree that broadcasting through an
> excepted context is a little dicey, but it seems to work for now.  I
> can't think of a better alternative context-less thread -> android
> communication short of something horribly inefficient like file
> polling, but I'm open to suggestions.  I am building a "whatever" app
> to report exceptions, so using Flurry or DroidDrop would defeat the
> purpose.  You are right in that, tragically, "whatever" cannot self-
> reference its own automated exception reporting capabilities.  ;)
>
> thanks for the input,
>
> -Jess
>
> On Feb 15, 2:01 pm, Mark Murphy  wrote:
>
>
>
> > laphroaig15 wrote:
> > > Is there some way to interact with the android packages to
> > > retrieve a context in a static manner?
>
> > Not really. The Application object is a singleton, as is any Service you
> > have running, but I am not aware of ways to obtain those from a static
> > method.
>
> > Moreover, please do not try binding to a service from an exception
> > handler. Broadcasting an Intent may be safe, but I'm not completely
> > confident of that, either.
>
> > Even simpler is just to use Flurry or DroidDrop or whatever to report
> > your exceptions.
>
> > Trying to have an Android component respond to an exception may prove
> > troublesome, particularly if the exception is thrown from the Android
> > component in question.
>
> > --
> > 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: system hangs while giving Android build

When I change the SDK version for a project, it hangs. I end up
killing Eclipse and restarting, then doing  a Clean, and all is fine.

(I have to start remembering to turn off the automatic build in these
cases).

Perhaps you're seeing something similar? Maybe if a build tool gets an
error at the wrong point in the process, Eclipse ends up waiting for
something that's not going to happen?

On Feb 15, 4:05 am, Saikat  wrote:
> But other people here, are using 1 GB RAM and the build is fine in
> their system. Nobody is seeing any system stuck kind of problem. My
> hard disk is also fine.
>
> On Feb 10, 5:13 pm, James Wang  wrote:
>
>
>
> > I did have the same experience before. I think 1G is not enough and
> > your disk should be good enough.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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] rotate progress bar

HI, I am extending the normal android.widget.ProgressBar. I want to
make it vertical. This is my current onDraw Method

@Override
protected synchronized void onDraw(Canvas canvas) {


canvas.save();
 canvas.rotate(90);
canvas.translate(0,-50);
super.onDraw(canvas);
canvas.restore();
}

This rotates it fine, however I am having alot of sizing issues. It
seems as though I have to set the width and the height of the control
to be the same thing or else I run into alot of clipping issues.
Basically, I want to have a progress bar that, once rotated, is 50dip
wide and fills the screen vertically. Can anyone think of a way to do
this?

Also, it doesn't seem to be actually drawing the progress properly,
but I will revisit that once I get the clipping sorted out.

Thanks

Jon

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


[android-developers] Re: android 3DOF controller - call for developers

Posted at: 
http://groups.google.com/group/elenhos/browse_thread/thread/c3605f6fa39a6b62

Short version use the (magnetic) force, Luke! :) (Not a perfect
solution).

On Feb 15, 4:41 am, Jubei  wrote:
> As far as I know, without using the camera/trackball/touchscreen it's
> not very easy to add more DOF.
>
> If you have any ideas we'd be happy to hear your thoughts on the app's
> google group
> ]http://groups.google.com/group/elenhos
>
> Any ideas would be more than welcome.
>
> Nicholas
>
> On Feb 6, 4:43 pm, Bob Kerns  wrote:
>
>
>
> > Just a thought -- why only 3 degrees of freedom? You've got these nice
> > accelerometers...they can do more than sense a gravitational field...
>
> > I've bookmarked it to have a look at your code. I'll keep you in mind
> > if I have anything to contribute at some point.
>
> > On Feb 5, 7:07 pm, Jubei  wrote:
>
> > > Just wanted to let the community know that I"ve released the source
> > > code and I'd be more than happy to accept code contribution to the
> > > project (even if the source isn't very readable).
>
> > >http://code.google.com/p/androidcontroller/
>
> > > If anybody is interested in helping out drop me a line.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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] Hint for Spinner?

Hi,

I have a Spinner. Is there a way to display some hint text on it? It
seems to default to the first item in its supplied array adapter. I
want the user to make a choice, right now it seems like it would
assume the 0th item is by default selected.

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: Inadvertent breakage by SDK going forward

That would be very 'icky'... I hoped that the 'targetSdkVersion'
setting could prevent this.

On Feb 12, 7:20 pm, jasper  wrote:
> Does this truly mean that even if I compile to the 1.6 platform, if my
> code implements a 2.1 callback method, that method will *never* be
> invoked on 1.6 devices but *will* be invoked on 2.1 devices?  Even
> though I compiled to the 1.6 platform?  That's crazy!
>
> On Feb 12, 4:01 pm, Mike Collins  wrote:
>
>
>
> > Ran into the below issue and wanted to see what solutions people
> > have...
>
> > In SDK 1.6 Activity did not have a method onBackPressed (), in 2.0 it
> > appeared.
> > Using the current docs I added an onBackPressed to a couple of our
> > classes.
> > We build against 1.6 (customer requirement) it seemed a bit odd that
> > the compiler
> > got upset when I put in a @Override, so I took it out and proceeded to
> > verify that
> > everything was working, which it was, the method was being invoked
> > exactly as
> > expected.
>
> > Turns out this works only on phones/emulators with 2.0 or greater
> > firmware.  On
> > 1.6 firmware it fails to function at all because nobody calls it.
>
> > OK, with hindsight it's obvious what's happening and we've made the
> > @Override
> > an error not a warning.
>
> > But it raises the issue of how to I protect my app if in the future
> > Android implements
> > a method that collides with the name of method I invent for my derived
> > class.  In
> > this case Android will be calling my method at inappropriate times and
> > expecting
> > it to do things that it probably doesn't do.
>
> > One solution is prefix every method of ours of every class that
> > derives from an Android
> > class with something specific to the app.  Or use a different naming
> > convention, like
> > always use an initial capital or an underscore etc.
>
> > thoughts?
> >   mike- 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


Re: [android-developers] Broadcasting Real Time Voice using RTP

you can google for jain sip. There is a java sip stack available which you
can use it. I have seen someone using it before on android. you have to find
a way to use that libary.

On Mon, Feb 15, 2010 at 7:37 AM, silentpartner <
silentpartner...@googlemail.com> wrote:

> Hi,
> I am currently trying to braodcast real time voice from Android using
> RTP to other Android phones connected over Wifi Ad-hoc network.
> I have few questions in this regard,
>
> 1. How to control and set the RTP on Android?
> 2. Which Codec are supported by Android for voice communication? and
> how to incorporate them ?
>
> We are able to record a voice from microphone and store it on SD card
> for a playback. The next step would be to link the outstream of real
> time voice with RTP also incorporating Codec
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

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

[android-developers] Re: Failed to fetch URL https://dl-ssl.google.com/android/repository/repository.xml

It seems you have quite unrealistic expectations of the community, and
aren't even willing to help yourself.

Let's see here:

1) Your sysadmins block direct web access to the Internet

2) You route your web requests through some unknown piece of software
using one of several protocols to forward your requests,

and

3) You expect the community to fix it all up for you? Who's being
selfish?

I have a solution for you: stop blaming the community. We can't help
you with any of that.  Talk to your sysadmins. They CAN help you.

They may not be willing to. That doesn't make them the bad guys,
either; I don't know their situation.

But at least the have all the facts available to them, and access to
investigate and fix.

Finally: it would take you all of 2 minutes to look at repository.xml,
and choose the download URL you want from that file. Just replace
'repository.xml' with the appropriate ... value.

If you want to help yourself -- go home, or to a public library or a
coffee shop or something, and download it onto a USB key.

I think I can safely speak for the community, when I say the community
doesn't like being flamed for things that are not the community's
fault.

On the other hand -- if, in the course of your investigations, you
have SPECIFIC questions, with sufficient context, we're still glad to
answer. The community doesn't hold grudges, much.

Ashish Srivastava wrote:
> This is really bad behavior. None of you are trying to solve the
> problem for people with Proxy + Authentication enabled. It's really
> that people are being truly selfish. Shame on the community.
>
> > > On Jan 4, 9:31 am, teryz  wrote:
> >
> > > > I have a problem using AndroidSDKUpdater (revision 4). For the
> > > > record I'm under win xp 32-bits, jdk 1.6.
> > > > I set up the "Force https://... sources to be fetched using http://
> > > > This seemed to work fine but as I am behing a (corporate)proxyI also
> > > > filled theproxyserver and port settings, however thisproxyrequires
> > > > a user/passwordand I can't find a way to give Android Updater aproxy
> > > > authentication as no authentication box pops up when I try downloading
> > > > updates and I have a
> > > > " response code: 407 for 
> > > > URL:http://dl-ssl.google.com/android/repository/repository.xml";
> > > > when refreshing sources.
> >
> > > > If someone can help...
> >
> > > > Teryz.
> >
> > > > On 4 déc 2009, 09:30, Cédric Berger  wrote:
> >
> > > > > 2009/10/29 Cédric Berger :
> >
> > > > > > 2009/10/29 Cédric Berger :
> > > > > >> I can't download through aproxyrequiring authentication.
> >
> > > > > >> I had to select force http, and put user/passwordforproxyin JVM
> > > > > >> command line. This way I can get the list of available updates.
> > > > > >> But when trying to download, it stays stuck (looks like it waits 
> > > > > >> for
> > > > > >> user/password, but no prompt).
> >
> > > > > > Oh in fact it is ok. Through a secondproxy(with authentication too)
> > > > > > it worked. Looks like the firstproxy(a bit more restrictive) blocked
> > > > > > the downloading url. (I could not check why since the URL is not
> > > > > > shown)
> >
> > > > > What is the download URL ?
> > > > > Because I still have problems with theproxyI use. I can download
> > > > > updates metadata, but when trying to install, it hangs.
> > > > > I suspect theproxyblocks the download URL (but 
> > > > > nothttp://dl-ssl.google.com/android/repository/repository.xml)... how
> > > > > can I check what this download url is  (so I could ask for correction
> > > > > in theproxyrules) ?
> >
> >

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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: Smaller tabs, such as the Facebook official app

My Nexus is rooted, so as keianhzo points out, perhaps that has
something to do with it. Or perhaps doing 'adb root' first would
suffice.

Anyway, from the External Tools launch configuration in Eclipse:
Name: hierarchyviewer
Location: ${workspace_loc:/Tools/android-sdk-windows/tools/
hierarchyviewer.bat}
Working Directory: 
Arguments: 


I should get rid of the .bat file and invoke Java directly, but this
just worked...

On Feb 14, 6:52 pm, Mark Murphy  wrote:
> Mark Murphy wrote:
> > I just tried the Android 2.1 SDK hierarchyviewer on the Nexus One and
> > DROID, and hierarchyviewer refuses to work with either of them.
>
> I should point out that I've tried these from a Linux host. Perhaps
> Windows works better for this. I never bothered trying another host,
> after Mr. Guy's comments.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android Consulting/App Development:http://commonsware.com/consulting

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


Re: [android-developers] Intents

Christopher Walker wrote:
> I am new to android development. To introduce myself to android
> development, I am writing a simple game involving vikings.In this
> game, I presently have to activities: one entitled "Vikings" for the
> menu and one entitled "Campaign" for the game itself. The menu is
> rather basic; it includes a button for quitting and a button for
> beginning the game. As part of the code for newGame's onClick() event,
> there is a call to the Campaign activity. Here is the code (Note that
> NEW_GAME is defined in the Vikings class):
> 
> public void onClick(View v) {
>   /** TODO
>* Call Campaign activity. */
>   Intent i = new Intent(Vikings.this, Campaign.class);
>   startActivityForResult(i, NEW_GAME);
> }
> 
> I assume this should lead into the constructor for the Campaign class,
> which so far looks like this:
> 
> @Override
> public void onCreate(Bundle savedInstanceState) {
>   /** TODO */
> super.onCreate(savedInstanceState);
> setContentView(R.layout.campaign);
> }
> 
> As far as I can tell, there should be nothing wrong with this code;
> however, I get a crash whenever I try the program on either a physical
> device or the emulator.

You will want to examine your Java stack trace, using adb logcat, DDMS,
or the DDMS perspective in Eclipse, to figure out where your crash is
and its cause.

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

Android Training in US: 14-18 June 2010: http://bignerdranch.com

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


Re: [android-developers] Best Way To Implement An Activity That Lists Recipes

erturne wrote:
> I'm working on my first Android app, and would appreciate any guidance
> to make sure I'm doing this the best way. Basically I want an Activity
> to list recipes. Eventually I'll have another Activity to display an
> individual recipe selected from the list, but I'm not worrying about
> that yet. I apologize if this is a really noob question!
> 
> The list of recipes should show each recipe's title, description,
> rating, and date added. For each recipe in the list I'd like the title
> on the top left of the list entry, rating on the top right,
> description on the bottom left, and date added on the bottom right. I
> may want to add photo, icons representing properties of the recipe
> (e.g. vegetarian), etc. The makes me think that each item in the list
> should be a TableLayout.
> 
> With all that in mind, here's what I'm planning to write:
> 
> 1. Write class RecipesDataAdapter extends BaseAdapter. Override the
> getView() method to return an instance of TableLayout. Populate each
> instance of TableLayout with two TableRows, the first row containing
> cells for title and rating, and the second row containing cells for
> description and date added. For now I'll just pass the Recipe
> instances to the adapter in an array.
> 
> 2. Write class ListRecipesActivity that extends ListActivity. Override
> the onCreate() method to obtain instances of the Recipe class and call
> the setListAdapter() method with an instance of the RecipesDataAdapter
> class.
> 
> Notice that all this is done in code without any layout XML files. All
> the examples of Activities that I've seen use a layout XML file and
> call setContentView(R.layout.layout_name) but I'm not sure if I need
> to do that for this, or even how I would do that considering my main
> Activity is a list of non-trivial things (TableLayout).
> 
> Please let me know if you think I'm on the right track, or if there is
> a better way to approach this problem.

You definitely want to use layout XML files for your rows and your
activity, to make it easier to support different screen sizes and
orientations. Otherwise, in a quick read, what you have here seems OK.

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

Android Training in US: 14-18 June 2010: http://bignerdranch.com

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


[android-developers] Re: Android 2.0 battery level

Hi Mark! I want to display Batter level stats in my app as shown in
the following link:

http://itunes.apple.com/us/app/app-genie/id352781306?mt=8

Wonder how can i access batter voltage/power information at runtime?

On Dec 23 2009, 5:50 pm, Mark Murphy  wrote:
> Motalen wrote:
> > Is this to say that the Droid has the capability to report higher
> > precision values given the nature of the hardware BUT there is no way
> > to access it?
>
> Here is my interpretation:
>
> -- Precision refers to the fineness of detail. Many Android devices
> report at 1% precision, but the DROID reports at 10% precision.
>
> -- Accuracy refers to how well the reported values reflect reality.
>
> > If I am mistaken, which I hope I am, how would we go
> > about accessing the finer granularity that is needed when developing
> >batteryapplications on the Droid?
>
> As far as I know, you can't. As Ms. Hackborn said, "[10%] is just the
> precision the Droidbatteryreports".
>
> > I have no problem getting single
> > digit precision with other handsets only the Droid produces the
> > strange '10's increments' only.
>
> That's the way Motorola elected to implement thebatterylevel
> information. The SDK does not mandate a minimum level of precision, so
> device manufacturers can report 1%, 10%, 3.14%, or whatever floats their
> boats. Applications (particularly paid ones) should not be relying upon
> some minimum level of precision, just as they should not be relying on
> certain LED colors or the availability of a physical CAMERA button.
>
> If you have more detailed questions on Motorola devices, I recommend
> asking Motorola the questions, since they have developer support boards:
>
> http://developer.motorola.com
>
> --
> 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


Re: [android-developers] Andoid Apps Development

gurnoorinder wrote:
> I want to develop Android apps but my problem is that i do not have a
> Android based phone. Do i need one to test my apps 

The Android SDK comes with an emulator, so you do not need a phone to
start with. Eventually, if you want to publish apps, having hardware
will be a very good idea, as the emulator does not emulate everything.

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

Android Training in US: 14-18 June 2010: http://bignerdranch.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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] Removing default application

hi,
   I am trying to write my own home application.I am trying to reuse
the sample code as provided in the samples folder of the SDK.
   My idea is to try removing all the applications that are shown in
the home application i.e. Desktop shortcuts and as well as the
application listings when we press the menu button.
  I was going through the sample code (Home.java) where I found out
that the applications are maintained in home application as [RECENTS]
[FAVES] [BUTTON] .

And Home.java one can see code as

loadApplications(true);
bindApplications();
bindFavorites(true);
bindRecents();
bindButtons();

commenting out any one them or setting them as FALSE, leads to the
launch of the default Home application not the one that I modified.
Anybody has any idea why it is happening?Is it Android's some sort of
security model??

Even  does anybody have any  idea how to add any new application as
favourites at  desktop from code level?

Or whether this changes are possible at the SDK level or it has to
done at the source code level ,where all the applications are part of
the system image.

Regards
Arindam

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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] DOMException while cloning XML Node

Hi,

The cloneNode methon in the following minimal example works on java
1.6 but throws an DOMException with code 14 under android 5.

Code 14 according to sdk dok means:
"NAMESPACE_ERR
If an attempt is made to create or change an object in a way which is
incorrect with regard to namespaces."

Has anybody an idea why this might be?
Thank you in advance!

---

public class M
{
public static void main(String[] args)
{
try
{
DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();

String text = new String("");
Document document = builder.parse(new InputSource( new
StringReader(text) ));

document.getDocumentElement().cloneNode(true);
}
catch(DOMException e)
{}
catch(ParserConfigurationException e)
{}
catch(IOException e)
{}
catch(SAXException e)
{}
}
}
---

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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] Host is unresolved

Hi,

I encounter troubles trying to connect to a web site from behind a
proxy (128.0.0.26:8080) with my code using:

try
{
URL url = new URL("http://www.mysite.com/test.xml";);
InputSource source = new InputSource(url.openStream());
// do something with the retrieved XML data...
}
catch(Exception e)
{
Log.e(e.getMessage());
}

Launching the emulator through Eclipse with the command line options -
http-proxy 128.0.0.26:8080 or directly from the command line:
emulator @myavd1_5 -http-proxy 128.0.0.26:8080

I set the proxy options in the emulator as follows:
MENU -> Settings -> Wireless controls -> Mobile Network -> Access
Point Names -> T-Mobile US -> Proxy (128.0.0.26) and Port (8080).

All I get is:
Unknown host http://www.mysite.com, throwing UnknownHostException
Host is unresolved: www.mysite.com:80

Note if I launch the Browser in the emulator it tries to connect
automagically to www.google.com but fails saying:
Timeout waiting to connect to the web site.

But if I click on the emulator's MENU button and choose Go using
www.google.com or http://www.mysite.com/test.xml it works perfectly.

All firewalls and antivirus softwares have been disabled on my machine
and the proxy server that are both running Windows XP SP3.

I try forcing the DNS with the -dns-server command line option but
without any success either even when using OpenDNS DNS (208.67.222.222
and 220).

Did I miss something ?
Any helps would be greatly appreciated !

Regards,
Gg.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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] video streaming in android

The Android platform offers built-in encoding/decoding for specific
media types.
what if i want to encode video other than those.
is it anyway to obtain raw stream of data that can be given to
encoder?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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: Upgrading android 1.1 platform to android 1.5



Hi ,


Its better to let us know about the device name and model...

>    1. Is it possible to upgrade the phone from 1.1 to 1.5 (or latest)

   yes u can  i have done for htc Dream - developer's phone ,
upgraded from 1.1 to 1.5 follow this link

  http://www.htc.com/www/support/android/adp.html

regards
Sheik

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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] Best Way To Implement An Activity That Lists Recipes

I'm working on my first Android app, and would appreciate any guidance
to make sure I'm doing this the best way. Basically I want an Activity
to list recipes. Eventually I'll have another Activity to display an
individual recipe selected from the list, but I'm not worrying about
that yet. I apologize if this is a really noob question!

The list of recipes should show each recipe's title, description,
rating, and date added. For each recipe in the list I'd like the title
on the top left of the list entry, rating on the top right,
description on the bottom left, and date added on the bottom right. I
may want to add photo, icons representing properties of the recipe
(e.g. vegetarian), etc. The makes me think that each item in the list
should be a TableLayout.

With all that in mind, here's what I'm planning to write:

1. Write class RecipesDataAdapter extends BaseAdapter. Override the
getView() method to return an instance of TableLayout. Populate each
instance of TableLayout with two TableRows, the first row containing
cells for title and rating, and the second row containing cells for
description and date added. For now I'll just pass the Recipe
instances to the adapter in an array.

2. Write class ListRecipesActivity that extends ListActivity. Override
the onCreate() method to obtain instances of the Recipe class and call
the setListAdapter() method with an instance of the RecipesDataAdapter
class.

Notice that all this is done in code without any layout XML files. All
the examples of Activities that I've seen use a layout XML file and
call setContentView(R.layout.layout_name) but I'm not sure if I need
to do that for this, or even how I would do that considering my main
Activity is a list of non-trivial things (TableLayout).

Please let me know if you think I'm on the right track, or if there is
a better way to approach this problem.

Regards,
Eric

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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] AudioRecord Class Problem: Callback is never called

Hello Android Developers!

My Android Java Application needs to record audio data into the RAM
and process it. This is why I use the class "AudioRecord" and not the
"MediaRecorder" (records only to file).

Till now, I used a busy loop polling with "read()" for the audio data.
this has been working so far, but it peggs the CPU too much. Between
two polls, I put the thread to sleep to avoid 100% CPU usage. However,
this is not really a clean solution, since the time of the sleep is
not guaranteed and you must subtract a security time in order not to
loose audio snippets. This is not CPU optimal. I need as many free CPU
cycles as possible for a parallel running thread.

Now I implemented the recording using the
"OnRecordPositionUpdateListener". This looks very promising and the
right way to do it according the SDK Docs. Everything seems to work
(opening the audio device, read()ing the data etc.) but the Listner is
never called.

Does anybody know why?

Info: I am working with a real Device, not under the Emulator. The
Recording using a Busy Loop basically works (however not satifiying).
Only the Callback Listener is never called.

Here is a snippet from my Sourcecode:

__ snip!
public class myApplication extends Activity {

  /* audio recording */
  private static final int AUDIO_SAMPLE_FREQ = 16000;
  private static final int AUDIO_BUFFER_BYTESIZE = AUDIO_SAMPLE_FREQ *
2 * 3; // = 3000ms
  private static final int AUDIO_BUFFER_SAMPLEREAD_SIZE =
AUDIO_SAMPLE_FREQ  / 10 * 2; // = 200ms

  private short[] mAudioBuffer = null; // audio buffer
  private int mSamplesRead; // how many samples are recently read
  private AudioRecord mAudioRecorder; // Audio Recorder

  ...

  private OnRecordPositionUpdateListener mRecordListener = new
OnRecordPositionUpdateListener() {

public void onPeriodicNotification(AudioRecord recorder) {
  mSamplesRead = recorder.read(mAudioBuffer, 0,
AUDIO_BUFFER_SAMPLEREAD_SIZE);
  if (mSamplesRead > 0) {

// do something here...

  }
}

public void onMarkerReached(AudioRecord recorder) {
  Error("What? Hu!? Where am I?");
}
  };

  ...

  public void onCreate(Bundle savedInstanceState) {

  try {
  mAudioRecorder = new AudioRecord(
  android.media.MediaRecorder.AudioSource.MIC,
  AUDIO_SAMPLE_FREQ,
  AudioFormat.CHANNEL_CONFIGURATION_MONO,
  AudioFormat.ENCODING_PCM_16BIT,
  AUDIO_BUFFER_BYTESIZE);
} catch (Exception e) {
  Error("Unable to init audio recording!");
}

mAudioBuffer = new short[AUDIO_BUFFER_SAMPLEREAD_SIZE];
 
mAudioRecorder.setPositionNotificationPeriod(AUDIO_BUFFER_SAMPLEREAD_SIZE);
mAudioRecorder.setRecordPositionUpdateListener(mRecordListener);
mAudioRecorder.startRecording();

/* test if I can read anything at all... (and yes, this here
works!) */
mSamplesRead = mAudioRecorder.read(mAudioBuffer, 0,
AUDIO_BUFFER_SAMPLEREAD_SIZE);

  }
}

__ snip!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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] Store image and video from the web into the sdCard

Hi everyone,

I would like to save images and videos from the web into foders i have
created on the sdCard.
I know how to directly use them but i have no clue how to store them
into my own folders.

 public void getImageFromInternet(Cas mCas) throws
MalformedURLException{
URL aURL = new URL("http://www.zepizz.com/icon.png";);
try {
 URLConnection conn = aURL.openConnection();
 conn.connect();
 InputStream is = conn.getInputStream();
 BufferedInputStream bis = new
BufferedInputStream(is);
 Bitmap bm = BitmapFactory.decodeStream(bis);
 bis.close();
 is.close();

 }

I'd like to store ,for instance, this file into my folder /sdcard/
com.EpiDroid/res/.

Anyone know how 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] Intents

I am new to android development. To introduce myself to android
development, I am writing a simple game involving vikings.In this
game, I presently have to activities: one entitled "Vikings" for the
menu and one entitled "Campaign" for the game itself. The menu is
rather basic; it includes a button for quitting and a button for
beginning the game. As part of the code for newGame's onClick() event,
there is a call to the Campaign activity. Here is the code (Note that
NEW_GAME is defined in the Vikings class):

public void onClick(View v) {
/** TODO
 * Call Campaign activity. */
Intent i = new Intent(Vikings.this, Campaign.class);
startActivityForResult(i, NEW_GAME);
}

I assume this should lead into the constructor for the Campaign class,
which so far looks like this:

@Override
public void onCreate(Bundle savedInstanceState) {
/** TODO */
super.onCreate(savedInstanceState);
setContentView(R.layout.campaign);
}

As far as I can tell, there should be nothing wrong with this code;
however, I get a crash whenever I try the program on either a physical
device or the emulator.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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] Broadcasting Real Time Voice using RTP

Hi,
I am currently trying to braodcast real time voice from Android using
RTP to other Android phones connected over Wifi Ad-hoc network.
I have few questions in this regard,

1. How to control and set the RTP on Android?
2. Which Codec are supported by Android for voice communication? and
how to incorporate them ?

We are able to record a voice from microphone and store it on SD card
for a playback. The next step would be to link the outstream of real
time voice with RTP also incorporating Codec

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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] Reg: Android Game API

Hi All,

I am new to android games development on mobiles.  can any one suggest
me which API suitable to develop game. I am using Android 1.5 API for
Android mobiles.

I need help from you all.


Thanks,
TomM.

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


Re: [android-developers] Re: Reposition views att runtime

Hi ,
If the position of the Activity has to be changed at runtime then we need to
get the Window Object from the Activity and then set the x, and y
coordinates of the Layoutparams.
Below is the snippet from the code which worked out for me.

WindowManager.LayoutParams lp = *this*.getWindow().getAttributes();
lp.x = 50;  //x position on the screen
lp.y = 50;
*this*.getWindow().setAttributes(lp);

Hope, this is helpful.

On Wed, Jan 27, 2010 at 10:05 PM, ls02  wrote:

> In activity onCreate where all views are set all views sizes are still
> 0. I need to create an image that depends on sizes on some views.
> These views sizes depend on content set at runtime. I didn't find any
> overridable in activity that is called AFTER all views have been set
> and inflated and their inflated runtime sizes are valid.
>
> On Jan 27, 10:48 am, "Mark Murphy"  wrote:
>  > > How do I reposition views at runtime?
> >
> > The same way you position them in the first place -- by manipulating
> their
> > layout rules (e.g., android:layout_centerInParent). You do this via
> > calling getLayoutParams() on your View, casting it to an appropriate type
> > (e.g., RelativeLayout.LayoutParams), making the desired changes, and
> > calling setLayoutParams() to affect those changes.
> >
> > Note that I haven't done this in quite some time, so the above recipe is
> > from memory and may be a bit off, though I'm pretty sure it is mostly
> > correct.
> >
> > --
> > Mark Murphy (a Commons Guy)http://commonsware.com
> > Android App Developer Books:http://commonsware.com/books.html
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

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

[android-developers] Using onRetainNonConfigurationInstance to keep Media player after orientation change

Hello,

I am trying to keep a video playback going after a orientation change
but keep getting a crash when trying to pass the media player trough
onRetainNonConfigurationInstance.

I can pass the time, setup the media player from scratch and do a fast
forward but I would not like to do the setup more than once.

My code looks like:

@Override
public Object onRetainNonConfigurationInstance() {
 return(  mp  );
 }

public void onCreate(Bundle icicle) {
...
createMediaPlayer();
}

public void createMediaPlayer() {
...
if (getLastNonConfigurationInstance()!=null) {
mp  = (MediaPlayer) getLastNonConfigurationInstance() ;
} else {
mp = new MediaPlayer();
...
}
}

Can anyone help me pinpoint why this does not work?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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] getRotationMatrix and getOrientation

I'm using getRotationMatrix and getOrientation to change the camera's
view (eyeX, eyeY and eyeZ for the gluLookAt method) on the 3D objects
generated depending on the movement of the user but I'm not getting
any results. All I'm getting is a blank screen. Which part of the
process am I doing it wrong? Any help will be great. :)

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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] Regarding expansion of google market


Hi Guys,

I have been waiting for the expansion of google market and to my shock
I see that there is almost no activity on the same for the past couple
of months. We just keep hearing that expansion will happen, but
absolutely no news on the same.

Does someone out there have any updates, and can comeone from google
reply for this query that we have been asking a million time, just
once...

Regards,
R.Karthik

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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] Application Security


Guys,

I really need some assistance. I have a small app which I hope to
release very soon. It will be sold at a minimal price as its not worth
much more. However Im wondering if I should be obfuscating my code or
using other techniques to counter hackers?
Also should I be registering this somehow to protect my Intellectual
Property? I wouldnt want somebody just cloning my app.

Any advice/tips?

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] Images from Xml

Hi everyone! Can somebody help wih such problem.
I need to take out of XML file images to view it on display using XML
parser.
I proclaimed in xml file passes to images.

Using something like it:

res/xml/game.xml












Is it clear??

So in java class I need to use XmlResourseParser

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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] Browser Standalone

i want to change the path of the libwebcore.so to the path of the
browser application instead of "/system/lib" to make browser
standalone

 how can i do this?
Hint

i have 2.1 version

thanks alot

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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 there any changes in crop image activity

I think the answer is here:
  
http://developer.android.com/intl/de/guide/topics/manifest/activity-element.html#exported

In eclair, the CropImage activity has no intent-filter associated with
it, so it is not exported.  This means it cannot be launched by
components of other applications.  If this is what you are trying to
do, then that would explain the failure.  Note that this *is*
different to previous versions of Android.  See the declaration of the
CropImage activity with an intent-filter in release-1.0 here (line
86):
  
http://android.git.kernel.org/?p=platform/packages/apps/Camera.git;a=blob;f=AndroidManifest.xml;hb=release-1.0
...compared to the declaration of the CropImage activity *without* an
intent-filter in eclair here (line 71)
  
http://android.git.kernel.org/?p=platform/packages/apps/Camera.git;a=blob;f=AndroidManifest.xml;hb=eclair-release



On Feb 13, 7:05 pm, Adarsh Pandey  wrote:
> Hi,
>
> We are facing problem with cropimage activity, is there any changes?
> it gives error related to permission.
>
> java.lang.SecurityException: Permission
> Denial: starting Intent { act=android.intent.action.EDIT
> dat=content://
> media/external/images/media/12 cmp=com.android.camera/.CropImage (has
> extras) } from ProcessRecord{43b72040 374:com.abc/10028} (pid=374,
> uid=10028) requires null

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


[android-developers] Is possible to listen long press event on a link in my webview control?

I have a html list in the webview control, I want to popup a menu when
user long press on one item. Is that possible?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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 style text in string array?

Hi,

I have a string array and was trying to style certain parts of the
text with tags like , , ... but it doesn't work.
The array looks like this:



blabla\nblabla



The text is displayed in the textview like this:
tTitel.setText(Html.fromHtml(Text[ii]));

I tried it without Html.fromHtml too but this had no effect. The
styling tags do work if i use them directly in the code, like:
tTitel.setText(Html.fromHtml("blablablabla");

Any ideas how to style the text in an array??

Cheers,
Chris

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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] Any APIs support configuring specific PDE server ?

Carrier want it's navigator use specific PDE server to get location
information
so we need  API that can configure PDE server(IP, Port)
Is it 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] Browser Standalone

i want to change the path of the libwebcore.so to the path of the
browser application instead of "/system/lib" to make browser
standalone

 how can i do this?
Hint

i have 2.1 version

thanks alot

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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: trying to launch Android 2's Gallery .. security exception

(Replying to a slightly old thread)

The answer is here:
  
http://developer.android.com/guide/topics/manifest/activity-element.html#exported

In 1.0 the activity had an intent-filter, and was therefore exported
(available to other components).

In eclair it does not have an intent-filter, and is therefore *not*
exported.

See the difference between the 1.0 GalleryPicker activity declaration
  
http://android.git.kernel.org/?p=platform/packages/apps/Camera.git;a=blob;f=AndroidManifest.xml;hb=release-1.0
and the 2.1:
  
http://android.git.kernel.org/?p=platform/packages/apps/Camera.git;a=blob;f=AndroidManifest.xml;hb=eclair-release


On Jan 27, 4:18 pm, "Mark Murphy"  wrote:
> > Understood.  I'm trying to invoke this class because it was
> > programmatically found to exist previously.
>
> I seem to recall a related case (trying to launch a video into Gallery)
> being asked a month or so ago on this list. The upshot was that just
> because an activity exists does not mean you can launch it directly using
> the component name anymore.
>
> --
> Mark Murphy (a Commons Guy)http://commonsware.com
> Android App Developer Books:http://commonsware.com/books.html

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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] to fix a credit card reader compatibility with android phones

Hi,

I want to ask u guys a very , crazy may be stupid quest!!!.
M thinking to write a module on compatibility of android with credit card
readers 

 basically , it can make our life very easier ;u gotta swap your card
instead of internet banking stuffs , directly pay your bills, by a swap ,
and most important u dint need a huge wallet or a ATM machine , to buy
something cool!!
Shall i give it a try or its a crazy idea?
just wanna to ask u guys?

Regards
Shaswat Nimesh

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

Re: [android-developers] Re: Reposition views att runtime

The above activity was created using the xml tag:

android:theme=*"@android:style/Theme.Dialog
*This gives the Activity a floating window/Dialog look.



On Mon, Feb 15, 2010 at 12:56 PM, sridhar marampudi <
marampudisrid...@googlemail.com> wrote:

> Hi ,
> If the position of the Activity has to be changed at runtime then we need
> to get the Window Object from the Activity and then set the x, and y
> coordinates of the Layoutparams.
> Below is the snippet from the code which worked out for me.
>
> WindowManager.LayoutParams lp = *this*.getWindow().getAttributes();
> lp.x = 50;  //x position on the screen
> lp.y = 50;
> *this*.getWindow().setAttributes(lp);
>
> Hope, this is helpful.
>
> On Wed, Jan 27, 2010 at 10:05 PM, ls02  wrote:
>
>> In activity onCreate where all views are set all views sizes are still
>> 0. I need to create an image that depends on sizes on some views.
>> These views sizes depend on content set at runtime. I didn't find any
>> overridable in activity that is called AFTER all views have been set
>> and inflated and their inflated runtime sizes are valid.
>>
>> On Jan 27, 10:48 am, "Mark Murphy"  wrote:
>>  > > How do I reposition views at runtime?
>> >
>> > The same way you position them in the first place -- by manipulating
>> their
>> > layout rules (e.g., android:layout_centerInParent). You do this via
>> > calling getLayoutParams() on your View, casting it to an appropriate
>> type
>> > (e.g., RelativeLayout.LayoutParams), making the desired changes, and
>> > calling setLayoutParams() to affect those changes.
>> >
>> > Note that I haven't done this in quite some time, so the above recipe is
>> > from memory and may be a bit off, though I'm pretty sure it is mostly
>> > correct.
>> >
>> > --
>> > Mark Murphy (a Commons Guy)http://commonsware.com
>> > Android App Developer Books:http://commonsware.com/books.html
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>>
>
>

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

[android-developers] Re: Inadvertent breakage by SDK going forward

Does this truly mean that even if I compile to the 1.6 platform, if my
code implements a 2.1 callback method, that method will *never* be
invoked on 1.6 devices but *will* be invoked on 2.1 devices?  Even
though I compiled to the 1.6 platform?  That's crazy!




On Feb 12, 4:01 pm, Mike Collins  wrote:
> Ran into the below issue and wanted to see what solutions people
> have...
>
> In SDK 1.6 Activity did not have a method onBackPressed (), in 2.0 it
> appeared.
> Using the current docs I added an onBackPressed to a couple of our
> classes.
> We build against 1.6 (customer requirement) it seemed a bit odd that
> the compiler
> got upset when I put in a @Override, so I took it out and proceeded to
> verify that
> everything was working, which it was, the method was being invoked
> exactly as
> expected.
>
> Turns out this works only on phones/emulators with 2.0 or greater
> firmware.  On
> 1.6 firmware it fails to function at all because nobody calls it.
>
> OK, with hindsight it's obvious what's happening and we've made the
> @Override
> an error not a warning.
>
> But it raises the issue of how to I protect my app if in the future
> Android implements
> a method that collides with the name of method I invent for my derived
> class.  In
> this case Android will be calling my method at inappropriate times and
> expecting
> it to do things that it probably doesn't do.
>
> One solution is prefix every method of ours of every class that
> derives from an Android
> class with something specific to the app.  Or use a different naming
> convention, like
> always use an initial capital or an underscore etc.
>
> thoughts?
>   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] Accuracy in GPS Location

Hi ,

I wanted to know that the accuracy value returned by the getAccuracy()
is of which type radial accuracy or horizontal accuracy.


-regards
Rajat

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this 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: Bluetooth support in Android 1.5

Hello, Ive had the same problem. I found this but im still trying to
get it to work:

http://code.google.com/p/backport-android-bluetooth/

Maybe itll be of some use to 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


  1   2   >