[android-developers] How to turn off camera sound on G1?

2009-08-30 Thread Shawn McMurdo

Anyone know how I can turn off the camera shutter sound on the G1 from
within my application?
Thanks!
Shawn
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: reduce list view font size

2009-08-30 Thread powerbyte

Check the sample code in

..\android-1.5\samples\ApiDemos\src\com\example\android\apis\view
\List14.java

-Somu

On Aug 31, 8:58 am, Sasi Kumar  wrote:
> thanks for your reply.
> Please give one example briefly/
>
> On Aug 29, 8:59 pm, "Balwinder Kaur (T-Mobile USA)" 
>
>
> mobile.com> wrote:
> > You can create a custom adapter and override the getView method.
>
> > Balwinder Kaur
> > Open Source Development Center
> > ·T· · ·Mobile· stick together
>
> > The views, opinions and statements in this email are those of the
> > author solely in their individual capacity, and do not necessarily
> > represent those of T-Mobile USA, Inc.
>
> > On Aug 29, 12:05 am, Sasi Kumar  wrote:
>
> > > How can we reduce list view font size?
>
> > > Can any one know about these.
>
> > > please reply me.
>
> > > Thanks in advance
>
> > > Join
>
> > >http://groups.google.com/group/mobile-application-developers- 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] ADC deadline drawing near

2009-08-30 Thread James Yum
Hello,
There's about 24 hours left before the deadline. Please, please don't wait
until the last second to submit your entries. Your APK may not validate on
the submission site, so leave some time to correct any issues. You can
always update your entry later, and it's better to have something to show
for your work rather than nothing.

If you plan on updating an existing entry, again don't wait until the last
minute. And a quick heads up, you will have to increase your version code in
order to update over your previous APK, similar to how it is on the Market.

Good luck!
James

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

2009-08-30 Thread James Yum
Hi William,
Try logging completely out of ADC site and/or Market site and try it again.

Cheers,
James

On Sat, Aug 29, 2009 at 8:08 AM, William Frati wrote:

>
>  I'm keep getting "upload a valid APK" when i'm uploading my app in
> ADC2 site submission.
>  I followed all istructions at
> http://developer.android.com/guide/publishing/preparing.html,
> then signed my application with private key (40 years due date) all
> with Eclipse (Android tools\Export signed application package).
> The apk work fine in my phone.
> What I doing wrong?
>
> Other info:
> Cancelled all Log. references;
> this is my begin manifest file:
> http://schemas.android.com/apk/res/android";
>  package="xxx.yyy.ADC2"
>  android:versionCode="1"
>  android:versionName="1.0.2">
>
>android:icon="@drawable/icon"
>android:label="@string/app_name">
> 
>
> >
>

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

2009-08-30 Thread quill

Hi, everyone,
I;m testing to scale an image, and I got a problem:

main.xml:


onCreate():
iv = (ImageView) findViewById(R.id.iv);
iv.setImageResource(R.drawable.icon);

onTouchEvent():
Matrix mtrx = iv.getImageMatrix();
mtrx.postScale(2, 2);
iv.setImageMatrix(mtrx);
iv.setScaleType(ScaleType.MATRIX);
iv.invalidate();

when I touch the screen the image does scaled, but the size of
imageview does not change, so I can only see part of the image. Any
way to map the imageview to the Matrix(or the drawable)? I add
android:adjustViewBounds="true" but it not works.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Triggering an application on a special gesture / event

2009-08-30 Thread Romain Guy

No, this is not possible. Applications cannot listen to touch/key
events that are not sent to the application itself. Only the system
can do this.

On Sun, Aug 30, 2009 at 9:41 PM, Dinesh wrote:
>
> hi,
>
> The App I'm trying to work on requires that when a special combination
> of keys are pressed ( irrespective of the keypad being locked ) a
> service / app is triggered.
>
> How can I achieve this? My app's whole idea hinges on this particular
> part to work.
>
> I am not here to take a "no" for an answer. If you are going to tell
> me that its not possible, atleast include an explanation as to why its
> not possible.
>
> Thanks.
>
> Dinesh
>
> >
>



-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: ADC 2 Submission Site -- Now live

2009-08-30 Thread James Yum
Hi Monmonja,
If you already submitted the app to Market, you need to submit to the ADC
site under a different package name. Were you able to do that successfully?

Cheers,
James

On Sun, Aug 30, 2009 at 8:56 PM, monmonja  wrote:

>
> i had submitted an app on adc but it does not show on the listing but
> when i try to reupload the app, it said there is something the same on
> the market. Is this normal? can i update my app? tnx
>
> On Aug 28, 1:23 am, Dan Morrill  wrote:
> > We are not planning to extend the submission deadline.
> > - Dan
> >
> > On Tue, Aug 25, 2009 at 2:22 PM, patrick 
> wrote:
> >
> > > Hi,
> >
> > > i'm asking wher can we ask google to extend the deadline?
> >
> > > thks
> >
> > > On 25 août, 17:05, Dan Sherman  wrote:
> > > > There's no reason that they would change the deadline.  The deadline
> has
> > > > been set at the 31st since late May (as stated before).  With that
> > > deadline
> > > > posted, your app should be ready to hit the submit button on the 31st
> or
> > > > sooner.  Nothing changed, they're giving you a full week to hit the
> > > "Submit"
> > > > button.
> >
> > > > - Dan
> >
> > > > On Tue, Aug 25, 2009 at 12:06 PM, Maps.Huge.Info (Maps API Guru) <
> >
> > > > cor...@gmail.com> wrote:
> >
> > > > > I see no need to extend the deadline, it's been public since May
> 27th,
> > > > > if you're not ready by now, you'll probably never be ready. People
> > > > > have to learn that a deadline means something, extending it would
> only
> > > > > punish those who are ready and reward those who can't meet project
> > > > > goals on time.
> >
> > > > > -John Coryat
> >
>

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



[android-developers] Re: Do you got any confirmation after ADC 2 submit?

2009-08-30 Thread James Yum
Hi Cindy,
No email confirmation. Just make sure (everyone) that it appears in the
application listing at http://market.android.com/adc as "Submitted".

Cheers,
James

On Sun, Aug 30, 2009 at 10:48 PM, cindy  wrote:

>
> Have you got any confirmation for ADC 2 submission? How to check the
> current status of my submission?
>
> Thanks!
>
> Cindy
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Any email confirmation after submit the application for ADC 2?

2009-08-30 Thread James Yum
Hi Parchira,
No email confirmation. Just make sure (everyone) that it appears in the
application listing at http://market.android.com/adc as "Submitted".

Cheers,
James

On Sun, Aug 30, 2009 at 10:46 PM, parchira tech wrote:

>
> I have submitted my application for ADC 2. But I didn't receive any
> email. How can I know the application is successfully submited.
>
> THanks!
>
> Parchira
>
> >
>

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

2009-08-30 Thread dsuwirya

Hi,

I need help how to use correctly the javascript : "document.cookie" or
how
to write cookie from javascript in Android web browser ?

I've make sure in the settings that cookie is enabled. When I checked
by
using "navigator.cookieEnabled", it returns true as well.

I've a piece of javascript code as follow that has been working
everywhere
( e.g. PC browsers, iPhone ), but doesn't work in Android.

function createCookie(name) {

// cookies expired in 1 year.
var expDate = new Date();
expDate.setDate(expDate.getDate() + 365);
expDate = expDate.toGMTString();

var el = document.getElementById(name);
document.cookie = name + '=' + escape(el.value) + '; path=/ ;
expires=' + expDate;
document.cookie = name + '-idx=' + escape(el.selectedIndex) + ';
path=/ ; expires=' + expDate;

//alert('cookie : ' + document.cookie);
}

When I open the 'alert' comment in the last line of code, Android will
just show blank while
all other browsers show me the content of the cookie that I've just
written.

Please help.

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] Any email confirmation after submit the application for ADC 2?

2009-08-30 Thread parchira tech

I have submitted my application for ADC 2. But I didn't receive any
email. How can I know the application is successfully submited.

THanks!

Parchira

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Displaying Bitmap from PictureCallback works on emulator but not on G1

2009-08-30 Thread Shawn McMurdo

I am trying to display a Bitmap from the PictureCallback.
It works on the emulator but I get a blank screen on the G1.
In both cases I am running from Eclipse using ADT plugin.

Here is the relevant code:

public void onPictureTaken(byte[] data, Camera camera) {
Bitmap bitmap = BitmapFactory.decodeByteArray(
data, 0, data.length);
Rect src = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight
());
Canvas canvas = preview.getHolder().lockCanvas();
Rect dst = new Rect(0, 0, canvas.getWidth(), canvas.getHeight
());
canvas.drawBitmap(bitmap, src, dst, null);
preview.getHolder().unlockCanvasAndPost(canvas);
}

preview is of class Preview extends SurfaceView implements
SurfaceHolder.Callback

Any clues appreciated.
Thanks!
Shawn

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Triggering an application on a special gesture / event

2009-08-30 Thread Dinesh

hi,

The App I'm trying to work on requires that when a special combination
of keys are pressed ( irrespective of the keypad being locked ) a
service / app is triggered.

How can I achieve this? My app's whole idea hinges on this particular
part to work.

I am not here to take a "no" for an answer. If you are going to tell
me that its not possible, atleast include an explanation as to why its
not possible.

Thanks.

Dinesh

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



[android-developers] Re: Activity stack: A B C -> press BACK -> go to A

2009-08-30 Thread Andrei Bucur
Maybe this helps:
http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_PREVIOUS_IS_TOP

On Mon, Aug 31, 2009 at 4:28 AM, tstanly  wrote:

>
> can possiable to verify whether B is exist or not?
> if B exist,so the apps can call finish() to close B,
> if not,don't call B.finish()
> (will be error because B is not exist)
>
>
> thanks!
>
> On 8月31日, 上午4時11分, "Jonas Petersson"  wrote:
> > fhucho wrote:
> > > my activity stack is ABC, in activity C I press back, and return to B,
> > > then press back again and go to A. What should I do to return to A
> > > directly from C?
> >
> > I guess it depends on the reason for wanting to skip "B". I needed
> > exactly this case yesterday and in my case "B" knows very well that it
> > will not be needed when it starts up "C", so "B" simply calls finish()
> > after that. Solved.
> >
> > Best / Jonas
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Do you got any confirmation after ADC 2 submit?

2009-08-30 Thread cindy

Have you got any confirmation for ADC 2 submission? How to check the
current status of my submission?

Thanks!

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

2009-08-30 Thread petter

nevermind, I already solved it throw Instrumentation::sendKeyDownUpSync
(int keyCode);


On Aug 24, 2:42 pm, petter  wrote:
> Hi,
> I' d like to fire up onKeyDown() event from my source code (for
> example from Activity). I want it, because i'd like to create program
> for remote keyboard, which will be PC keyboard. PC will send to mobile
> throw Socket message and mobile will fire up event from message in
> socket. Message will contain pressed key on PC keyboard. In future i'd
> like to create service, which will be starting on device power on .
>
> thanks for reply
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Null Pointer Exception

2009-08-30 Thread Roman ( T-Mobile USA)

My first guess is that your variable is not instantiated that's why
you cannot call the method.

 but let's look at your code first 

--
Roman Baumgaertner
Sr. SW Engineer-OSDC
·T· · ·Mobile· stick together
The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.

On Aug 30, 9:51 pm, Sasi Kumar  wrote:
> when i'm trying to call another class method.
> It is showing null pointer exception.
>
> Plz give some suggestion to get back from this
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Question on ADC2 signup for teams

2009-08-30 Thread Peli

On the ADC 2 sign up page, there is the option: participant type:
Individual, Team, or Business,

We want to choose participant type "team", and the terms & conditions
state that
"all of the members of the team must accept the Terms in the manner
specified by Google.".

I have not been prompted for the other team members' names. Should
they all sign into the ADC 2 web page? Or is only the team leader's
sign-up necessary?

Peli

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

2009-08-30 Thread Dexter's Brain

Without looking at your code, it si practically impossible to suggest
something to you...

Dexter.

On Aug 31, 9:51 am, Sasi Kumar  wrote:
> when i'm trying to call another class method.
> It is showing null pointer exception.
>
> Plz give some suggestion to get back from this
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Having problem to read data from the local host server using Http Get method....

2009-08-30 Thread ragavendran s
This is a code i m having to read a data from the sever using Http Get
method

but still i cant read the values from the localhost server.


can anybody tell the correct code to replace this
thanks,


with regards,
Raghav.S


Code:


package netw.htt;

import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;


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


private StringBuffer str=null;
TextView text,text1;
 EditText edt;
 Button btn;
 String n=null;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
edt=(EditText)findViewById(R.id.edt);
text=(TextView)findViewById(R.id.text);
btn=(Button)findViewById(R.id.btn);



btn.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
text.setText("");
String st1=edt.getText().toString();
String output ="
http://localhost:8080/Serv1/servlet/Servlet1?name="+st1;
//SimpleGet.this.
//getHttpResponse(getInput.getText().toString());
try {



OpenHttpConnection1(output);

} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

if (output != null)
{
text.setText(output);
}
}
});
};





  private   StringBuffer OpenHttpConnection1(String urlString)  throws
IOException

{
InputStream in = null;
int response = -1;
int i=1;

//String inputLine;
   // StringBuffer str2 = null;

URL url = new URL(urlString);
URLConnection conn = url.openConnection();

if (!(conn instanceof HttpURLConnection))
throw new IOException("Not an HTTP connection");

try{
HttpURLConnection httpConn = (HttpURLConnection) conn;
httpConn.setAllowUserInteraction(false);
httpConn.setInstanceFollowRedirects(true);
httpConn.setRequestMethod("GET");
httpConn.connect();

response = httpConn.getResponseCode();
if (response == HttpURLConnection.HTTP_OK) {
in = httpConn.getInputStream();

 text1.setText(i);
int ch;

while((ch=in.read())!=-1)

{

str.append((char)ch);
}



}

}

catch (Exception ex)
{
throw new IOException("Error connecting");
}
return str;
}

}

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

2009-08-30 Thread Nightwolf

I don't know why you are getting 0. But onSurfaceChanged is good place
to create textures. Placing texture creation/loading code inside of
onDrawFrame is bad idea.

On Aug 30, 12:24 pm, deki  wrote:
> I am calling glGenTextures inside onDrawFrame and I am always getting
> 0.
>
> Calling glGenTextures in onSurfaceCreated works fine.
>
> What's the problem?
>
> 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] Null Pointer Exception

2009-08-30 Thread Sasi Kumar

when i'm trying to call another class method.
It is showing null pointer exception.


Plz give some suggestion to get back from this

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



[android-developers] Package my common code as library

2009-08-30 Thread Siu Man Yu

I have done some cusomtizations on general user interface behavior.

I would put those features into my applications. Therefore, I package
my source code as a jar and add this external library to my
applications.

As my cusomtization include some inflation of xml files, I put those
resource in my package. However, when I finished compiled my
application and ran it, it reports error. It seems cannot locate the
xml file in the jar. (My debugger stop while inflate the xml file).

Do I miss any step to use my jar 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: How to call another class method.

2009-08-30 Thread Marco Nelissen

A more general Java beginners group seems more appropriate for this question.


On Sun, Aug 30, 2009 at 8:56 PM, Sasi Kumar wrote:
>
> I used intent to call class.
> But i want to call the function.
>
> Give some other idea to call function.
>
> On Aug 28, 8:24 pm, "Roman ( T-Mobile USA)"  mobile.com> wrote:
>> I am assuming that you want to get the activity eSkyGuide in the
>> foreground, correct?
>>
>> In this case as ragavendran suggested, call an Intent to start up the
>> new activity. Something like
>>
>>        Intent eSkyGuideIntent = new Intent() ;
>>        eSkyGuideIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
>>
>>        eSkyGuideIntent.setClassName
>> (".eSkyGuide",".eSkyGuide");
>>
>>        mContext.startActivity(eSkyGuideIntent);
>>
>> Make sure that you have a valid context instance. With doing this your
>> new activity should be started.
>>
>> --
>> Roman Baumgaertner
>> Sr. SW Engineer-OSDC
>> ·T· · ·Mobile· stick together
>> The views, opinions and statements in this email are those of the
>> author solely in their individual capacity, and do not necessarily
>> represent those of T-Mobile USA, Inc.
>>
>> On Aug 28, 7:07 am, ragavendran s  wrote:
>>
>> > I think u may use like this ...Intent to call another .java class
>> > if successs u reply to me...thanks
>>
>> > > weather.java
>>
>> > > public class Weather extends Activity implements
>> > > Button.OnClickListener
>> > > {
>>
>> > > Intent intent = new Intent(this, homepage.class);
>> > > startActivity(intent);
>>
>> > > }
> >
>

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

2009-08-30 Thread Dianne Hackborn
What Context did you use t create the dialog?  You need to use an activity
if you want to be able to launch another activity as part of the same task.

On Sun, Aug 30, 2009 at 8:41 PM, luoqii  wrote:

>
> hi bodies!
>when i want to implements a autolink func in dialog, i.e. when a
> click the autolink, it will bring me the righit place: broswer, mail,
> sms,and so on.
>   when i do this with
>   {
>  ... ...
> TextView.setAutoLinkMask(Linkify.ALL);
> TextView.setMovementMethod
> (LinkMovementMethod.getInstance());
> ... ...
>   }
>
>if i click the Ling this will be a error that say:
>
> android.util.AndroidRuntimeException: Calling startActivity()
> from outside of an Activity  context requires the
> FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
>
>what's happen? or how can i finish my task?
>
>
>THANKS@@@
>
> good day!!!
>
> >
>


-- 
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: Hello World - Unknown Error

2009-08-30 Thread DemoShadow
that does not help...

On Aug 30, 2009 3:31 AM, "Osmo Maatta"  wrote:

Hello all,

Here is a guide that gets you started on Linux (on Ubuntu Linux).
http://www.futuredesktop.org/developing_android_apps_on_ubuntu.html

--~--~-~--~~~---~--~~ You received this
message because you are ...

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

2009-08-30 Thread Sasi Kumar

How can we use map to map give one example. plz

On Aug 28, 10:21 am, quill  wrote:
> Use a map to map your key and drawable id.
>
> On Aug 28, 12:48 pm, Sasi Kumar  wrote:
>
> > my code is:-
>
> > Drawabel partlycloud=res.getDrawable(R.drawable.a65_color_31);
>
> > I have more images like
>
> > a65_color_31
> > a66_color_31
> > a67_color_31
> > a68_color_31
> > a69_color_31
> > a70_color_31
> > a71_color_31
>
> > If user gives input as 67 then my drawable should be
>
> > Drawabel partlycloud=res.getDrawable(R.drawable.a67_color_31);
>
> > if it is 70
>
> > Drawabel partlycloud=res.getDrawable(R.drawable.a70_color_31);
>
> > like this i have more than 100 images how can give in simple code with
> > less codes.
>
> > please reply me..
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Date Limit

2009-08-30 Thread Sasi Kumar

Give suggestion for this limited date.
I am not expecting in date picker.
It may be any thing else.
I want only the answers.

On Aug 30, 12:23 am, Brian Conrad  wrote:
> I've done something like this with my own DatePicker like widget where I
> used the TextWatcher member to keep input within bounds.  I haven't
> tried it with the DatePicker widget but it may be possible.
>
> - Brian
>
> Sasi Kumar wrote:
> > Can any one suggess that i want a limited datepicker
>
> > ex:- 25 aug 2009 to 24 aug 2010
>
> > please reply
>
> > Join:
>
> > http:
> > //groups.google.com/group/mobile-application-developers
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: draw textview

2009-08-30 Thread Sasi Kumar

I don't know about the android:typeface and  android:textStyle .
Plz give some example for this.

On Aug 29, 7:00 pm, "Balwinder Kaur (T-Mobile USA)"  wrote:
> I didn't quite see your problem..however if you want to drawText, you
> can create a CustomView and override the onDraw method.
>
> Use the Canvas.drawText method to draw your text.
>
> Also, did you try textview's android:typeface and  android:textStyle
> options
>
> Balwinder Kaur
> Open Source Development Center
> ·T· · ·Mobile· stick together
>
> The views, opinions and statements in this email are those of the
> author solely in their individual capacity, and do not necessarily
> represent those of T-Mobile USA, Inc.
>
> On Aug 29, 5:51 am, Sasi Kumar  wrote:
>
> > please give some suggestion for me...
>
> > I want to draw text in my text view
>
> > my class is extended with Activity.
>
> > textview t1;
> > textview t2;
>
> > t1.settext("sun 29 Sug 2009");
> > t2.settext("tue 29 Sug 2009");
>
> > see here sun and tue both are having same length words but it is
> > moving.
>
> > so when i'm showing it is like
>
> > sun 29 Sug 2009
> > tue 29 Sug 2009
>
> > i want it in straight line like
>
> > sun 29 Sug 2009
> > tue  29 Sug 2009
>
> > now i have adjused with giving space.
> > but i did not want to give space.
>
> > so by drawing we can get these correctly in x and y positions.
>
> > Please give idea for these to draw in activity extended class.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Date Picker

2009-08-30 Thread Sasi Kumar

I want only 3 days that should genarate automatically..
Pls give some suggestion  with example..

ex:-

I want like

30/08/2009
31/08/2009
1/09/2009

we can't able to enter it manually b'coz the date and the month will
cahnge.

On Aug 29, 7:21 pm, "Balwinder Kaur (T-Mobile USA)"  wrote:
> How about just using a Spinner instead of a DatePicker ?
> Balwinder Kaur
> Open Source Development Center
> ·T· · ·Mobile· stick together
>
> The views, opinions and statements in this email are those of the
> author solely in their individual capacity, and do not necessarily
> represent those of T-Mobile USA, Inc.
>
> On Aug 29, 4:08 am, Sasi Kumar  wrote:
>
> > I want a date picker with maximum of 3 days.
>
> > i want like
>
> > yesterday
> > today
> > tomorrow
>
> > this 3 days only i want.
>
> > any one can sugess some idea.
>
> > please reply.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: reduce list view font size

2009-08-30 Thread Sasi Kumar

thanks for your reply.
Please give one example briefly/

On Aug 29, 8:59 pm, "Balwinder Kaur (T-Mobile USA)"  wrote:
> You can create a custom adapter and override the getView method.
>
> Balwinder Kaur
> Open Source Development Center
> ·T· · ·Mobile· stick together
>
> The views, opinions and statements in this email are those of the
> author solely in their individual capacity, and do not necessarily
> represent those of T-Mobile USA, Inc.
>
> On Aug 29, 12:05 am, Sasi Kumar  wrote:
>
> > How can we reduce list view font size?
>
> > Can any one know about these.
>
> > please reply me.
>
> > Thanks in advance
>
> > Join
>
> >http://groups.google.com/group/mobile-application-developers
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: ADC 2 Submission Site -- Now live

2009-08-30 Thread monmonja

i had submitted an app on adc but it does not show on the listing but
when i try to reupload the app, it said there is something the same on
the market. Is this normal? can i update my app? tnx

On Aug 28, 1:23 am, Dan Morrill  wrote:
> We are not planning to extend the submission deadline.
> - Dan
>
> On Tue, Aug 25, 2009 at 2:22 PM, patrick  wrote:
>
> > Hi,
>
> > i'm asking wher can we ask google to extend the deadline?
>
> > thks
>
> > On 25 août, 17:05, Dan Sherman  wrote:
> > > There's no reason that they would change the deadline.  The deadline has
> > > been set at the 31st since late May (as stated before).  With that
> > deadline
> > > posted, your app should be ready to hit the submit button on the 31st or
> > > sooner.  Nothing changed, they're giving you a full week to hit the
> > "Submit"
> > > button.
>
> > > - Dan
>
> > > On Tue, Aug 25, 2009 at 12:06 PM, Maps.Huge.Info (Maps API Guru) <
>
> > > cor...@gmail.com> wrote:
>
> > > > I see no need to extend the deadline, it's been public since May 27th,
> > > > if you're not ready by now, you'll probably never be ready. People
> > > > have to learn that a deadline means something, extending it would only
> > > > punish those who are ready and reward those who can't meet project
> > > > goals on time.
>
> > > > -John Coryat
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to call another class method.

2009-08-30 Thread Sasi Kumar

I used intent to call class.
But i want to call the function.

Give some other idea to call function.

On Aug 28, 8:24 pm, "Roman ( T-Mobile USA)"  wrote:
> I am assuming that you want to get the activity eSkyGuide in the
> foreground, correct?
>
> In this case as ragavendran suggested, call an Intent to start up the
> new activity. Something like
>
>        Intent eSkyGuideIntent = new Intent() ;
>        eSkyGuideIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
>
>        eSkyGuideIntent.setClassName
> (".eSkyGuide",".eSkyGuide");
>
>        mContext.startActivity(eSkyGuideIntent);
>
> Make sure that you have a valid context instance. With doing this your
> new activity should be started.
>
> --
> Roman Baumgaertner
> Sr. SW Engineer-OSDC
> ·T· · ·Mobile· stick together
> The views, opinions and statements in this email are those of the
> author solely in their individual capacity, and do not necessarily
> represent those of T-Mobile USA, Inc.
>
> On Aug 28, 7:07 am, ragavendran s  wrote:
>
> > I think u may use like this ...Intent to call another .java class
> > if successs u reply to me...thanks
>
> > > weather.java
>
> > > public class Weather extends Activity implements
> > > Button.OnClickListener
> > > {
>
> > > Intent intent = new Intent(this, homepage.class);
> > > startActivity(intent);
>
> > > }
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 call another class method.

2009-08-30 Thread Sasi Kumar

I used intent to call class.
But i want to call the function.

Give some other idea to call function.

On Aug 28, 7:07 pm, ragavendran s  wrote:
> I think u may use like this ...Intent to call another .java class
> if successs u reply to me...thanks
>
>
>
> > weather.java
>
> > public class Weather extends Activity implements
> > Button.OnClickListener
> > {
>
> > Intent intent = new Intent(this, homepage.class);
> > startActivity(intent);
>
> > }
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 implement atuolink in Dialog?

2009-08-30 Thread luoqii

hi bodies!
when i want to implements a autolink func in dialog, i.e. when a
click the autolink, it will bring me the righit place: broswer, mail,
sms,and so on.
   when i do this with
   {
  ... ...
 TextView.setAutoLinkMask(Linkify.ALL);
 TextView.setMovementMethod
(LinkMovementMethod.getInstance());
 ... ...
   }

if i click the Ling this will be a error that say:

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

what's happen? or how can i finish my task?


THANKS@@@

 good day!!!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Having problem to read data from the local host server using Http Get method....

2009-08-30 Thread ragavendran s
This is a code i m having to read a data from the sever using Http Get
method

but still i cant read the values from the localhost server.


can anybody tell the correct code to replace this
thanks,


with regards,
Raghav.S


Code:


package netw.htt;

import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;


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


private StringBuffer str=null;
TextView text,text1;
 EditText edt;
 Button btn;
 String n=null;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
edt=(EditText)findViewById(R.id.edt);
text=(TextView)findViewById(R.id.text);
btn=(Button)findViewById(R.id.btn);



btn.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
text.setText("");
String st1=edt.getText().toString();
String output ="
http://localhost:8080/Serv1/servlet/Servlet1?name="+st1;
//SimpleGet.this.
//getHttpResponse(getInput.getText().toString());
try {



OpenHttpConnection1(output);

} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

if (output != null)
{
text.setText(output);
}
}
});
};





  private   StringBuffer OpenHttpConnection1(String urlString)  throws
IOException

{
InputStream in = null;
int response = -1;
int i=1;

//String inputLine;
   // StringBuffer str2 = null;

URL url = new URL(urlString);
URLConnection conn = url.openConnection();

if (!(conn instanceof HttpURLConnection))
throw new IOException("Not an HTTP connection");

try{
HttpURLConnection httpConn = (HttpURLConnection) conn;
httpConn.setAllowUserInteraction(false);
httpConn.setInstanceFollowRedirects(true);
httpConn.setRequestMethod("GET");
httpConn.connect();

response = httpConn.getResponseCode();
if (response == HttpURLConnection.HTTP_OK) {
in = httpConn.getInputStream();

 text1.setText(i);
int ch;

while((ch=in.read())!=-1)

{

str.append((char)ch);
}

//str=str2.toString();

}

}

catch (Exception ex)
{
throw new IOException("Error connecting");
}
return str;
}

}

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

2009-08-30 Thread santosh kumar

Hi,

Does TelephonyManager provides any API to get

PDP Connection status,
GPRS Attach/detach status
GPRS local IP Adress

Thanks
Santosh
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Controling a Servo Controller? For use with robotics and sensors

2009-08-30 Thread Steve Hassenplug
I'm very interested in doing this same thing.  I'd like to connect the G1 to
an I/O controller.
Looking at this page:
http://groups.google.com/group/android-platform/browse_thread/thread/439d3f3af7a88a09/10a80eb835e8dbcc?lnk=gst&q=serial&pli=1

...seems like the audio pins can also be used for serial I/O.

I believe this "Chibots Controller" has TTL level serial pins...
http://www.wrighthobbies.net/bots/ttbot/

I've not figured out, yet, exactly what needs to be done in the G1 to
control the serial port.

Please tell me if you figure anything out.

Steve


On Fri, Aug 28, 2009 at 8:32 AM, Kit  wrote:

>
>  I'm new to android and have found an interest in using an android
> powered phone to control a Pololu robotics servo controller/uart
> bridge (link to device below). I'm wondering if this is possible and
> what the best way to go about doing it would be. The device uses a usb
> port to send and receive data, it would also be valuable to be able to
> integrate the accelerometers, digital compasses and gps chips within
> the phone. For example the G1 or MyTouch seem to be likely candidates
> for the phone portion because they also incorporate a mini usb port.
> Please let me know what you think.
>
> http://www.pololu.com/catalog/product/390
>
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Who will be viewing apps during Round 1 and Round 2 of the ADC2

2009-08-30 Thread Dan Sherman
As far as I'm aware:

First round is all users across the world.  They will give ratings, and be
selected based on said ratings.  The top 200 (20 in each category) will move
on to round 2.

During round two, the same processing will happen, but Google selected
judges will rate as well, with Google Judge scores being weighted as 60%,
and user ratings weighted at 40%.

Not sure on your other two questions :)

- Dan

On Sun, Aug 30, 2009 at 8:39 PM, bkbonner  wrote:

>
> Hi Dan Morrill (et al),
>
> I have an app that we are going to submit,  my understanding is that
> our app will be reviewed by Judges during round 1 and they'll select
> the top 200.  Those applications will advance to Round2.  There is no
> chance to fix defects between Round 1 and Round 2 (so I presume if 1
> found, it won't make it to Round 2).   Whenever Round 2 begins, the
> 100 apps that advance will be released to users where they will judge
> the applications.
>
> So here are my questions:
>
> 1.  The judges for Round 1, are they only people from Google?Will
> the masses be able to SEE the application and install it during Round
> 1.
>
> 2.   I read into the selection from Round 1 to Round 2 and lack of
> opportunity to fix the bugs that Quality is of the utmost importance.
> If for some surprise reason a bug crops up and the app doesn't advance
> to Round 2, can we withdraw our application so we make improvements to
> it so other users cannot see it?
>
> 3.  Will the users for Round 2 be any user with an Android phone, or
> can they run it from the Emulator or some other mechanism?
>
> 4.  How will we be notified of our status in the contest?
>
> I'm just trying to understand the details.
>
> Brian
> >
>

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



[android-developers] Re: Activity stack: A B C -> press BACK -> go to A

2009-08-30 Thread tstanly

can possiable to verify whether B is exist or not?
if B exist,so the apps can call finish() to close B,
if not,don't call B.finish()
(will be error because B is not exist)


thanks!

On 8月31日, 上午4時11分, "Jonas Petersson"  wrote:
> fhucho wrote:
> > my activity stack is ABC, in activity C I press back, and return to B,
> > then press back again and go to A. What should I do to return to A
> > directly from C?
>
> I guess it depends on the reason for wanting to skip "B". I needed
> exactly this case yesterday and in my case "B" knows very well that it
> will not be needed when it starts up "C", so "B" simply calls finish()
> after that. Solved.
>
>                         Best / Jonas
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Who will be viewing apps during Round 1 and Round 2 of the ADC2

2009-08-30 Thread CraigsRace

http://code.google.com/android/adc/

On Aug 31, 10:39 am, bkbonner  wrote:
> Hi Dan Morrill (et al),
>
> I have an app that we are going to submit,  my understanding is that
> our app will be reviewed by Judges during round 1 and they'll select
> the top 200.  Those applications will advance to Round2.  There is no
> chance to fix defects between Round 1 and Round 2 (so I presume if 1
> found, it won't make it to Round 2).   Whenever Round 2 begins, the
> 100 apps that advance will be released to users where they will judge
> the applications.
>
> So here are my questions:
>
> 1.  The judges for Round 1, are they only people from Google?    Will
> the masses be able to SEE the application and install it during Round
> 1.
>
> 2.   I read into the selection from Round 1 to Round 2 and lack of
> opportunity to fix the bugs that Quality is of the utmost importance.
> If for some surprise reason a bug crops up and the app doesn't advance
> to Round 2, can we withdraw our application so we make improvements to
> it so other users cannot see it?
>
> 3.  Will the users for Round 2 be any user with an Android phone, or
> can they run it from the Emulator or some other mechanism?
>
> 4.  How will we be notified of our status in the contest?
>
> I'm just trying to understand the details.
>
> Brian
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Threads and Screen Orientation Change

2009-08-30 Thread CraigsRace

Dianne: Yes, using a static Handler is a solution.  Although, IMO,
it's not the most eloquent solution.  But it will work, so I should be
happy.  :)

On Aug 31, 11:19 am, Dianne Hackborn  wrote:
> And you shouldn't be doing this.  You could have a static pointing to the
> currently running activity instance (which very well may be null, which is a
> valid state, and something your thread needs to deal with anyway).  Often
> you do this by giving the thread just a Handler to communicate back with the
> main thread, which the activity implements as a static along with a static
> of the current activity instance.  So your thread posts a message to display
> a dialog, and then on the main thread you get that message and handle it on
> whichever activity instance is the current one.
>
>
>
> On Sun, Aug 30, 2009 at 4:10 PM, CraigsRace  wrote:
>
> > Mark: Sorry, I deleted my original post (very rude, I know!), as I
> > decided to just go ahead and write a solution myself (see previous
> > post).
>
> > As for starting multiple threads, yes, they will hold on to the old
> > Activities.  However, that's what happens right now, no?  In fact,
> > that's the whole problem, when the threads try to do UI, they are
> > referring to the old activities.
>
> > On Aug 31, 8:26 am, Mark Murphy  wrote:
> > > CraigsRace wrote:
> > > > I'm obviously missing something, as I thought the Thread would be the
> > > > only thing holding onto the old Activity (as it is now).  When the
> > > > Thread dies, the old activity would be garbage collected (as it does
> > > > now).  All forwarding would be done via the Activity class.
>
> > > Correct, but what Ms. Hackborn wrote was:
>
> > > >> And that still means it needs to keep the old activity around so the
> > > thread
> > > >> can use it.
>
> > > So, given that, imagine this scenario:
>
> > > -- Activity instance A starts
> > > -- You fork a background thread, holding onto A, that will run for 30
> > > seconds, as a result of a button click
> > > -- At 0:02 into the thread, the user rotates the screen
> > > -- Android creates a new activity instance (B), and has A point to B for
> > > the purposes of your call forwarding stuff
> > > -- At 0:05 into the first thread, you fork another thread, holding onto
> > > B, that will run for 30 seconds, as a result of a button click
> > > -- At 0:07 into the thread, the user rotates the screen again (bear in
> > > mind that for non-QWERTY devices, it doesn't take much to cause the
> > > screen to rotate)
> > > -- Android creates a new activity instance (C), and has B point to C for
> > > the purposes of your call forwarding stuff
>
> > > At this point, we have three total instances of the activity running (A,
> > > B, C), and we still have 23 seconds of the original 30 to work with.
> > > Factor in the possibility of developers having threads that run for 30
> > > days instead of 30 seconds.
>
> > > In your specific example, coded properly, the forwarding mechanism may
> > > work fine, if your thread is very short lived (a couple of seconds),
> > > won't get started again, and your activities are not terribly complex.
> > > It's when you start to violate those assumptions (coded improperly,
> > > lotsa threads, long threads, complex activities) that memory issues
> > > become more painful.
>
> > > --
> > > Mark Murphy (a Commons Guy)http://commonsware.com|
> >http://twitter.com/commonsguy
>
> > > Warescription: Three Android Books, Plus Updates, $35/Year
>
> --
> 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: how to use shell command in Android app

2009-08-30 Thread Dianne Hackborn
This kind of stuff isn't part of the SDK.  If you are developing a device,
you can ask these kinds of questions on android-porting.  If you are writing
an application, you should stick with the SDK.

2009/8/30 tstanly 

>
> thanks for your reply,
>
>
> so if I have a script file now,
> the script file content wants to "mount" a device or do some control
> such as open wireless connection,
> and wants app to execute script file,
>
> if it possiable?
>
>
> thanks!
>
> On 8月29日, 上午1時42分, Dianne Hackborn  wrote:
> > Keep in mind that shell commands are not part of the SDK.  These commands
> > will and do change between releases, with no predictability (for example
> > different output, etc).  And for all of the commands that are simple
> enough
> > that they are less likely to change (such as mkdir), it is much more
> > efficient to use the appropriate Java APIs to do the same thing.
> >
> >
> >
> >
> >
> > On Fri, Aug 28, 2009 at 2:54 AM, tstanly  wrote:
> >
> > > hi all,
> >
> > > I want to use command like "ls","mkdir","cd","./"..etc, in the app,
> > > somebody says use Runtime class,
> >
> > > Runtime.getRuntime().exec("ls");
> >
> > > but there is nothing happen..
> > > I also use logcat to observe, but have the same result.
> >
> > > so could app use (linux) command?
> >
> > > thanks!
> >
> > --
> > 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.- 隱藏被引用文字 -
> >
> > - 顯示被引用文字 -
> >
>


-- 
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: Touch Listener

2009-08-30 Thread Romain Guy

"Focusable in touch mode" has nothing to do with touch events or touch
listeners or padding, etc. Do not use this.

On Sun, Aug 30, 2009 at 4:03 PM, vanquisher
sinner wrote:
>
> I read that if you set isFocuasbaleInTouchMode  for the view object
> then onClickelistener is called.
> when I touch one view it works but the other one does not.
> Is there a way to increase padding of that view so that touch works on
> the view even around a larger radius?
>
>
> On Fri, Aug 28, 2009 at 12:00 PM, Balwinder Kaur (T-Mobile
> USA) wrote:
>>
>> A sample of your code and logcat output if there are errors in it
>> would be helpful.
>>
>> Balwinder Kaur
>> Open Source Development Center
>> ·T· · ·Mobile· stick together
>>
>> The views, opinions and statements in this email are those of the
>> author solely in their individual capacity, and do not necessarily
>> represent those of T-Mobile USA, Inc.
>>
>> On Aug 28, 11:39 am, human android 
>> wrote:
>>> I am trying to use touch listener on 2 View objects.
>>> I made both objects focussable but it works for one object and does
>>> not for the other.
>>> Any idea how to solve this?
>> >
>>
>
> >
>



-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

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

2009-08-30 Thread Marco Nelissen

Why not just tell your thread about the new activity?
Having the old activity keep a reference to the new activity for the
sole purpose of being able to pretend that the old activity is still
valid, even after its onDestroy has already been called, goes
completely against the Android activity model.
Also note that your old activity might simply go away, instead of
being replaced by a new activity. What does your thread do in that
case?



On Sun, Aug 30, 2009 at 4:00 PM, CraigsRace wrote:
>
> The thread is holding onto the old activity, nothing else references
> it.  When the thread dies, so does the old activity.
>
> I went ahead and wrote a solution myself by extending the Activity
> class.
>
> What I wanted to do was:
> 1. onSaveInstanceState put a reference to itself (the activity) in the
> Bundle.
> 2. onCreate retrieve the reference to the activity in the bundle (if
> it exists), then call the activity telling it about itself.  Ie: It
> tell the old activity about itself (the new activity).
> 3. Make showDialog and dismissDialog call out to the new activity (if
> it exists).
>
> There were 2 problems with this:
> 1. showDialog and dismissDialog are marked as final
> 2. Bundle doesn't allow Objects to be added to it.
>
> I worked around this by:
> 1. Creating showDialog2 and dismissDialog2 methods.
> 2. Not using the Bundle, rather a static variable (this is not a good
> solution, as it is assumes there will only be 1 activity).
>
> These workarounds mean that it is not a proper solution for all devs
> to use.
>
> However, the Android framework could easily be enhanced to do this.
>
> Cheers.
>
> PS: I was going to attach my code as reference, however, I can't see
> anywhere that I can do this.
>
>
> On Aug 31, 1:44 am, Dianne Hackborn  wrote:
>> And that still means it needs to keep the old activity around so the thread
>> can use it.
>>
>>
>>
>> On Sat, Aug 29, 2009 at 9:47 PM, CraigsRace  wrote:
>>
>> > It would only be a forward reference (from the destroyed activity to
>> > the new activity), not a back reference.
>>
>> > On Aug 30, 2:34 pm, Romain Guy  wrote:
>> > > > However, couldn't the Android framework just forward any requests from
>> > > > a destroyed activity, to the newly created Activity, saving us
>> > > > developers the pain of handling it ourselves?
>>
>> > > To do this, the framework would have to keep around references to all
>> > > previous Activities pretty much forever. Which would be a large waste
>> > > of resources.
>>
>> > > --
>> > > Romain Guy
>> > > Android framework engineer
>> > > romain...@android.com
>>
>> > > Note: please don't send private questions to me, as I don't have time
>> > > to provide private support.  All such questions should be posted on
>> > > public forums, where I and others can see and answer them
>>
>> --
>> 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: Threads and Screen Orientation Change

2009-08-30 Thread Dianne Hackborn
And you shouldn't be doing this.  You could have a static pointing to the
currently running activity instance (which very well may be null, which is a
valid state, and something your thread needs to deal with anyway).  Often
you do this by giving the thread just a Handler to communicate back with the
main thread, which the activity implements as a static along with a static
of the current activity instance.  So your thread posts a message to display
a dialog, and then on the main thread you get that message and handle it on
whichever activity instance is the current one.

On Sun, Aug 30, 2009 at 4:10 PM, CraigsRace  wrote:

>
> Mark: Sorry, I deleted my original post (very rude, I know!), as I
> decided to just go ahead and write a solution myself (see previous
> post).
>
> As for starting multiple threads, yes, they will hold on to the old
> Activities.  However, that's what happens right now, no?  In fact,
> that's the whole problem, when the threads try to do UI, they are
> referring to the old activities.
>
>
> On Aug 31, 8:26 am, Mark Murphy  wrote:
> > CraigsRace wrote:
> > > I'm obviously missing something, as I thought the Thread would be the
> > > only thing holding onto the old Activity (as it is now).  When the
> > > Thread dies, the old activity would be garbage collected (as it does
> > > now).  All forwarding would be done via the Activity class.
> >
> > Correct, but what Ms. Hackborn wrote was:
> >
> >
> >
> > >> And that still means it needs to keep the old activity around so the
> > thread
> > >> can use it.
> >
> > So, given that, imagine this scenario:
> >
> > -- Activity instance A starts
> > -- You fork a background thread, holding onto A, that will run for 30
> > seconds, as a result of a button click
> > -- At 0:02 into the thread, the user rotates the screen
> > -- Android creates a new activity instance (B), and has A point to B for
> > the purposes of your call forwarding stuff
> > -- At 0:05 into the first thread, you fork another thread, holding onto
> > B, that will run for 30 seconds, as a result of a button click
> > -- At 0:07 into the thread, the user rotates the screen again (bear in
> > mind that for non-QWERTY devices, it doesn't take much to cause the
> > screen to rotate)
> > -- Android creates a new activity instance (C), and has B point to C for
> > the purposes of your call forwarding stuff
> >
> > At this point, we have three total instances of the activity running (A,
> > B, C), and we still have 23 seconds of the original 30 to work with.
> > Factor in the possibility of developers having threads that run for 30
> > days instead of 30 seconds.
> >
> > In your specific example, coded properly, the forwarding mechanism may
> > work fine, if your thread is very short lived (a couple of seconds),
> > won't get started again, and your activities are not terribly complex.
> > It's when you start to violate those assumptions (coded improperly,
> > lotsa threads, long threads, complex activities) that memory issues
> > become more painful.
> >
> > --
> > Mark Murphy (a Commons Guy)http://commonsware.com|
> http://twitter.com/commonsguy
> >
> > Warescription: Three Android Books, Plus Updates, $35/Year
> >
>


-- 
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: Threads and Screen Orientation Change

2009-08-30 Thread CraigsRace

Dianne: Yes, using a static Handler is a solution.  Although, IMO,
it's not the more eloquent solution.

On Aug 31, 11:19 am, Dianne Hackborn  wrote:
> And you shouldn't be doing this.  You could have a static pointing to the
> currently running activity instance (which very well may be null, which is a
> valid state, and something your thread needs to deal with anyway).  Often
> you do this by giving the thread just a Handler to communicate back with the
> main thread, which the activity implements as a static along with a static
> of the current activity instance.  So your thread posts a message to display
> a dialog, and then on the main thread you get that message and handle it on
> whichever activity instance is the current one.
>
>
>
> On Sun, Aug 30, 2009 at 4:10 PM, CraigsRace  wrote:
>
> > Mark: Sorry, I deleted my original post (very rude, I know!), as I
> > decided to just go ahead and write a solution myself (see previous
> > post).
>
> > As for starting multiple threads, yes, they will hold on to the old
> > Activities.  However, that's what happens right now, no?  In fact,
> > that's the whole problem, when the threads try to do UI, they are
> > referring to the old activities.
>
> > On Aug 31, 8:26 am, Mark Murphy  wrote:
> > > CraigsRace wrote:
> > > > I'm obviously missing something, as I thought the Thread would be the
> > > > only thing holding onto the old Activity (as it is now).  When the
> > > > Thread dies, the old activity would be garbage collected (as it does
> > > > now).  All forwarding would be done via the Activity class.
>
> > > Correct, but what Ms. Hackborn wrote was:
>
> > > >> And that still means it needs to keep the old activity around so the
> > > thread
> > > >> can use it.
>
> > > So, given that, imagine this scenario:
>
> > > -- Activity instance A starts
> > > -- You fork a background thread, holding onto A, that will run for 30
> > > seconds, as a result of a button click
> > > -- At 0:02 into the thread, the user rotates the screen
> > > -- Android creates a new activity instance (B), and has A point to B for
> > > the purposes of your call forwarding stuff
> > > -- At 0:05 into the first thread, you fork another thread, holding onto
> > > B, that will run for 30 seconds, as a result of a button click
> > > -- At 0:07 into the thread, the user rotates the screen again (bear in
> > > mind that for non-QWERTY devices, it doesn't take much to cause the
> > > screen to rotate)
> > > -- Android creates a new activity instance (C), and has B point to C for
> > > the purposes of your call forwarding stuff
>
> > > At this point, we have three total instances of the activity running (A,
> > > B, C), and we still have 23 seconds of the original 30 to work with.
> > > Factor in the possibility of developers having threads that run for 30
> > > days instead of 30 seconds.
>
> > > In your specific example, coded properly, the forwarding mechanism may
> > > work fine, if your thread is very short lived (a couple of seconds),
> > > won't get started again, and your activities are not terribly complex.
> > > It's when you start to violate those assumptions (coded improperly,
> > > lotsa threads, long threads, complex activities) that memory issues
> > > become more painful.
>
> > > --
> > > Mark Murphy (a Commons Guy)http://commonsware.com|
> >http://twitter.com/commonsguy
>
> > > Warescription: Three Android Books, Plus Updates, $35/Year
>
> --
> 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: Service - Activity (simplest way)

2009-08-30 Thread Rafael Martins

OK. Thank you. I’ll use the onPause() method to advise the service to
stop calling Activity’s method.

On 30 ago, 14:18, Dianne Hackborn  wrote:
> Just follow the same code I already linked.  Once the activity binds to the
> service and gets its object, you can have whatever methods on it to call
> that you want, including things like handing it the activity.  To be very
> careful though that when the activity is destroyed all references the
> service may have to it are removed, or you will have significant leaks.
>
> On Sun, Aug 30, 2009 at 9:31 AM, Rafael Martins 
> wrote:
>
>
>
>
>
>
>
> > OK. I understand. I was planning to use the onPause() method to
> > control these problems. If it is not safe, how a service can get an
> > object of the activity class (to call Activity's methods from the
> > service)?
>
> > Thank u again, Dianne!
>
> > On 29 ago, 20:34, Dianne Hackborn  wrote:
> > > You're  much safer if you explicitly connect them together.  There are
> > many
> > > ways a static object can be cleared or not yet set (by your process being
> > > killed) when you aren't expecting it.
>
> > > On Sat, Aug 29, 2009 at 2:42 PM, Rafael Martins <
> > rafaelwmart...@gmail.com>wrote:
>
> > > > But I would like to know if there is any problem if I just call
> > > > “public static” methods between activities and services, without using
> > > > the IBinder object from the OnServiceConnected(ComponentName
> > > > className, IBinder service) method. Calling directing the methods
> > > > (“public static”) we don’t need this line from the example:
>
> > > > mBoundService = ((LocalService.LocalBinder)service).getService();
>
> > > > Do we need an object to communicate between services and activities?
> > > > If we need, how a service can get an object of the activity class (to
> > > > call activity's methods from the service)?
>
> > > > Thank u for your attention.
>
> > > > On 29 ago, 17:35, Dianne Hackborn  wrote:
> > > > > Actually, the official example in the same process doesn't use
> > binders
> > > > for
> > > > > communication at all:
>
> > > >http://developer.android.com/guide/samples/ApiDemos/src/com/example/a..
> > ..
> > > > ..
>
> > > > > I don't know what we've done to lead so many people to jump to the
> > much
> > > > more
> > > > > complicated remote service sample, but if your service and activity
> > are
> > > > in
> > > > > the same process then I strongly recommend taking advantage of that
> > like
> > > > the
> > > > > local example does.
>
> > > > > On Sat, Aug 29, 2009 at 9:04 AM, Rafael Martins <
> > > > rafaelwmart...@gmail.com>wrote:
>
> > > > > > Hi, folks!
>
> > > > > > I'm searching for the simplest way to implement a communication
> > > > > > between an activity and a service when both are running at the same
> > > > > > process.
>
> > > > > > I've already made it using binders like the official example in the
> > > > > > API Demo, but I want to call activity's methods from the service.
> > So,
> > > > > > I've made a public static method in the activity and it is working.
> > I
> > > > > > would like to understand the problems of doing this. Why we have to
> > > > > > use binders if we can do all without them? How is the simplest way
> > to
> > > > > > do this?
>
> > > > > > Sorry if this is a silly question... :-)
>
> > > > > > Thank u all!
>
> > > > > --
> > > > > 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.
>
> > > --
> > > 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.- Ocultar texto das mensagens anteriores -
>
> > > - Mostrar texto das mensagens anteriores -
>
> --
> 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] Who will be viewing apps during Round 1 and Round 2 of the ADC2

2009-08-30 Thread bkbonner

Hi Dan Morrill (et al),

I have an app that we are going to submit,  my understanding is that
our app will be reviewed by Judges during round 1 and they'll select
the top 200.  Those applications will advance to Round2.  There is no
chance to fix defects between Round 1 and Round 2 (so I presume if 1
found, it won't make it to Round 2).   Whenever Round 2 begins, the
100 apps that advance will be released to users where they will judge
the applications.

So here are my questions:

1.  The judges for Round 1, are they only people from Google?Will
the masses be able to SEE the application and install it during Round
1.

2.   I read into the selection from Round 1 to Round 2 and lack of
opportunity to fix the bugs that Quality is of the utmost importance.
If for some surprise reason a bug crops up and the app doesn't advance
to Round 2, can we withdraw our application so we make improvements to
it so other users cannot see it?

3.  Will the users for Round 2 be any user with an Android phone, or
can they run it from the Emulator or some other mechanism?

4.  How will we be notified of our status in the contest?

I'm just trying to understand the details.

Brian
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Threads and Screen Orientation Change

2009-08-30 Thread Mark Murphy

CraigsRace wrote:
> The thread is holding onto the old activity, nothing else references
> it.  When the thread dies, so does the old activity.

And if the thread does not die?

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

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] Re: Threads and Screen Orientation Change

2009-08-30 Thread CraigsRace

Romain: Agreed, my solution is bad.

I still feel like there should be a solution.  I would think a lot of
developers would want to do UI from a thread (closing a progress
dialog, etc).  And making them track if the activity has been
destroyed and recreated seems like something that the framework should
be able to handle (or at least have some sort of helper class for).

Also, the "Example ProgressDialog with a second thread" in
http://developer.android.com/guide/topics/ui/dialogs.html#ProgressDialog
is bad example, as it starts a new thread on every screen rotate, so,
devs (like me) will move the creation of the thread into the button
click, and then fall into the issue discussed here where they need to
track Activity creation/deletion (which there is no example for).


On Aug 31, 10:36 am, Romain Guy  wrote:
> No, this is not a good solution. There is no guarantee on how long the
> thread will run, which means there is no guarantee on how long the
> Activity (and everything tied to it) will survive.
>
>
>
> On Sun, Aug 30, 2009 at 4:00 PM, CraigsRace wrote:
>
> > The thread is holding onto the old activity, nothing else references
> > it.  When the thread dies, so does the old activity.
>
> > I went ahead and wrote a solution myself by extending the Activity
> > class.
>
> > What I wanted to do was:
> > 1. onSaveInstanceState put a reference to itself (the activity) in the
> > Bundle.
> > 2. onCreate retrieve the reference to the activity in the bundle (if
> > it exists), then call the activity telling it about itself.  Ie: It
> > tell the old activity about itself (the new activity).
> > 3. Make showDialog and dismissDialog call out to the new activity (if
> > it exists).
>
> > There were 2 problems with this:
> > 1. showDialog and dismissDialog are marked as final
> > 2. Bundle doesn't allow Objects to be added to it.
>
> > I worked around this by:
> > 1. Creating showDialog2 and dismissDialog2 methods.
> > 2. Not using the Bundle, rather a static variable (this is not a good
> > solution, as it is assumes there will only be 1 activity).
>
> > These workarounds mean that it is not a proper solution for all devs
> > to use.
>
> > However, the Android framework could easily be enhanced to do this.
>
> > Cheers.
>
> > PS: I was going to attach my code as reference, however, I can't see
> > anywhere that I can do this.
>
> > On Aug 31, 1:44 am, Dianne Hackborn  wrote:
> >> And that still means it needs to keep the old activity around so the thread
> >> can use it.
>
> >> On Sat, Aug 29, 2009 at 9:47 PM, CraigsRace  wrote:
>
> >> > It would only be a forward reference (from the destroyed activity to
> >> > the new activity), not a back reference.
>
> >> > On Aug 30, 2:34 pm, Romain Guy  wrote:
> >> > > > However, couldn't the Android framework just forward any requests 
> >> > > > from
> >> > > > a destroyed activity, to the newly created Activity, saving us
> >> > > > developers the pain of handling it ourselves?
>
> >> > > To do this, the framework would have to keep around references to all
> >> > > previous Activities pretty much forever. Which would be a large waste
> >> > > of resources.
>
> >> > > --
> >> > > Romain Guy
> >> > > Android framework engineer
> >> > > romain...@android.com
>
> >> > > Note: please don't send private questions to me, as I don't have time
> >> > > to provide private support.  All such questions should be posted on
> >> > > public forums, where I and others can see and answer them
>
> >> --
> >> 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.
>
> --
> Romain Guy
> Android framework engineer
> romain...@android.com
>
> Note: please don't send private questions to me, as I don't have time
> to provide private support.  All such questions should be posted on
> public forums, where I and others can see and answer them
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Map key: Overlays shown but not Map when using Generated key

2009-08-30 Thread RainBow

Ok. Thank you very Mark for your support. I was able to fix the
problem and see the maps on the release version successfully. :-)

Here is the summary how I did it:



(1) I found that the Eclipse on my laptop is not using any JDK
(eclipse->windows->prefs->installed JREs). It was pointing to JRE by
default.

(2) Downloaded and installed JDK jdk1.6.0_16

(3) Make eclipse point to above path (remove the default one that
eclipse finds and points to -- see in step 1 to access it)

(4) add path for keytool.exe and jarsigner.exe in environment
variables (should point to \jdk1.6.0_16\bin )

(5) keytool -genkey -v -alias  -keystore
.keystore -keyalg RSA -validity 30

(6)keytool -list -alias  -keystore
.keystore

(7) get finger print from google servers and modify all MapView
references in code

(8) jarsigner -verbose -keystore .keystore
.apk 

(9) If you get error like:
jarsigner: unable to sign jar: java.util.zip.ZipException: invalid
entry compressed size (expected 940 but got 949 bytes
)

Then, use  Andorid Export to get the unsigned version of apk (for
eclipse). (right click on prj name -> Andorid -> Export unsigned
apk...)

(10) Re-run command in step 8

(11) jarsigner -verify .apk


Happy (weekeend) coding !! :-)

On Aug 30, 9:46 am, Mark Murphy  wrote:
> RainBow wrote:
> > Ok, I tried it earlier than later. :-)
>
> > The jarsigner is now giving this error:
>
> > jarsigner: unable to sign jar: java.util.zip.ZipException: invalid
> > entry compressed size (expected 1603 but got 1627 bytes)
>
> > :-(
>
> This suggests that the APK you built is corrupted. You may wish to check
> out this recent thread and see if it explains what you are seeing:
>
> http://groups.google.com/group/android-beginners/browse_thread/thread...
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android 1.5 Programming 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] Re: Publishing Upgrades on Android Market ... Still Relevant?

2009-08-30 Thread Streets Of Boston

This documentation is old.

Users of Android phones with the Market installed get a notification
(in the top bar) that one or more applications have been updated by
their developer.
Then, when the user opens this notification and clicks on it, it
brings the user to the Market app showing which app(s) have been
updated.


On Aug 30, 1:28 pm, jonna  wrote:
> Could someone answer this question please?
>
> On Aug 29, 8:46 am, Jason Van Anden  wrote:
>
>
>
> > Are the docs on the Developer site regarding Publishing out of date?
> > In other words, is the Market still considered Beta and do users
> > actually need a web service to compare their versions with so they can
> > query the Market for updates?
>
> > This is what is on the Android Developer site:
>
> >http://developer.android.com/guide/publishing/publishing.html
>
> > j- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Threads and Screen Orientation Change

2009-08-30 Thread CraigsRace

Mark,Dianna: Sorry, light bulb just went on.  I think this is what
you're saying:
- Currently, the Thread will hold onto just 1 old Activity.
- With my solution, the Thread will hold onto 1 old Activity, then
that Activity will then holds onto the next old activity, and the
next, ...  So if a thread starts, then the user decided to flip the
screen 20 times, then that's 20 activities all held.

Yes, that would be a bit of a problem.


On Aug 31, 9:10 am, CraigsRace  wrote:
> Mark: Sorry, I deleted my original post (very rude, I know!), as I
> decided to just go ahead and write a solution myself (see previous
> post).
>
> As for starting multiple threads, yes, they will hold on to the old
> Activities.  However, that's what happens right now, no?  In fact,
> that's the whole problem, when the threads try to do UI, they are
> referring to the old activities.
>
> On Aug 31, 8:26 am, Mark Murphy  wrote:
>
> > CraigsRace wrote:
> > > I'm obviously missing something, as I thought the Thread would be the
> > > only thing holding onto the old Activity (as it is now).  When the
> > > Thread dies, the old activity would be garbage collected (as it does
> > > now).  All forwarding would be done via the Activity class.
>
> > Correct, but what Ms. Hackborn wrote was:
>
> > >> And that still means it needs to keep the old activity around so the
> > thread
> > >> can use it.
>
> > So, given that, imagine this scenario:
>
> > -- Activity instance A starts
> > -- You fork a background thread, holding onto A, that will run for 30
> > seconds, as a result of a button click
> > -- At 0:02 into the thread, the user rotates the screen
> > -- Android creates a new activity instance (B), and has A point to B for
> > the purposes of your call forwarding stuff
> > -- At 0:05 into the first thread, you fork another thread, holding onto
> > B, that will run for 30 seconds, as a result of a button click
> > -- At 0:07 into the thread, the user rotates the screen again (bear in
> > mind that for non-QWERTY devices, it doesn't take much to cause the
> > screen to rotate)
> > -- Android creates a new activity instance (C), and has B point to C for
> > the purposes of your call forwarding stuff
>
> > At this point, we have three total instances of the activity running (A,
> > B, C), and we still have 23 seconds of the original 30 to work with.
> > Factor in the possibility of developers having threads that run for 30
> > days instead of 30 seconds.
>
> > In your specific example, coded properly, the forwarding mechanism may
> > work fine, if your thread is very short lived (a couple of seconds),
> > won't get started again, and your activities are not terribly complex.
> > It's when you start to violate those assumptions (coded improperly,
> > lotsa threads, long threads, complex activities) that memory issues
> > become more painful.
>
> > --
> > Mark Murphy (a Commons 
> > Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> > Warescription: Three Android Books, Plus Updates, $35/Year
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 use shell command in Android app

2009-08-30 Thread tstanly

thanks for your reply,


so if I have a script file now,
the script file content wants to "mount" a device or do some control
such as open wireless connection,
and wants app to execute script file,

if it possiable?


thanks!

On 8月29日, 上午1時42分, Dianne Hackborn  wrote:
> Keep in mind that shell commands are not part of the SDK.  These commands
> will and do change between releases, with no predictability (for example
> different output, etc).  And for all of the commands that are simple enough
> that they are less likely to change (such as mkdir), it is much more
> efficient to use the appropriate Java APIs to do the same thing.
>
>
>
>
>
> On Fri, Aug 28, 2009 at 2:54 AM, tstanly  wrote:
>
> > hi all,
>
> > I want to use command like "ls","mkdir","cd","./"..etc, in the app,
> > somebody says use Runtime class,
>
> > Runtime.getRuntime().exec("ls");
>
> > but there is nothing happen..
> > I also use logcat to observe, but have the same result.
>
> > so could app use (linux) command?
>
> > thanks!
>
> --
> 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: Threads and Screen Orientation Change

2009-08-30 Thread CraigsRace

Mark: Sorry, I deleted my original post (very rude, I know!), as I
decided to just go ahead and write a solution myself (see previous
post).

As for starting multiple threads, yes, they will hold on to the old
Activities.  However, that's what happens right now, no?  In fact,
that's the whole problem, when the threads try to do UI, they are
referring to the old activities.


On Aug 31, 8:26 am, Mark Murphy  wrote:
> CraigsRace wrote:
> > I'm obviously missing something, as I thought the Thread would be the
> > only thing holding onto the old Activity (as it is now).  When the
> > Thread dies, the old activity would be garbage collected (as it does
> > now).  All forwarding would be done via the Activity class.
>
> Correct, but what Ms. Hackborn wrote was:
>
>
>
> >> And that still means it needs to keep the old activity around so the
> thread
> >> can use it.
>
> So, given that, imagine this scenario:
>
> -- Activity instance A starts
> -- You fork a background thread, holding onto A, that will run for 30
> seconds, as a result of a button click
> -- At 0:02 into the thread, the user rotates the screen
> -- Android creates a new activity instance (B), and has A point to B for
> the purposes of your call forwarding stuff
> -- At 0:05 into the first thread, you fork another thread, holding onto
> B, that will run for 30 seconds, as a result of a button click
> -- At 0:07 into the thread, the user rotates the screen again (bear in
> mind that for non-QWERTY devices, it doesn't take much to cause the
> screen to rotate)
> -- Android creates a new activity instance (C), and has B point to C for
> the purposes of your call forwarding stuff
>
> At this point, we have three total instances of the activity running (A,
> B, C), and we still have 23 seconds of the original 30 to work with.
> Factor in the possibility of developers having threads that run for 30
> days instead of 30 seconds.
>
> In your specific example, coded properly, the forwarding mechanism may
> work fine, if your thread is very short lived (a couple of seconds),
> won't get started again, and your activities are not terribly complex.
> It's when you start to violate those assumptions (coded improperly,
> lotsa threads, long threads, complex activities) that memory issues
> become more painful.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Warescription: Three Android Books, Plus Updates, $35/Year
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: onDraw issue? -- what's going on?!

2009-08-30 Thread Dianne Hackborn
On Sun, Aug 30, 2009 at 2:48 PM, Nick_Zaillian  wrote:

> Okay, actually, you can disregard that last comment.
> "Thou shalt not modify the UI from a background thread, for that is
> the way of sin" pretty explicitly gives me my answer.   I gotta say,
> this is pretty inconvenient.  Must be the reason that Electrum Drum
> Machine (the only other Android drum sequencer I've seen) doesn't give
> the user any visual indication of playback position.


Do your time critical stuff in a separate thread.  Post messages to the main
thread when there is something interesting it has changed for it to redraw.
Or if you know you will be continually drawing, have your main thread
continually running a draw loop where it draws whatever the current state is
in onDraw() (but you will probably pay the price of more CPU usage for
this).  Or if you really want to, use a surface view to have a dedicated
part of the UI that another thread can redraw outside of updates (but you
are going to need to be much more careful about threading and other issues
if you do this).

It is perfectly possible to use the framework to have a UI update while
doing background audio stuff.  Heck, the media player does this just fine,
as do many other apps.

-- 
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] Setting FilterQueryProvider on one ListView affects content of other ListView

2009-08-30 Thread eags

Ok this is very very odd.  My Activity has two list:

a) ListView with a SimpleCursorAdapter connected to a regular cursor
b) A AutoCompleteEditText with a custom CursorAdapter connected to
Contacts.Phones cursor.

On list b, I then also connect a FilterQueryProvider, and then the
content of list a is no longer displayed.  WTF???

I fooled around with this for a while and everything seems to be
working, queries on both cursors a getting the right values, etc.
And, seriously, only when uncommenting the line of code that sets the
FilterQueryProvider does the *other* list quit displaying any content.

I triple checked that I hadn't accidentally used a variable from one
list when working with the other list.  Everything looks fine.  The
filtered AutoCompleteEditText actually works perfectly in either case.

Also, I was previously using a SimpleCursorAdapter for both lists and
everything worked perfectly.  I only switched to my own custom cursor
adapter because I need to munge some text as it comes out of the DB
and I don't see that SimpleCursorAdapter allows me to do that.  The
line cursor.setFilterQueryProvider(newFilterQueryProvider... is
*exactly that same in both versions!  Is there some reuse of cursors
under the hood that I'm not aware of that could be causing this
problem??

The other thing I noticed is that when I change screen orientation,
the correct contents of the list do appear briefly on the screen
before disappearning.

Anyone??  I can post actual code if needed.

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



[android-developers] Re: Touch Listener

2009-08-30 Thread vanquisher sinner

I read that if you set isFocuasbaleInTouchMode  for the view object
then onClickelistener is called.
when I touch one view it works but the other one does not.
Is there a way to increase padding of that view so that touch works on
the view even around a larger radius?


On Fri, Aug 28, 2009 at 12:00 PM, Balwinder Kaur (T-Mobile
USA) wrote:
>
> A sample of your code and logcat output if there are errors in it
> would be helpful.
>
> Balwinder Kaur
> Open Source Development Center
> ·T· · ·Mobile· stick together
>
> The views, opinions and statements in this email are those of the
> author solely in their individual capacity, and do not necessarily
> represent those of T-Mobile USA, Inc.
>
> On Aug 28, 11:39 am, human android 
> wrote:
>> I am trying to use touch listener on 2 View objects.
>> I made both objects focussable but it works for one object and does
>> not for the other.
>> Any idea how to solve this?
> >
>

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



[android-developers] Re: Threads and Screen Orientation Change

2009-08-30 Thread Romain Guy

No, this is not a good solution. There is no guarantee on how long the
thread will run, which means there is no guarantee on how long the
Activity (and everything tied to it) will survive.

On Sun, Aug 30, 2009 at 4:00 PM, CraigsRace wrote:
>
> The thread is holding onto the old activity, nothing else references
> it.  When the thread dies, so does the old activity.
>
> I went ahead and wrote a solution myself by extending the Activity
> class.
>
> What I wanted to do was:
> 1. onSaveInstanceState put a reference to itself (the activity) in the
> Bundle.
> 2. onCreate retrieve the reference to the activity in the bundle (if
> it exists), then call the activity telling it about itself.  Ie: It
> tell the old activity about itself (the new activity).
> 3. Make showDialog and dismissDialog call out to the new activity (if
> it exists).
>
> There were 2 problems with this:
> 1. showDialog and dismissDialog are marked as final
> 2. Bundle doesn't allow Objects to be added to it.
>
> I worked around this by:
> 1. Creating showDialog2 and dismissDialog2 methods.
> 2. Not using the Bundle, rather a static variable (this is not a good
> solution, as it is assumes there will only be 1 activity).
>
> These workarounds mean that it is not a proper solution for all devs
> to use.
>
> However, the Android framework could easily be enhanced to do this.
>
> Cheers.
>
> PS: I was going to attach my code as reference, however, I can't see
> anywhere that I can do this.
>
>
> On Aug 31, 1:44 am, Dianne Hackborn  wrote:
>> And that still means it needs to keep the old activity around so the thread
>> can use it.
>>
>>
>>
>> On Sat, Aug 29, 2009 at 9:47 PM, CraigsRace  wrote:
>>
>> > It would only be a forward reference (from the destroyed activity to
>> > the new activity), not a back reference.
>>
>> > On Aug 30, 2:34 pm, Romain Guy  wrote:
>> > > > However, couldn't the Android framework just forward any requests from
>> > > > a destroyed activity, to the newly created Activity, saving us
>> > > > developers the pain of handling it ourselves?
>>
>> > > To do this, the framework would have to keep around references to all
>> > > previous Activities pretty much forever. Which would be a large waste
>> > > of resources.
>>
>> > > --
>> > > Romain Guy
>> > > Android framework engineer
>> > > romain...@android.com
>>
>> > > Note: please don't send private questions to me, as I don't have time
>> > > to provide private support.  All such questions should be posted on
>> > > public forums, where I and others can see and answer them
>>
>> --
>> 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.
> >
>



-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

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

2009-08-30 Thread Joe

We have tried to use the LocationManager.getBestProvider.

But trying to be smart, we would like to use better Provider if one
becomes available, but it seems there isn't a existing way to tell
whether a new Provider is better.  Of course, we/each developer could
develop a Comparator for this purpose, but it seems appropriate to
have a default Comparator since we do provide a getBestProvider which
indicates that API does have its criteria about which one is better.
Don't you agree?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Setting FilterQueryProvider on one ListView affects content of other ListView

2009-08-30 Thread eags

Crap, I should have quadruple checked.  I was actually accidentally
using the cursor from the first list in the constructor for the second
adapter.

Sorry.  Nevermind.

On Aug 30, 4:53 pm, eags  wrote:
> Ok this is very very odd.  My Activity has two list:
>
> a) ListView with a SimpleCursorAdapter connected to a regular cursor
> b) A AutoCompleteEditText with a custom CursorAdapter connected to
> Contacts.Phones cursor.
>
> On list b, I then also connect a FilterQueryProvider, and then the
> content of list a is no longer displayed.  WTF???
>
> I fooled around with this for a while and everything seems to be
> working, queries on both cursors a getting the right values, etc.
> And, seriously, only when uncommenting the line of code that sets the
> FilterQueryProvider does the *other* list quit displaying any content.
>
> I triple checked that I hadn't accidentally used a variable from one
> list when working with the other list.  Everything looks fine.  The
> filtered AutoCompleteEditText actually works perfectly in either case.
>
> Also, I was previously using a SimpleCursorAdapter for both lists and
> everything worked perfectly.  I only switched to my own custom cursor
> adapter because I need to munge some text as it comes out of the DB
> and I don't see that SimpleCursorAdapter allows me to do that.  The
> line cursor.setFilterQueryProvider(newFilterQueryProvider... is
> *exactly that same in both versions!  Is there some reuse of cursors
> under the hood that I'm not aware of that could be causing this
> problem??
>
> The other thing I noticed is that when I change screen orientation,
> the correct contents of the list do appear briefly on the screen
> before disappearning.
>
> Anyone??  I can post actual code if needed.
>
> Thanks in advance for any help.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: ADB Emulator not loading

2009-08-30 Thread remwebdevelopment

I'm getting the same errors when I launch the emulator, even when I
disable my firewall. I've searched all over the internet for any
clues.  I've tried deleting and re-creating my avds, and launching the
emulator with the -wipe-data flag.  Nothing has worked.

On Aug 22, 6:34 pm, Jeff  wrote:
> I figured out that the cause of the problem is my ZoneAlarm firewall.
> Turning off the firewall enables the emulator to start up without any
> issues.
>
> Any ideas on what I need to enable in the firewall to allow the ADB
> emulator to work correctly?
>
> On Aug 18, 9:34 pm, Jeff  wrote:
>
> > I can't get theemulatorto load when running programs from Eclipse
> > 3.4.2.
>
> > Please take a look at the log from the DDMS that I pasted below and
> > see if anything can be determined from that.
>
> > 08-19 03:18:20.135: INFO/DEBUG(539): debuggerd: May 14 2009 17:33:50
> > 08-19 03:18:20.375: INFO/vold(538): Android Volume Daemon version 2.0
> > 08-19 03:18:20.676: ERROR/flash_image(544): can't find recovery
> > partition
> > 08-19 03:18:20.864: ERROR/vold(538): Error opening switch name path '/
> > sys/class/switch/test2' (No such file or directory)
> > 08-19 03:18:20.864: ERROR/vold(538): Error bootstrapping switch '/sys/
> > class/switch/test2' (m)
> > 08-19 03:18:20.904: DEBUG/qemud(546): entering main loop
> > 08-19 03:18:20.914: ERROR/vold(538): Error opening switch name path '/
> > sys/class/switch/test' (No such file or directory)
> > 08-19 03:18:20.914: ERROR/vold(538): Error bootstrapping switch '/sys/
> > class/switch/test' (m)
> > 08-19 03:18:20.914: DEBUG/vold(538): Bootstrapping complete
> > 08-19 03:18:22.334: DEBUG/qemud(546): fdhandler_accept_event:
> > accepting on fd 10
> > 08-19 03:18:22.356: DEBUG/qemud(546): created client 0xe078 listening
> > on fd 8
> > 08-19 03:18:22.356: DEBUG/qemud(546): fdhandler_event: disconnect on
> > fd 8
> > 08-19 03:18:22.564: DEBUG/qemud(546): fdhandler_accept_event:
> > accepting on fd 10
> > 08-19 03:18:22.564: DEBUG/qemud(546): created client 0xf028 listening
> > on fd 8
> > 08-19 03:18:22.564: DEBUG/qemud(546): client_fd_receive: attempting
> > registration for service 'gsm'
> > 08-19 03:18:22.575: DEBUG/qemud(546): client_fd_receive:    ->
> > received channel id 1
> > 08-19 03:18:22.584: DEBUG/qemud(546): client_registration:
> > registration succeeded for client 1
> > 08-19 03:18:27.085: DEBUG/AndroidRuntime(541): >>
> > AndroidRuntime START <<
> > 08-19 03:18:27.105: DEBUG/AndroidRuntime(541): CheckJNI is ON
> > 08-19 03:18:29.908: INFO/(542): ServiceManager: 0xac38
> > 08-19 03:18:29.955: INFO/AudioFlinger(542): AudioFlinger's thread
> > ready to run for output 0
> > 08-19 03:18:30.085: INFO/CameraService(542): CameraService started:
> > pid=542
> > 08-19 03:18:30.895: DEBUG/AndroidRuntime(541): --- registering native
> > functions ---
> > 08-19 03:18:33.586: INFO/Zygote(541): Preloading classes...
> > 08-19 03:18:33.676: DEBUG/dalvikvm(541): GC freed 764 objects / 42216
> > bytes in 81ms
> > 08-19 03:18:35.186: DEBUG/dalvikvm(541): GC freed 278 objects / 17160
> > bytes in 36ms
> > 08-19 03:18:36.654: DEBUG/dalvikvm(541): GC freed 208 objects / 12696
> > bytes in 46ms
> > 08-19 03:18:37.377: DEBUG/dalvikvm(541): Trying to load lib /system/
> > lib/libmedia_jni.so 0x0
> > 08-19 03:18:38.405: DEBUG/dalvikvm(541): Added shared lib /system/lib/
> > libmedia_jni.so 0x0
> > 08-19 03:18:38.427: DEBUG/dalvikvm(541): Trying to load lib /system/
> > lib/libmedia_jni.so 0x0
> > 08-19 03:18:38.427: DEBUG/dalvikvm(541): Shared lib '/system/lib/
> > libmedia_jni.so' already loaded in same CL 0x0
> > 08-19 03:18:38.435: DEBUG/dalvikvm(541): Trying to load lib /system/
> > lib/libmedia_jni.so 0x0
> > 08-19 03:18:38.435: DEBUG/dalvikvm(541): Shared lib '/system/lib/
> > libmedia_jni.so' already loaded in same CL 0x0
> > 08-19 03:18:38.475: DEBUG/dalvikvm(541): Trying to load lib /system/
> > lib/libmedia_jni.so 0x0
> > 08-19 03:18:38.475: DEBUG/dalvikvm(541): Shared lib '/system/lib/
> > libmedia_jni.so' already loaded in same CL 0x0
> > 08-19 03:18:38.548: DEBUG/dalvikvm(541): GC freed 462 objects / 29144
> > bytes in 57ms
> > 08-19 03:18:41.994: DEBUG/dalvikvm(541): GC freed 3584 objects /
> > 171648 bytes in 126ms
> > 08-19 03:18:54.144: DEBUG/dalvikvm(541): GC freed 11329 objects /
> > 400856 bytes in 196ms
> > 08-19 03:18:58.646: DEBUG/dalvikvm(541): GC freed 10472 objects /
> > 438272 bytes in 229ms
> > 08-19 03:19:01.874: DEBUG/dalvikvm(541): GC freed 10975 objects /
> > 459800 bytes in 231ms
> > 08-19 03:19:11.775: DEBUG/dalvikvm(541): GC freed 14372 objects /
> > 506896 bytes in 277ms
> > 08-19 03:19:15.056: DEBUG/dalvikvm(541): GC freed 11314 objects /
> > 481360 bytes in 265ms
> > 08-19 03:19:16.955: DEBUG/dalvikvm(541): GC freed 5928 objects /
> > 248640 bytes in 218ms
> > 08-19 03:19:18.655: DEBUG/dalvikvm(541): GC freed 349 objects / 37032
> > bytes in 189ms
> > 08-19 03:19:20.215: DEBUG/dalvikvm(541): GC freed 778 objects / 48408
> > by

[android-developers] Re: Threads and Screen Orientation Change

2009-08-30 Thread CraigsRace

The thread is holding onto the old activity, nothing else references
it.  When the thread dies, so does the old activity.

I went ahead and wrote a solution myself by extending the Activity
class.

What I wanted to do was:
1. onSaveInstanceState put a reference to itself (the activity) in the
Bundle.
2. onCreate retrieve the reference to the activity in the bundle (if
it exists), then call the activity telling it about itself.  Ie: It
tell the old activity about itself (the new activity).
3. Make showDialog and dismissDialog call out to the new activity (if
it exists).

There were 2 problems with this:
1. showDialog and dismissDialog are marked as final
2. Bundle doesn't allow Objects to be added to it.

I worked around this by:
1. Creating showDialog2 and dismissDialog2 methods.
2. Not using the Bundle, rather a static variable (this is not a good
solution, as it is assumes there will only be 1 activity).

These workarounds mean that it is not a proper solution for all devs
to use.

However, the Android framework could easily be enhanced to do this.

Cheers.

PS: I was going to attach my code as reference, however, I can't see
anywhere that I can do this.


On Aug 31, 1:44 am, Dianne Hackborn  wrote:
> And that still means it needs to keep the old activity around so the thread
> can use it.
>
>
>
> On Sat, Aug 29, 2009 at 9:47 PM, CraigsRace  wrote:
>
> > It would only be a forward reference (from the destroyed activity to
> > the new activity), not a back reference.
>
> > On Aug 30, 2:34 pm, Romain Guy  wrote:
> > > > However, couldn't the Android framework just forward any requests from
> > > > a destroyed activity, to the newly created Activity, saving us
> > > > developers the pain of handling it ourselves?
>
> > > To do this, the framework would have to keep around references to all
> > > previous Activities pretty much forever. Which would be a large waste
> > > of resources.
>
> > > --
> > > Romain Guy
> > > Android framework engineer
> > > romain...@android.com
>
> > > Note: please don't send private questions to me, as I don't have time
> > > to provide private support.  All such questions should be posted on
> > > public forums, where I and others can see and answer them
>
> --
> 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] Error msgs in LogCat on startup

2009-08-30 Thread bkbonner

I'm seeing messages that I've never seen before in LogCat in the
Emulator.  Are these anything to concern myself with:

08-30 22:42:43.442: ERROR/vold(550): Error opening switch name path '/
sys/class/switch/test2' (No such file or directory)
08-30 22:42:43.442: ERROR/vold(550): Error bootstrapping switch '/sys/
class/switch/test2' (m)
08-30 22:42:43.442: ERROR/vold(550): Error opening switch name path '/
sys/class/switch/test' (No such file or directory)
08-30 22:42:43.442: ERROR/vold(550): Error bootstrapping switch '/sys/
class/switch/test' (m)
08-30 22:42:43.461: ERROR/flash_image(556): can't find recovery
partition
08-30 22:43:44.260: ERROR/MemoryHeapBase(608): error opening /dev/
pmem: No such file or directory
08-30 22:43:44.281: ERROR/SurfaceFlinger(608): Couldn't open /sys/
power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake
08-30 22:43:44.370: ERROR/GLLogger(608): couldn't load 
library (Cannot find library)
08-30 22:43:44.561: ERROR/GLLogger(608): couldn't load 
library (Cannot find library)
08-30 22:45:02.841: ERROR/BatteryService(608): Could not open '/sys/
class/power_supply/usb/online'
08-30 22:45:02.853: ERROR/BatteryService(608): Could not open '/sys/
class/power_supply/battery/batt_vol'
08-30 22:45:02.861: ERROR/BatteryService(608): Could not open '/sys/
class/power_supply/battery/batt_temp'
08-30 22:45:04.540: ERROR/EventHub(608): could not get driver version
for /dev/input/mouse0, Not a typewriter
08-30 22:45:04.580: ERROR/EventHub(608): could not get driver version
for /dev/input/mice, Not a typewriter
08-30 22:45:04.940: ERROR/System(608): Failure starting core service
08-30 22:45:04.940: ERROR/System(608): java.lang.SecurityException
08-30 22:45:04.940: ERROR/System(608): at
android.os.BinderProxy.transact(Native Method)
08-30 22:45:04.940: ERROR/System(608): at
android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:
146)
08-30 22:45:04.940: ERROR/System(608): at
android.os.ServiceManager.addService(ServiceManager.java:72)
08-30 22:45:04.940: ERROR/System(608): at
com.android.server.ServerThread.run(SystemServer.java:163)
08-30 22:45:04.961: ERROR/AndroidRuntime(608): Crash logging skipped,
no checkin service
08-30 22:45:16.581: ERROR/ApplicationContext(608): Couldn't create
directory for SharedPreferences file shared_prefs/wallpaper-hints.xml

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

2009-08-30 Thread Mark Murphy

CraigsRace wrote:
> I'm obviously missing something, as I thought the Thread would be the
> only thing holding onto the old Activity (as it is now).  When the
> Thread dies, the old activity would be garbage collected (as it does
> now).  All forwarding would be done via the Activity class.

Correct, but what Ms. Hackborn wrote was:

>> And that still means it needs to keep the old activity around so the
thread
>> can use it.

So, given that, imagine this scenario:

-- Activity instance A starts
-- You fork a background thread, holding onto A, that will run for 30
seconds, as a result of a button click
-- At 0:02 into the thread, the user rotates the screen
-- Android creates a new activity instance (B), and has A point to B for
the purposes of your call forwarding stuff
-- At 0:05 into the first thread, you fork another thread, holding onto
B, that will run for 30 seconds, as a result of a button click
-- At 0:07 into the thread, the user rotates the screen again (bear in
mind that for non-QWERTY devices, it doesn't take much to cause the
screen to rotate)
-- Android creates a new activity instance (C), and has B point to C for
the purposes of your call forwarding stuff

At this point, we have three total instances of the activity running (A,
B, C), and we still have 23 seconds of the original 30 to work with.
Factor in the possibility of developers having threads that run for 30
days instead of 30 seconds.

In your specific example, coded properly, the forwarding mechanism may
work fine, if your thread is very short lived (a couple of seconds),
won't get started again, and your activities are not terribly complex.
It's when you start to violate those assumptions (coded improperly,
lotsa threads, long threads, complex activities) that memory issues
become more painful.

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

Warescription: Three Android Books, Plus Updates, $35/Year

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 it possible to extend resources xml with custom views?

2009-08-30 Thread Mark Murphy

Daber wrote:
> Does anybody knows if (and how ) I can write a custom view/widget and
> then use it in resources in layout defintions?

In terms of "if", yes, it is very doable.

In terms of "how", I suspect there is at least one of the API demos on
the subject, though I can't remember which one off the top of my head.

Here's one blog post series I found in a Google Search:

http://whyandroid.com/android/tutorial/43-tutorial/93-android-tutorial-41-image-and-text-only-buttons.html

(there's a few more posts in the series)

and this:

http://www.curious-creature.org/2009/03/01/android-layout-tricks-3-optimize-part-1/

(doesn't discuss techniques, but the one example project has a custom
widget)

It's covered in some of the Android books, including (*cough*) two of mine.

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

Warescription: Three Android Books, Plus Updates, $35/Year

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 show a Progress dialog in AsyncTask?

2009-08-30 Thread WoodManEXP

Hi Juan,

This is pretty easy to do.

One way is to implement a class in your UI class that extends
AsyncTask. Then you can instantiate the ProgressDialog class (which
you may want to extend for various reasons) in the constructor. In the
doInBackground method call publishProgress which will call across the
thread boundary to onProgressUpdate (for which your sub class provides
an implementation). onProgressUpdate  interacts directly with the
ProgressDialog (if you tried to do that from doInBackground  it will
throw an exception).

By subclassing ProgressDialog you can arrange to change the text and
style of the progress bar (determinate/imdeterminate) and other
characteristics as you want to show progress.

You can pass all kinds of useful progress information through
publishProgress which onProgressUpdate can interpret.

Another neat trick is to implement a Toast in onPostExecute showing
the result of the async operation, if that would be useful to the user
(like maybe success or failure).

Hope this helps.

On Aug 30, 1:58 am, "Juan David Trujillo C." 
wrote:
> Hi all!
>
> I am creating an app that show a Progress dialog in AsyncTask to
> inform the user while web information is being fetched.  I've read
> there are two ways of doing this: Using handlers or creating and
> executing an inner class that overrides the AsyncTask class
>
> I am trying to create and executing inner class that overrides the
> AsyncTask class, which runs a resource-intensive thread in the
> background, to provide progress updates, and reports back when
> finished.
>
> On the OnCreate, I have:
> protected Dialog onCreateDialog(int id) {
>      return ProgressDialog.show(ListSituation.this, "", "Loading.
> Please wait...", true);
>
> }
>
> throws the following error:
> android.util.AndroidRuntimeException: requestFeature() must be called
> before adding content
>
> On the other hand, if I do it this way:
> protected Dialog onCreateDialog(int id) {
>     return progressDialog();
>
> }
>
> public Dialog progressDialog(){
>     Log.d("Tifersons", "Entra a
> progressDialog..");
>     ProgressDialog dialog = new ProgressDialog(this);
>     dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
>     dialog.setMessage("Loading...");
>     dialog.setIndeterminate(true);
>     dialog.setCancelable(false);
>     return dialog;
>
> }
>
> No dialog gets shown.
>
> This is being done inside an activity included in a Tab.  When I
> switch to another Activity in the tab, the progressDialog gets shown.
>
> Thanks for your help,
>
> Best regards,
>
> Juan.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 it possible to extend resources xml with custom views?

2009-08-30 Thread Romain Guy

Yes you can, there are examples in the SDK (ApiDemos, Home.)

On Sun, Aug 30, 2009 at 1:51 PM, Daber wrote:
>
> Does anybody knows if (and how ) I can write a custom view/widget and
> then use it in resources in layout defintions?
>
>
>
> All the best,
> Michał Dąbrowski
>
> >
>



-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: ADC 2 Submission Site -- Now live

2009-08-30 Thread Fallen Leaf

Change the package (i.e. add .adc ). What you made doesn't work
because there are people that have downloaded your app even if now
it's not in the market so Google doesn't allow to publish several apps
with the same package.

On 30 ago, 18:06, Omer Saatcioglu  wrote:
> Hello Android Team,
>
> I had uploaded my app Instant Lyrics after 1st August and it is now in
> the market. That's why, when I try to upload my app to ADC 2 it says
> that "You have another application on Android Market or ADC with the
> same package name (com.saatcioglu.android.instantlyrics). Go to that
> other application, and click upgrade."
>
> I unpublished the app from Market but still I have the same error.
> What should I do?
>
> Thank you,
> Omer
>
> On Aug 27, 8:23 pm, Dan Morrill  wrote:
>
> > We are not planning to extend the submission deadline.
> > - Dan
>
> > On Tue, Aug 25, 2009 at 2:22 PM, patrick  wrote:
>
> > > Hi,
>
> > > i'm asking wher can we ask google to extend the deadline?
>
> > > thks
>
> > > On 25 août, 17:05, Dan Sherman  wrote:
> > > > There's no reason that they would change the deadline.  The deadline has
> > > > been set at the 31st since late May (as stated before).  With that
> > > deadline
> > > > posted, your app should be ready to hit the submit button on the 31st or
> > > > sooner.  Nothing changed, they're giving you a full week to hit the
> > > "Submit"
> > > > button.
>
> > > > - Dan
>
> > > > On Tue, Aug 25, 2009 at 12:06 PM, Maps.Huge.Info (Maps API Guru) <
>
> > > > cor...@gmail.com> wrote:
>
> > > > > I see no need to extend the deadline, it's been public since May 27th,
> > > > > if you're not ready by now, you'll probably never be ready. People
> > > > > have to learn that a deadline means something, extending it would only
> > > > > punish those who are ready and reward those who can't meet project
> > > > > goals on time.
>
> > > > > -John Coryat
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Threads and Screen Orientation Change

2009-08-30 Thread CraigsRace

I'm obviously missing something, as I thought the Thread would be the
only thing holding onto the old Activity (as it is now).  When the
Thread dies, the old activity would be garbage collected (as it does
now).  All forwarding would be done via the Activity class.

I tried to extend Activity to write it myself, however, methods like
showDialog and dismissDialog are marked as final, and I couldn't pass
the old Activity into the Bundle on the onSaveInstanceState as Bundle
doesn't allow attaching of objects.


On Aug 31, 1:44 am, Dianne Hackborn  wrote:
> And that still means it needs to keep the old activity around so the thread
> can use it.
>
>
>
> On Sat, Aug 29, 2009 at 9:47 PM, CraigsRace  wrote:
>
> > It would only be a forward reference (from the destroyed activity to
> > the new activity), not a back reference.
>
> > On Aug 30, 2:34 pm, Romain Guy  wrote:
> > > > However, couldn't the Android framework just forward any requests from
> > > > a destroyed activity, to the newly created Activity, saving us
> > > > developers the pain of handling it ourselves?
>
> > > To do this, the framework would have to keep around references to all
> > > previous Activities pretty much forever. Which would be a large waste
> > > of resources.
>
> > > --
> > > Romain Guy
> > > Android framework engineer
> > > romain...@android.com
>
> > > Note: please don't send private questions to me, as I don't have time
> > > to provide private support.  All such questions should be posted on
> > > public forums, where I and others can see and answer them
>
> --
> 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] Setting internal storage in the AVD

2009-08-30 Thread WoodManEXP

Does anyone know how to set internal storage in the AVD to something
other than the default 92M?

I have tried setting hw.ramSize in the AVD's .config file, but no
change and also tried setting it when creating a AVD with the "android
create" command. Same net resut.

I'm on Windows XP.

Thanks in advance for any help!

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



[android-developers] Is it possible to extend resources xml with custom views?

2009-08-30 Thread Daber

Does anybody knows if (and how ) I can write a custom view/widget and
then use it in resources in layout defintions?



All the best,
Michał Dąbrowski

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: onDraw issue? -- what's going on?!

2009-08-30 Thread Mark Murphy

Nick_Zaillian wrote:
> Now, Mark, I have written an
> audio pattern playback implementation using a Handler that runs in my
> main Activity and, while it works, it is way less smooth and reliable
> than the implementation using the Timer/separate thread. 

That's not surprising. Depending on what else is going on, there may be
other messages in the message queue that the UI thread is working on, so
there may be a delay before your code gets to run.

> I tried to
> wade through the docs for AsyncTask and I could not tell whether or
> not it would allow me to update the UI from my separate Timer thread.

I listed that for completeness, but if you are trying to stick with
Timer, it's not really going to help.

> do I just have to choose between having smooth audio
> playback in a separate thread but no visual feedback and having less
> reliable audio playback in my UI thread with visual feedback?

I'd go for "smooth audio playback in a separate thread with slightly
delayed visual feedback in the UI thread" (i.e., your TimerTask does the
audio and invokes the View#post() for the UI update), but that's just
me, and I don't know your app.

If you want "smooth audio playback and simultaneous visual feedback", I
suspect the widget framework isn't the answer, and you'll need to roll
your own UI as if this were a game, using those sorts of techniques.

>From your follow-up post:

> "Thou shalt not modify the UI from a background thread, for that is
> the way of sin" pretty explicitly gives me my answer.

No. "Explicit" would have been if I had described what happens to
sinners. ;-)

> I gotta say, this is pretty inconvenient.

The widget framework isn't designed for your scenario, any more than it
is designed for 3D rendering. There are other tools for that.

> Must be the reason that Electrum Drum
> Machine (the only other Android drum sequencer I've seen) doesn't give
> the user any visual indication of playback position.

That's possible.

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

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] Re: onDraw issue? -- what's going on?!

2009-08-30 Thread Nick_Zaillian

Okay, actually, you can disregard that last comment.
"Thou shalt not modify the UI from a background thread, for that is
the way of sin" pretty explicitly gives me my answer.   I gotta say,
this is pretty inconvenient.  Must be the reason that Electrum Drum
Machine (the only other Android drum sequencer I've seen) doesn't give
the user any visual indication of playback position.
Thanks all the same, though
-Nick Zaillian

On Aug 30, 5:39 pm, Nick_Zaillian  wrote:
> Alright, I have made the appropriate changes to my SeqSwitch class so
> that I no longer call setBackgroundResource from my onDraw (and in
> fact no longer override onDraw at all).  Now, Mark, I have written an
> audio pattern playback implementation using a Handler that runs in my
> main Activity and, while it works, it is way less smooth and reliable
> than the implementation using the Timer/separate thread.  I tried to
> wade through the docs for AsyncTask and I could not tell whether or
> not it would allow me to update the UI from my separate Timer thread.
> Will it, or do I just have to choose between having smooth audio
> playback in a separate thread but no visual feedback and having less
> reliable audio playback in my UI thread with visual feedback?
> Thanks again,
> Nick Zaillian
>
> On Aug 30, 4:13 pm, Romain Guy  wrote:
>
> > You should call setBackgroundResource() but NOT from onDraw(). Just
> > call this method from setIlluminated() for instance.
>
> > On Sun, Aug 30, 2009 at 1:06 PM, Nick_Zaillian wrote:
>
> > > Mark and Romain,
> > > Thanks.  That was a much prompter response than I either expected or
> > > deserved.
> > > Romain, I am not sure that I totally understand what you've said.  How
> > > am I to set the background in accordance with the state of isChecked
> > > and isIlluminated from within onDraw if not by calling
> > > setBackgroundResource()?  I guess this post probably belongs in the
> > > Android Beginner's group.
> > > Thanks,
> > > Nick Zaillian
>
> > > On Aug 30, 2:59 pm, Romain Guy  wrote:
> > >> Do not call setBacgroundResource() in onDraw()! You are loading and
> > >> setting an image every time your view is drawn. You are actually
> > >> creating a infinite "loop";
>
> > >> onDraw() -> setBacgroundResource() -> invalidate() -> onDraw() ->
> > >> setBacgroundResource() -> etc.
>
> > >> On Sun, Aug 30, 2009 at 11:47 AM, Nick_Zaillian 
> > >> wrote:
>
> > >> > Hey all,
> > >> > I am writing an app that emulates a drum machine with a step
> > >> > sequencer.  For those unfamiliar with step sequencers, a step
> > >> > sequencer is basically a set of switches where the state of each
> > >> > switch indicates whether or not a sound is to be played at a
> > >> > particular point in a pattern.  I've already got audio playback
> > >> > working using SoundPool and can play patterns (represented as objects
> > >> > containing boolean arrays mapped to audio resources) by stepping
> > >> > through these patterns using a timer.  What I am trying and struggling
> > >> > to do at present is to write my UI.  I have subclassed ToggleSwitch
> > >> > and made a custom switch called SeqSwitch which, in addition to
> > >> > ToggleSwitch's isChecked field, also holds an isIlluminated field.
> > >> > I've written another class called SwitchController that takes an array
> > >> > of these switches and has a method (which I've called runSwitches)
> > >> > that, with each call, advances one switch, illuminates the current
> > >> > switch, and unilluminates the previous switch (the idea is that, when
> > >> > the user plays his pattern, the button representing the current step
> > >> > will illuminate, letting him know the current position of playback in
> > >> > the sequence).  The SeqSwitches seem to render and behave fine in
> > >> > response to clicks.  My SwitchController.runSwitches method also works
> > >> > so long as I place it in a click handler of a button in my main
> > >> > Activity.  When, however, I pass it into the runnable (called
> > >> > PatternPlayTask) that I give to my Timer (which then calls
> > >> > SwitchController.runSwitches every 300 milliseconds as it steps
> > >> > through the pattern), it stops working.  I have used the debugger to
> > >> > make sure that the object I am passing into the runnable is the same
> > >> > as the one for which the call to SwitchController.runSwitches was
> > >> > working in the main activity and have found that definitely it is.
> > >> > Does anybody have any idea what's going on here.  Hopefully I am just
> > >> > doing something totally stupid, here.  I've pasted the code for my
> > >> > ToggleButton subclass below, if that helps:
>
> > >> > package com.drummachine;
> > >> > import android.widget.*;
> > >> > import android.view.*;
> > >> > import android.content.Context;
> > >> > import com.drummachine.Instrument;
> > >> > import android.util.*;
> > >> > import android.content.res.TypedArray;
> > >> > import android.graphics.Canvas;
> > >> > import android.graphics.Paint;
>

[android-developers] Re: EMMA Code coverage and JUnit

2009-08-30 Thread Brett Chabot

On Thu, Aug 27, 2009 at 7:53 PM, duykham wrote:
> Hi guys,
>
> Many thanks for your supports, it's now working with automatic test.
> (adb shell am instrument ...) :) But, I have some questions that,
>
> 1. Is there a way to get EMMA code coverage with manual test?  I mean,
> we can test android by ourselves and after that, get the coverage
> report for what we've done.

No, sorry there isn't. There's a lot of complexities because there are
multiple processes involved, and when doing manual testing you
wouldn't have control over when these processes start/stop and how to
generate a coverage report. IMHO the data you would get from such an
exercise might be of dubious value anyway, code coverage metrics are
most relevant for white box testing techniques.

>
> 2. And, another question about packages that have static library. Does
> any one successfully got the coverage of Browser app? And, as Brett
> said, we must "make the static
> library first with emma instrument on
>
> export EMMA_INSTRUMENT = true
> make 
> mmm  "
>
> But, do you know the name of static library for Browser app? I tried
> with com.android.dx.cf.code.SimException , but it seems not right!
>

Take a look at Browser's Android.mk file. You'll see the following line:

LOCAL_STATIC_JAVA_LIBRARIES := google-framework

so try doing:
export EMMA_INSTRUMENT = true
make google-framework
mmm packages/apps/Browser

> Any helps will be appreciated.
>
> Thank you very much!
>
> Duykham.
>
> On Aug 23, 9:58 pm, Maya  wrote:
>> hey Gabor,
>> thanks a lot for your help.
>> Actually i tried reproducing the same steps, it is working fine till
>> emulator starts, it launches emulator but it does not shows the home
>> screen
>> i tried steps after that, doing adb remount and adb sync, it pushes
>> all the neccessay files into the emulator, but emulator is still in
>> sleep state, just the first screen saying Android.. keeps up, does not
>> boot after that.
>> Then i tries running test cases using 'am' command no tests run and no
>> coverage file got generated.
>> Can  you tell me whats the problem in this.(all the bulding process wa
>> successfully passed with no errors)
>>
>> Thanks,
>> Mayank
>>
>> On Aug 20, 6:08 pm, Gabor  wrote:
>>
>> > Hi All,
>>
>> > Finally, the emma code coverage measurement is working for me (for a
>> > custom project). So here are the steps what you need to make it work
>> > (I have tested it, with Java 1.5 on Ubuntu 8.04):
>>
>> > mkdir android-src
>> > cd android-src
>> > repo init -u git://android.git.kernel.org/platform/manifest.git -b
>> > cupcake
>> > repo sync
>>
>> > # Add emma.jar to the system/core/rootdir/init.rc
>> > sed 's/\/system\/framework\/core.jar:\/system\/framework\/ext.jar:/\/
>> > system\/framework\/core.jar:\/system\/framework\/ext.jar:\/system\/
>> > framework\/emma.jar:/' system/core/rootdir/init.rc > system/core/
>> > rootdir/init.rc.tmp
>> > mv system/core/rootdir/init.rc.tmp system/core/rootdir/init.rc
>>
>> > # Rebuild the boot image
>> > make bootimage
>>
>> > # To build the full system image
>> > make -j4
>>
>> > # Set the PATH:
>> > export PATH=${PATH}:/<_path_>/android-src/out/host/linux-x86/bin/
>>
>> > # Build the emma jar itself
>> > make emma
>>
>> > # Setting the environment and additional bash commands. (like
>> > m,mm,mmm, choosecombo etc) Notice the space after the dot!
>> > . build/envsetup.sh
>>
>> > # Set EMMA_INSTRUMENTATION to true
>> > export EMMA_INSTRUMENT=true
>>
>> > # Copy your project to development/samples/<_projectname_> or
>> > somewhere..:)
>> > # Based on the ApiDemo create an Android.mk file for the project
>> > directory and the project test directory
>> > # The LOCAL_INSTRUMENTATION_FOR value in test dir Android.mk has to be
>> > equal with the LOCAL_PACKAGE_NAME defined in the Android.mk in the
>> > main project dir.
>> > # Compile the Application would like to instrument
>> > mmm development/samples/<_projectname_>
>>
>> > # Set the ANDROID_PRODUCT_OUT directory for the emulator to know the
>> > image location
>> > export ANDROID_PRODUCT_OUT=/<_path_>/android-src/out/target/product/
>> > generic
>>
>> > # Start an emulator with a simulated sdcard:
>> > emulator -sdcard 
>>
>> > # Remount the drive - it is needed to have a writable drive. without
>> > that sync wont work
>> > adb remount
>>
>> > # Synchronize the local content with the emulator
>> > adb sync
>>
>> > adb shell
>> > # create directory: mkdir /etc/coverageresult
>>
>> > # Executing tests
>> > adb shell am instrument -w -e coverage true -e coverageFile /etc/
>> > coverageresult/coverage.ec hu.agsoftware.sample.tests/
>> > android.test.InstrumentationTestRunner
>>
>> > # Dump a runtime coverage data file:
>> > adb pull /etc/coverageresult/coverage.ec coverage.ec
>>
>> > # Generate a coverage report
>> > java -cp external/emma/lib/emma.jar emma report -r html -in
>> > coverage.ec -sp development/samples/<_projectname_>/src -in out/target/
>> > common/obj/APPS/<_projectname>_intermediates/coverage.em
>>
>> > 

[android-developers] Re: onDraw issue? -- what's going on?!

2009-08-30 Thread Nick_Zaillian

Alright, I have made the appropriate changes to my SeqSwitch class so
that I no longer call setBackgroundResource from my onDraw (and in
fact no longer override onDraw at all).  Now, Mark, I have written an
audio pattern playback implementation using a Handler that runs in my
main Activity and, while it works, it is way less smooth and reliable
than the implementation using the Timer/separate thread.  I tried to
wade through the docs for AsyncTask and I could not tell whether or
not it would allow me to update the UI from my separate Timer thread.
Will it, or do I just have to choose between having smooth audio
playback in a separate thread but no visual feedback and having less
reliable audio playback in my UI thread with visual feedback?
Thanks again,
Nick Zaillian

On Aug 30, 4:13 pm, Romain Guy  wrote:
> You should call setBackgroundResource() but NOT from onDraw(). Just
> call this method from setIlluminated() for instance.
>
>
>
> On Sun, Aug 30, 2009 at 1:06 PM, Nick_Zaillian wrote:
>
> > Mark and Romain,
> > Thanks.  That was a much prompter response than I either expected or
> > deserved.
> > Romain, I am not sure that I totally understand what you've said.  How
> > am I to set the background in accordance with the state of isChecked
> > and isIlluminated from within onDraw if not by calling
> > setBackgroundResource()?  I guess this post probably belongs in the
> > Android Beginner's group.
> > Thanks,
> > Nick Zaillian
>
> > On Aug 30, 2:59 pm, Romain Guy  wrote:
> >> Do not call setBacgroundResource() in onDraw()! You are loading and
> >> setting an image every time your view is drawn. You are actually
> >> creating a infinite "loop";
>
> >> onDraw() -> setBacgroundResource() -> invalidate() -> onDraw() ->
> >> setBacgroundResource() -> etc.
>
> >> On Sun, Aug 30, 2009 at 11:47 AM, Nick_Zaillian wrote:
>
> >> > Hey all,
> >> > I am writing an app that emulates a drum machine with a step
> >> > sequencer.  For those unfamiliar with step sequencers, a step
> >> > sequencer is basically a set of switches where the state of each
> >> > switch indicates whether or not a sound is to be played at a
> >> > particular point in a pattern.  I've already got audio playback
> >> > working using SoundPool and can play patterns (represented as objects
> >> > containing boolean arrays mapped to audio resources) by stepping
> >> > through these patterns using a timer.  What I am trying and struggling
> >> > to do at present is to write my UI.  I have subclassed ToggleSwitch
> >> > and made a custom switch called SeqSwitch which, in addition to
> >> > ToggleSwitch's isChecked field, also holds an isIlluminated field.
> >> > I've written another class called SwitchController that takes an array
> >> > of these switches and has a method (which I've called runSwitches)
> >> > that, with each call, advances one switch, illuminates the current
> >> > switch, and unilluminates the previous switch (the idea is that, when
> >> > the user plays his pattern, the button representing the current step
> >> > will illuminate, letting him know the current position of playback in
> >> > the sequence).  The SeqSwitches seem to render and behave fine in
> >> > response to clicks.  My SwitchController.runSwitches method also works
> >> > so long as I place it in a click handler of a button in my main
> >> > Activity.  When, however, I pass it into the runnable (called
> >> > PatternPlayTask) that I give to my Timer (which then calls
> >> > SwitchController.runSwitches every 300 milliseconds as it steps
> >> > through the pattern), it stops working.  I have used the debugger to
> >> > make sure that the object I am passing into the runnable is the same
> >> > as the one for which the call to SwitchController.runSwitches was
> >> > working in the main activity and have found that definitely it is.
> >> > Does anybody have any idea what's going on here.  Hopefully I am just
> >> > doing something totally stupid, here.  I've pasted the code for my
> >> > ToggleButton subclass below, if that helps:
>
> >> > package com.drummachine;
> >> > import android.widget.*;
> >> > import android.view.*;
> >> > import android.content.Context;
> >> > import com.drummachine.Instrument;
> >> > import android.util.*;
> >> > import android.content.res.TypedArray;
> >> > import android.graphics.Canvas;
> >> > import android.graphics.Paint;
> >> > import android.graphics.drawable.*;
> >> > import android.util.AttributeSet;
> >> > import android.view.View;
>
> >> > public class SeqSwitch extends ToggleButton {
>
> >> >        //SeqSwitch holds an isIlluminated state.
> >> >        //if isIlluminated is true, onDraw will render an illuminated
> >> >        //button image as the SeqSwitch's drawable (currently the same 
> >> > image
> >> > used for
> >> >        //a ToggleButton whose isChecked == true)
> >> >        public boolean isIlluminated;
>
> >> >        public SeqSwitch(Context context)
> >> >        {
> >> >                super(context);
> >> > 

[android-developers] Re: Reuse Hero rounded list item look?

2009-08-30 Thread Jonas Petersson

Mark Murphy wrote:
> Jonas Petersson wrote:
>> I was kind of hoping that the layout and graphics would be available in 
>> a place I had not yet found. Grabbing the screen shot is no problem for 
>> static, but getting the whole look and feel right for highlighting etc 
>> seems like rather a lot of effort duplication that isn't in like with 
>> the openness of the rest of the system.
> 
> Android is open. HTC Sense is not. My suspicion is that your screenshot
> is HTC Sense-ish.

I suspect so too - the shot is not mine. In fact, I've never seen a Hero 
live which makes duplicating the look&feel slightly harder. So I guess 
I'll just have to go out and get myself a Hero...

Best / Jonas

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Testing OpenGL rendering in Java outside of Android?

2009-08-30 Thread Robert Green

I wrote a utility to import OBJ files from Max and I've found that
things look nearly identical in the game as they did in the app.  Are
you doing a lot of dynamic geometry and effects?  If not, I'd
recommend using a modeling tool and developing a process to import.

In my experience, the best tool to check rendering on is a tool
written on the platform itself.  You'll never know exactly how things
will look or behave on Android GL10 unless you render on that platform
on a device.

On Aug 30, 3:49 pm, SChaser  wrote:
> I took a look at that. I am not sure of all incompatibilities, but it
> does not provide the GL10 object, which I believe is required for
> Android JOGL apps.
>
> Ideas?
>
> On Aug 29, 9:33 pm, Romain Guy  wrote:
>
> > I think thatJOGL2 supports OpenGL ES 1.0 and 2.0. You could try with this.
>
> > On Sat, Aug 29, 2009 at 9:28 PM, SChaser wrote:
>
> > > I would like to write OpenGL classes and test them in java outside of
> > > an Android device or emulator, and then use these in the Android.
>
> > > Has anybody done this?: If so, are thereJOGLimplementations that are
> > > directly compatible?
>
> > > I tried doing this onWindowsusingJOGLand writing wrappers, etc,
> > > but it turned out to be a real mess. I finally gave up when I didn't
> > > know how to get a GLU instance for a frustrum call.
>
> > > Thanks
>
> > --
> > Romain Guy
> > Android framework engineer
> > romain...@android.com
>
> > Note: please don't send private questions to me, as I don't have time
> > to provide private support.  All such questions should be posted on
> > public forums, where I and others can see and answer them
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: What is the exact date/time that the ADC2 submission site will be closing?

2009-08-30 Thread Robert Green

Ah yes, there it is.  Thanks, Mark!

On Aug 30, 2:35 pm, "Mark Murphy"  wrote:
> > The rules just say Aug 31, but what does that mean?
>
> You must be reading the wrong rules.
>
> "5. CHALLENGE TIMELINE: All Entries must be submitted before the end of
> the Submission Period. The Submission Period ends at 11:59:59 P.M. Pacific
> Time (PT) Zone in the United States on August 31, 2009."
>
> http://code.google.com/android/adc/adc2_terms.html
>
> --
> 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] Re: Reuse Hero rounded list item look?

2009-08-30 Thread Mark Murphy

Jonas Petersson wrote:
> I was kind of hoping that the layout and graphics would be available in 
> a place I had not yet found. Grabbing the screen shot is no problem for 
> static, but getting the whole look and feel right for highlighting etc 
> seems like rather a lot of effort duplication that isn't in like with 
> the openness of the rest of the system.

Android is open. HTC Sense is not. My suspicion is that your screenshot
is HTC Sense-ish.

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

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] Reuse Hero rounded list item look?

2009-08-30 Thread Jonas Petersson

Marco Nelissen wrote:
> If you want your app to work and look like that on any device other
> than a Hero, you will have to do it yourself.

Well, Hero is the most popular version around here so that was their 
priorities. I guess I could look at the hw ID and select "skin" from 
that, but I doubt that the non-Hero users will be upset.

 > Should be as simple as
 > picking the right layout and graphics for your list items.

I was kind of hoping that the layout and graphics would be available in 
a place I had not yet found. Grabbing the screen shot is no problem for 
static, but getting the whole look and feel right for highlighting etc 
seems like rather a lot of effort duplication that isn't in like with 
the openness of the rest of the system. (And, yes: I like the 
functionality coding a whole lot more than the pixel fiddling.)

Best / Jonas

> On Sun, Aug 30, 2009 at 12:09 PM, Jonas Petersson 
> wrote:
>> Dear experts,
>>
>> I've been asked to make an app that has a list with items looking
>> similar to this snapshot from Hero:
>>
>> http://www.flickr.com/photos/jaxxdotorg/3640222441/in/set-72157619952823330/
>>
>> Is there a way to reuse this in any way or do I have to re-design it
>> from scratch?



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Testing OpenGL rendering in Java outside of Android?

2009-08-30 Thread SChaser

I took a look at that. I am not sure of all incompatibilities, but it
does not provide the GL10 object, which I believe is required for
Android JOGL apps.

Ideas?

On Aug 29, 9:33 pm, Romain Guy  wrote:
> I think thatJOGL2 supports OpenGL ES 1.0 and 2.0. You could try with this.
>
> On Sat, Aug 29, 2009 at 9:28 PM, SChaser wrote:
>
> > I would like to write OpenGL classes and test them in java outside of
> > an Android device or emulator, and then use these in the Android.
>
> > Has anybody done this?: If so, are thereJOGLimplementations that are
> > directly compatible?
>
> > I tried doing this onWindowsusingJOGLand writing wrappers, etc,
> > but it turned out to be a real mess. I finally gave up when I didn't
> > know how to get a GLU instance for a frustrum call.
>
> > Thanks
>
> --
> Romain Guy
> Android framework engineer
> romain...@android.com
>
> Note: please don't send private questions to me, as I don't have time
> to provide private support.  All such questions should be posted on
> public forums, where I and others can see and answer them
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Android client for JAX-RPC WebService

2009-08-30 Thread baratam.pras...@gmail.com

Hi,

Trying to write a client in Android for JAX-RPC Webservices developed
in JAVA.

Is this possible and please suggest any examples for this.

Regards,
PB

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Reuse Hero rounded list item look?

2009-08-30 Thread Marco Nelissen

If you want your app to work and look like that on any device other
than a Hero, you will have to do it yourself. Should be as simple as
picking the right layout and graphics for your list items.


On Sun, Aug 30, 2009 at 12:09 PM, Jonas Petersson wrote:
>
> Dear experts,
>
> I've been asked to make an app that has a list with items looking
> similar to this snapshot from Hero:
>
> http://www.flickr.com/photos/jaxxdotorg/3640222441/in/set-72157619952823330/
>
> Is there a way to reuse this in any way or do I have to re-design it
> from scratch?
>
>                Skins, please... / Jonas
>
> >
>

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



[android-developers] Re: how to know my app is running backgroud ?

2009-08-30 Thread Christine

On Aug 30, 5:42 am, Android中国开发者团队google groups 
wrote:
> i want to excute same action when my app is running backgroud

Err, when your app is in the background, it does not "run". If you
want your app to continue doing something when the UI is not visible,
you need to create a Service. But a service takes resources away so
you don't want a service to run indefinitely.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Activity stack: A B C -> press BACK -> go to A

2009-08-30 Thread fhucho

Thanks. Good idea, I did it this way.

On Aug 30, 10:11 pm, "Jonas Petersson"  wrote:
> fhucho wrote:
> > my activity stack is ABC, in activity C I press back, and return to B,
> > then press back again and go to A. What should I do to return to A
> > directly from C?
>
> I guess it depends on the reason for wanting to skip "B". I needed
> exactly this case yesterday and in my case "B" knows very well that it
> will not be needed when it starts up "C", so "B" simply calls finish()
> after that. Solved.
>
>                         Best / Jonas
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Default Sound Resources

2009-08-30 Thread Marco Nelissen

You can use the media provider to get the list of available ringtones,
notification and alarm sounds for the phone your app is running on.


On Sat, Aug 29, 2009 at 10:01 PM, RalphLeon wrote:
>
> Hello!
>
> I have a timer application and I was hoping to add the default sound
> resources that are available on the device, a la android.R.drawable.*
>
> Are these resources available in any default location? Or shall I just
> compile my own set of royalty-free sounds?
>
> Cheers,
> Ralph
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: onDraw issue? -- what's going on?!

2009-08-30 Thread Romain Guy

You should call setBackgroundResource() but NOT from onDraw(). Just
call this method from setIlluminated() for instance.

On Sun, Aug 30, 2009 at 1:06 PM, Nick_Zaillian wrote:
>
> Mark and Romain,
> Thanks.  That was a much prompter response than I either expected or
> deserved.
> Romain, I am not sure that I totally understand what you've said.  How
> am I to set the background in accordance with the state of isChecked
> and isIlluminated from within onDraw if not by calling
> setBackgroundResource()?  I guess this post probably belongs in the
> Android Beginner's group.
> Thanks,
> Nick Zaillian
>
> On Aug 30, 2:59 pm, Romain Guy  wrote:
>> Do not call setBacgroundResource() in onDraw()! You are loading and
>> setting an image every time your view is drawn. You are actually
>> creating a infinite "loop";
>>
>> onDraw() -> setBacgroundResource() -> invalidate() -> onDraw() ->
>> setBacgroundResource() -> etc.
>>
>>
>>
>> On Sun, Aug 30, 2009 at 11:47 AM, Nick_Zaillian wrote:
>>
>> > Hey all,
>> > I am writing an app that emulates a drum machine with a step
>> > sequencer.  For those unfamiliar with step sequencers, a step
>> > sequencer is basically a set of switches where the state of each
>> > switch indicates whether or not a sound is to be played at a
>> > particular point in a pattern.  I've already got audio playback
>> > working using SoundPool and can play patterns (represented as objects
>> > containing boolean arrays mapped to audio resources) by stepping
>> > through these patterns using a timer.  What I am trying and struggling
>> > to do at present is to write my UI.  I have subclassed ToggleSwitch
>> > and made a custom switch called SeqSwitch which, in addition to
>> > ToggleSwitch's isChecked field, also holds an isIlluminated field.
>> > I've written another class called SwitchController that takes an array
>> > of these switches and has a method (which I've called runSwitches)
>> > that, with each call, advances one switch, illuminates the current
>> > switch, and unilluminates the previous switch (the idea is that, when
>> > the user plays his pattern, the button representing the current step
>> > will illuminate, letting him know the current position of playback in
>> > the sequence).  The SeqSwitches seem to render and behave fine in
>> > response to clicks.  My SwitchController.runSwitches method also works
>> > so long as I place it in a click handler of a button in my main
>> > Activity.  When, however, I pass it into the runnable (called
>> > PatternPlayTask) that I give to my Timer (which then calls
>> > SwitchController.runSwitches every 300 milliseconds as it steps
>> > through the pattern), it stops working.  I have used the debugger to
>> > make sure that the object I am passing into the runnable is the same
>> > as the one for which the call to SwitchController.runSwitches was
>> > working in the main activity and have found that definitely it is.
>> > Does anybody have any idea what's going on here.  Hopefully I am just
>> > doing something totally stupid, here.  I've pasted the code for my
>> > ToggleButton subclass below, if that helps:
>>
>> > package com.drummachine;
>> > import android.widget.*;
>> > import android.view.*;
>> > import android.content.Context;
>> > import com.drummachine.Instrument;
>> > import android.util.*;
>> > import android.content.res.TypedArray;
>> > import android.graphics.Canvas;
>> > import android.graphics.Paint;
>> > import android.graphics.drawable.*;
>> > import android.util.AttributeSet;
>> > import android.view.View;
>>
>> > public class SeqSwitch extends ToggleButton {
>>
>> >        //SeqSwitch holds an isIlluminated state.
>> >        //if isIlluminated is true, onDraw will render an illuminated
>> >        //button image as the SeqSwitch's drawable (currently the same image
>> > used for
>> >        //a ToggleButton whose isChecked == true)
>> >        public boolean isIlluminated;
>>
>> >        public SeqSwitch(Context context)
>> >        {
>> >                super(context);
>> >                isIlluminated = false;
>>
>> >        }
>>
>> >        //constructor called when params are taken from XML layout
>> >    public SeqSwitch(Context context, AttributeSet attributes) {
>> >        super(context, attributes);
>>
>> >        TypedArray a = context.obtainStyledAttributes(attributes,
>> >                R.styleable.SeqSwitch);
>>
>> >       isIlluminated = false;
>> >       super.setBackgroundResource
>> > (R.drawable.seqswitchbackgroundsoneoff);
>>
>> >        a.recycle();
>> >    }
>>
>> >    public void setIlluminated(boolean state)
>> >    {
>> >        isIlluminated = state;
>> >        this.invalidate();
>>
>> >    }
>>
>> >    //yes, I know having illumniate() and unIlluminate() methods is
>> > redundant
>> >    //when I have a setIlluminated(boolean) method, but I am presently
>> > too lazy
>> >    //to rearrange code elsewhere that presently relies on these two
>> > methods.
>> >    public void unIlluminate()
>> >    

[android-developers] Re: Activity stack: A B C -> press BACK -> go to A

2009-08-30 Thread Jonas Petersson

fhucho wrote:
> my activity stack is ABC, in activity C I press back, and return to B,
> then press back again and go to A. What should I do to return to A
> directly from C?

I guess it depends on the reason for wanting to skip "B". I needed 
exactly this case yesterday and in my case "B" knows very well that it 
will not be needed when it starts up "C", so "B" simply calls finish() 
after that. Solved.

Best / Jonas


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: onDraw issue? -- what's going on?!

2009-08-30 Thread Nick_Zaillian

Mark and Romain,
Thanks.  That was a much prompter response than I either expected or
deserved.
Romain, I am not sure that I totally understand what you've said.  How
am I to set the background in accordance with the state of isChecked
and isIlluminated from within onDraw if not by calling
setBackgroundResource()?  I guess this post probably belongs in the
Android Beginner's group.
Thanks,
Nick Zaillian

On Aug 30, 2:59 pm, Romain Guy  wrote:
> Do not call setBacgroundResource() in onDraw()! You are loading and
> setting an image every time your view is drawn. You are actually
> creating a infinite "loop";
>
> onDraw() -> setBacgroundResource() -> invalidate() -> onDraw() ->
> setBacgroundResource() -> etc.
>
>
>
> On Sun, Aug 30, 2009 at 11:47 AM, Nick_Zaillian wrote:
>
> > Hey all,
> > I am writing an app that emulates a drum machine with a step
> > sequencer.  For those unfamiliar with step sequencers, a step
> > sequencer is basically a set of switches where the state of each
> > switch indicates whether or not a sound is to be played at a
> > particular point in a pattern.  I've already got audio playback
> > working using SoundPool and can play patterns (represented as objects
> > containing boolean arrays mapped to audio resources) by stepping
> > through these patterns using a timer.  What I am trying and struggling
> > to do at present is to write my UI.  I have subclassed ToggleSwitch
> > and made a custom switch called SeqSwitch which, in addition to
> > ToggleSwitch's isChecked field, also holds an isIlluminated field.
> > I've written another class called SwitchController that takes an array
> > of these switches and has a method (which I've called runSwitches)
> > that, with each call, advances one switch, illuminates the current
> > switch, and unilluminates the previous switch (the idea is that, when
> > the user plays his pattern, the button representing the current step
> > will illuminate, letting him know the current position of playback in
> > the sequence).  The SeqSwitches seem to render and behave fine in
> > response to clicks.  My SwitchController.runSwitches method also works
> > so long as I place it in a click handler of a button in my main
> > Activity.  When, however, I pass it into the runnable (called
> > PatternPlayTask) that I give to my Timer (which then calls
> > SwitchController.runSwitches every 300 milliseconds as it steps
> > through the pattern), it stops working.  I have used the debugger to
> > make sure that the object I am passing into the runnable is the same
> > as the one for which the call to SwitchController.runSwitches was
> > working in the main activity and have found that definitely it is.
> > Does anybody have any idea what's going on here.  Hopefully I am just
> > doing something totally stupid, here.  I've pasted the code for my
> > ToggleButton subclass below, if that helps:
>
> > package com.drummachine;
> > import android.widget.*;
> > import android.view.*;
> > import android.content.Context;
> > import com.drummachine.Instrument;
> > import android.util.*;
> > import android.content.res.TypedArray;
> > import android.graphics.Canvas;
> > import android.graphics.Paint;
> > import android.graphics.drawable.*;
> > import android.util.AttributeSet;
> > import android.view.View;
>
> > public class SeqSwitch extends ToggleButton {
>
> >        //SeqSwitch holds an isIlluminated state.
> >        //if isIlluminated is true, onDraw will render an illuminated
> >        //button image as the SeqSwitch's drawable (currently the same image
> > used for
> >        //a ToggleButton whose isChecked == true)
> >        public boolean isIlluminated;
>
> >        public SeqSwitch(Context context)
> >        {
> >                super(context);
> >                isIlluminated = false;
>
> >        }
>
> >        //constructor called when params are taken from XML layout
> >    public SeqSwitch(Context context, AttributeSet attributes) {
> >        super(context, attributes);
>
> >        TypedArray a = context.obtainStyledAttributes(attributes,
> >                R.styleable.SeqSwitch);
>
> >       isIlluminated = false;
> >       super.setBackgroundResource
> > (R.drawable.seqswitchbackgroundsoneoff);
>
> >        a.recycle();
> >    }
>
> >    public void setIlluminated(boolean state)
> >    {
> >        isIlluminated = state;
> >        this.invalidate();
>
> >    }
>
> >    //yes, I know having illumniate() and unIlluminate() methods is
> > redundant
> >    //when I have a setIlluminated(boolean) method, but I am presently
> > too lazy
> >    //to rearrange code elsewhere that presently relies on these two
> > methods.
> >    public void unIlluminate()
> >    {
> >        isIlluminated = false;
> >        this.invalidate();
> >    }
>
> >    public void illuminate()
> >    {
> >        isIlluminated = true;
> >        this.invalidate();
> >    }
>
> >    public boolean switchIsIlluminated()
> >    {
> >        return isIlluminated;
> >    }
>
> >    /**
> 

[android-developers] Activity stack: A B C -> press BACK -> go to A

2009-08-30 Thread fhucho

Hi,
my activity stack is ABC, in activity C I press back, and return to B,
then press back again and go to A. What should I do to return to A
directly from C?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Typeface affecting TextView marquee?

2009-08-30 Thread greg

I neglected to mention that the marquee scrolling is due to the
TextView ellipsize attribute in the xml file that defines the layout
of TextView rows.

http://schemas.android.com/apk/res/
android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent">







In the custom TextView onDraw(), setTypeface(getTypeface(),
Typeface.ITALIC) seems to prevent the marquee scroll from working when
the selected text is too large to fit in the view.  With
Typeface.NORMAL, the marquee scroll works as specified in the xml.


On Aug 30, 2:34 pm, greg  wrote:
> The default marquee scroll (i.e., three scrolls of text when list item
> is selected) in my application's ListView works when the typeface is
> set to Typeface.NORMAL but not when set to Typeface.ITALIC.  Is the
> marquee scroll implemented for TextViews with the ITALIC typeface?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: What is the exact date/time that the ADC2 submission site will be closing?

2009-08-30 Thread Mark Murphy

> The rules just say Aug 31, but what does that mean?

You must be reading the wrong rules.

"5. CHALLENGE TIMELINE: All Entries must be submitted before the end of
the Submission Period. The Submission Period ends at 11:59:59 P.M. Pacific
Time (PT) Zone in the United States on August 31, 2009."

http://code.google.com/android/adc/adc2_terms.html

-- 
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] Re: What is the exact date/time that the ADC2 submission site will be closing?

2009-08-30 Thread Dan Sherman
11:59:59 PM on the 31st.



On Sun, Aug 30, 2009 at 3:27 PM, Robert Green  wrote:

>
> The rules just say Aug 31, but what does that mean?  Tonight (Aug 30)
> at 12am PST?  Does it mean through Aug 31, so Aug 31, 12am in some
> timezone?
>
> Can we get a more specific time here?
>
> 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] What is the exact date/time that the ADC2 submission site will be closing?

2009-08-30 Thread Robert Green

The rules just say Aug 31, but what does that mean?  Tonight (Aug 30)
at 12am PST?  Does it mean through Aug 31, so Aug 31, 12am in some
timezone?

Can we get a more specific time here?

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] Reuse Hero rounded list item look?

2009-08-30 Thread Jonas Petersson

Dear experts,

I've been asked to make an app that has a list with items looking 
similar to this snapshot from Hero:

http://www.flickr.com/photos/jaxxdotorg/3640222441/in/set-72157619952823330/

Is there a way to reuse this in any way or do I have to re-design it 
from scratch?

Skins, please... / Jonas

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: onDraw issue? -- what's going on?!

2009-08-30 Thread Romain Guy

Do not call setBacgroundResource() in onDraw()! You are loading and
setting an image every time your view is drawn. You are actually
creating a infinite "loop";

onDraw() -> setBacgroundResource() -> invalidate() -> onDraw() ->
setBacgroundResource() -> etc.

On Sun, Aug 30, 2009 at 11:47 AM, Nick_Zaillian wrote:
>
> Hey all,
> I am writing an app that emulates a drum machine with a step
> sequencer.  For those unfamiliar with step sequencers, a step
> sequencer is basically a set of switches where the state of each
> switch indicates whether or not a sound is to be played at a
> particular point in a pattern.  I've already got audio playback
> working using SoundPool and can play patterns (represented as objects
> containing boolean arrays mapped to audio resources) by stepping
> through these patterns using a timer.  What I am trying and struggling
> to do at present is to write my UI.  I have subclassed ToggleSwitch
> and made a custom switch called SeqSwitch which, in addition to
> ToggleSwitch's isChecked field, also holds an isIlluminated field.
> I've written another class called SwitchController that takes an array
> of these switches and has a method (which I've called runSwitches)
> that, with each call, advances one switch, illuminates the current
> switch, and unilluminates the previous switch (the idea is that, when
> the user plays his pattern, the button representing the current step
> will illuminate, letting him know the current position of playback in
> the sequence).  The SeqSwitches seem to render and behave fine in
> response to clicks.  My SwitchController.runSwitches method also works
> so long as I place it in a click handler of a button in my main
> Activity.  When, however, I pass it into the runnable (called
> PatternPlayTask) that I give to my Timer (which then calls
> SwitchController.runSwitches every 300 milliseconds as it steps
> through the pattern), it stops working.  I have used the debugger to
> make sure that the object I am passing into the runnable is the same
> as the one for which the call to SwitchController.runSwitches was
> working in the main activity and have found that definitely it is.
> Does anybody have any idea what's going on here.  Hopefully I am just
> doing something totally stupid, here.  I've pasted the code for my
> ToggleButton subclass below, if that helps:
>
> package com.drummachine;
> import android.widget.*;
> import android.view.*;
> import android.content.Context;
> import com.drummachine.Instrument;
> import android.util.*;
> import android.content.res.TypedArray;
> import android.graphics.Canvas;
> import android.graphics.Paint;
> import android.graphics.drawable.*;
> import android.util.AttributeSet;
> import android.view.View;
>
>
> public class SeqSwitch extends ToggleButton {
>
>        //SeqSwitch holds an isIlluminated state.
>        //if isIlluminated is true, onDraw will render an illuminated
>        //button image as the SeqSwitch's drawable (currently the same image
> used for
>        //a ToggleButton whose isChecked == true)
>        public boolean isIlluminated;
>
>        public SeqSwitch(Context context)
>        {
>                super(context);
>                isIlluminated = false;
>
>        }
>
>        //constructor called when params are taken from XML layout
>    public SeqSwitch(Context context, AttributeSet attributes) {
>        super(context, attributes);
>
>        TypedArray a = context.obtainStyledAttributes(attributes,
>                R.styleable.SeqSwitch);
>
>       isIlluminated = false;
>       super.setBackgroundResource
> (R.drawable.seqswitchbackgroundsoneoff);
>
>        a.recycle();
>    }
>
>    public void setIlluminated(boolean state)
>    {
>        isIlluminated = state;
>        this.invalidate();
>
>    }
>
>    //yes, I know having illumniate() and unIlluminate() methods is
> redundant
>    //when I have a setIlluminated(boolean) method, but I am presently
> too lazy
>    //to rearrange code elsewhere that presently relies on these two
> methods.
>    public void unIlluminate()
>    {
>        isIlluminated = false;
>        this.invalidate();
>    }
>
>    public void illuminate()
>    {
>        isIlluminated = true;
>        this.invalidate();
>    }
>
>
>    public boolean switchIsIlluminated()
>    {
>        return isIlluminated;
>    }
>
>    /**
>     * renders a image of a switch with an illuminated LED if either
> the SeqSwitch's isChecked or
>     * isIllumniated == true.  Otherwise it renders a drawable of a
> button with an unIlluminated LED
>     */
>    public void onDraw(Canvas canvas)
>    {
>        if(super.isChecked() == true || this.isIlluminated == true)
>        {
>                super.setBackgroundResource
> (R.drawable.seqswitchbackgroundsoneonon);
>        }
>        else
>        {
>                super.setBackgroundResource
> (R.drawable.seqswitchbackgroundsoneoff);
>        }
>
>    }
> }
>
> Thanks,
> Nick Zaillian
>
> >
>



-- 
Romain Guy
Android framew

[android-developers] Re: onDraw issue? -- what's going on?!

2009-08-30 Thread Mark Murphy

> When, however, I pass it into the runnable (called
> PatternPlayTask) that I give to my Timer (which then calls
> SwitchController.runSwitches every 300 milliseconds as it steps
> through the pattern), it stops working.

Timer/TimerTask use a background thread. Thou shalt not modify the UI from
a background thread, for that is the way of sin.



Assuming you did not modify your code to force the drawing to be done on
the UI thread, you should be getting exceptions, perhaps caught by your
code, from this. You will then need to use any of the following to get
your UI-modifying code to run on the UI thread:

-- A Handler
-- View#post()
-- View#postDelayed()
-- AsyncTask
-- Activity#runOnUiThread()

-- 
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] Re: fill_parent for each child widget?

2009-08-30 Thread Dianne Hackborn
The home screen uses a custom layout manager for this, and this is probably
a situation where a custom layout manager makes sense since there isn't a
way I can think of to express such a layout with the standard classes.

And you'll need some kind of custom container anyway to get per-page
flinging like the home screen, because this is not how scroll views work.

On Sun, Aug 30, 2009 at 11:41 AM, smallbug  wrote:

>
> Hi,
>
> I am using a HorizontalScrollView to contain and scroll 3 child
> widgets, each of which is either an ImageView or a custom widget. What
> I'd like to achieve is something like homescreen, where each child
> widget filling up the whole width of the display and the user is able
> to switch to the other widget by flickering horizontally. I am having
> a hard time figuring out what properties I should assign to each of
> the child widget in order to have them fill the parent container. I
> get it working if I hard coded the width for each child but I'd like
> them to be able to fit to any screen resolutions, as the current
> Android homescreen does.
>
> Here is the xml (pseudo like)
>
> HorizontalView -> LinearLayout -> children widgets
>
> Hope this makes sense. Thanks!
> >
>


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



  1   2   >