[android-developers] Re: Geo command

2009-05-17 Thread Mark Murphy



 Anyone can help me on this?

 I installed android sdk 1.5, but in no where I can find the geo
 command. Where should I get one?

You need to telnet into the emulator:

telnet localhost 5554

And there you can run the geo command:

geo fix [lon] [lat]

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!



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



[android-developers] Re: aidl remote service call namespace question

2009-05-17 Thread Dianne Hackborn
For the second question, you'll either want to define an abstract action in
an intent-filter for the service and use that as the intent you bind to
(typically the action is the name of the desired interface for binding to
services), or create an explicit ComponentName with the package name + class
name of the service being bound to and provide that to the Intent.  For this
latter, make sure you have set android:exported=true for the service.

Sorry I can't really help you with the first question, since I don't know
ADT that well.  Basically you will need to have both applications like the
generated aidl code into their app.

On Sat, May 16, 2009 at 8:46 AM, dev_rob robwiene...@googlemail.com wrote:


 Hi android developers,

 I'm new to the great android platform, trying to get into RPC with
 aidl and services.

 I didn't find a sufficient answer to my problem in any posts, if there
 already is one, please excuse and point me to it, thanks.

 I made 2 projects.

 project 1 hast an activity that binds to a service from project 2 on a
 button click (all just for testing).

 1. issue:

 How can I make project 1 know (import) my TestInterface (from
 TestInterface.aidl out of project 2) for usage in:

 TestInterface mService = (TestInterface)
 TestInterface.Stub.asInterface(service);

 without adding project 2 to the build path, because if I'd have an
 installed service without the project code, I couldn't do it this way,
 too...??
 I read in one thread that TestInterface.aidl should just be added to
 project 1, too, but if I do this, in DDMS enforceInterface() complains
 and seems to just see/use the interface from project 1 and it doesn't
 work.

 2. issue:

 (here i add project 2 to project 1's build path, which i still think
 is not how it should work)

 If i bind to a system service, i can simply do something like

 bindService(new Intent(com.android.A_SERVICE);

 but if i have my own service in project 2, something like

 bindService(new Intent(com.project2.A_SERVICE);

 does not work (of course, service 2 is installed on the emulator at
 that point, i provide an intent-filter an set the android:exported-
 attribute to true). the error i get is:

 05-16 15:06:06.384: ERROR/dalvikvm(820): Could not find method
 de.roberlin.new_rpc.TestInterface$Stub.asInterface, referenced from
 method de.roberlin.new_rpc.New_RPC_Client$2.onServiceConnected
 

 this error makes really no sense to me, any suggestions?

 btw: i ran adb shell dumpsys package and my Service is registered:

 Service Resolver Table:
 ...
 Non-Data Actions:
  ...
  de.roberlin.new_rpc.action.NEW_RPC:
436578f0 de.roberlin.new_rpc/.TestStringService

 The code from both projects can be reviewed at
 http://pastebin.com/f4bd0bc10

 I hope my points (special concern lies on the error message..) are not
 to nooby.

 I'd really appreciate any help! Thanks in advance!










 



-- 
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: Drawing on the incoming call screen

2009-05-17 Thread Dianne Hackborn
No, you can't draw directly on it.

On Fri, May 15, 2009 at 5:55 PM, GT burlysk...@gmail.com wrote:


 Is it possible to draw on the incoming call screen? I know that a few
 of the whitepages apps do it, but I would like to know how.

 Thank you for your time

 



-- 
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] How to set some lists in one layout?

2009-05-17 Thread daehoon

How to set a few lists in one layout include their own data from DB?

here is source code about set list in Android guide. List id is
@android:list
why the id must be android:list?, may I use my own id?
If I can, how to set lists to main layout including their own data
(title)?

   Cursor notesCursor = mDbHelper.fetchAllNotes();
   startManagingCursor(notesCursor);
   String[] from = new String[]{NotesDbAdapter.KEY_TITLE};
   int[] to = new int[]{R.id.text1};
   SimpleCursorAdapter notes =
   new SimpleCursorAdapter(this, R.layout.notes_row_weekly,
notesCursor, from, to);
   setListAdapter(notes);

I want to set lists like this :

 
 |   List1  List2|
 |   title1   |   title |
 |   title2   |   title |
 |   title3   |   title |
 | |   title |
 | | |
 |   |
 |   |
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Drawing on the incoming call screen

2009-05-17 Thread iPaul Pro

Perhaps you could try launching an activity with a transparent
background, strategically positioned, that fires when an incoming call
is received. It will have the same UI effect. I assume that this is
the way other apps achieve this feature.

On May 15, 8:55 pm, GT burlysk...@gmail.com wrote:
 Is it possible to draw on the incoming call screen? I know that a few
 of the whitepages apps do it, but I would like to know how.

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



[android-developers] Re: How to set some lists in one layout?

2009-05-17 Thread Mark Murphy

 How to set a few lists in one layout include their own data from DB?

Use multiple ListView widgets in the layout. Either have one handled by
ListActivity and you handle the other(s), or handle all of them yourself.
It's not that hard.

 here is source code about set list in Android guide. List id is
 @android:list
 why the id must be android:list?,

So ListActivity, if you are using it, knows which list it is handling.

 may I use my own id?

You can, for any ListView widgets you are handling yourself:

http://developer.android.com/reference/android/widget/ListView.html

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!



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



[android-developers] Re: How to handle tall dialogs

2009-05-17 Thread Thomas

Yes, that will work. And indeed it is a much bette approach than my
initial solution. Thank you very much...

Regards
Thomas

On 17 Mai, 05:37, Marco Nelissen marc...@android.com wrote:
 You could try using a different layout for landscape mode, where instead of:

 label
 textfield
 label
 datepicker

 you make it:

 label  textfield
 label  datepicker

 Would that work for your particular layout?

 On Sat, May 16, 2009 at 9:18 AM, Thomas kuenne...@googlemail.com wrote:

  Hi group.

  I have a standard dialog with a headline, a label, a text field,
  another label and a DatePicker. They are laid out using a vertical
  LinearLayout. When the user slides the keyboard open, the dialog is
  rotated. Now, the dialog does no longer fit on the screen, it is to
  tall. ...DatePicker has some height... :-)

  I wonder what is the preferred way to handle this. I need to do
  something, as the DatePicker is not fully visiable. One solution
  surely is to put the LinearLayout inside a ScrollView. Do you have
  further suggestions?

  Thank you very much in advance.

  Regards
  Thomas
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] trouble with Contacts groups

2009-05-17 Thread Thomas

Hi group.

I want to be able to have persons that are synced wih Google, still
are not visible by default. My idea is to have then in a special group
but not in the system group Contacts. This is what I do:

I create a Contacts group as follows:

Uri uri = Contacts.Groups.CONTENT_URI;
ContentValues values = new ContentValues();
values.put(Contacts.GroupsColumns.NAME, name);
values.put(Contacts.GroupsColumns.SHOULD_SYNC, 1);
uri = cr.insert(uri, values);

This is how I create a person and add it to this group:

ContentValues personInfo = new ContentValues();
personInfo.put(Contacts.PeopleColumns.NAME, name);
ContentResolver cr = context.getContentResolver();
Uri newEntry = cr.insert(People.CONTENT_URI, personInfo);
Cursor c = cr.query(newEntry, new String[] { BaseColumns._ID }, null,
null, null);
if ((c != null)  (c.moveToFirst())) {
long personId = c.getLong(0);
Contacts.People.addToGroup(cr, personId, groupId);
}

On the emulator this works just fine. But on a real G1 it appears that
after some seconds (possibly after it has been synced with Google) the
contact also belongs to the system group Contacts,

Any idea how to prevent this? To put it more generally, what I need is
to be able to create persons that are part of the contacts list, still
they are not shown by default.

Thank you very much in advance.

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



[android-developers] Re: How to set some lists in one layout?

2009-05-17 Thread Daehoon Jeon
Can you show me a simple ex.?
Actually I don't know how to use multiple ListView widget.

If this is two lists in main xml.
ListView
  android:id=@android:id/list1
 android:layout_width=fill_parent
 android:layout_height=wrap_content /
ListView
  android:id=@android:id/list2
 android:layout_width=fill_parent
 android:layout_height=wrap_content /

ListView ls1=(ListView)findViewById(R.id.list1);
ListView ls2=(ListView)findViewById(R.id.list2);

then how to set List?
???
SimpleCursorAdapter notes =
  new SimpleCursorAdapter(this, R.layout.notes_row_weekly,
notesCursor, from, to);
  setListAdapter(notes); ???

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



[android-developers] Re: How to set some lists in one layout?

2009-05-17 Thread Mark Murphy

 Can you show me a simple ex.?

Not readily. I do not know of an example with multiple ListViews, since
that is an uncommon UI pattern.

 If this is two lists in main xml.
 ListView
   android:id=@android:id/list1
  android:layout_width=fill_parent
  android:layout_height=wrap_content /
 ListView
   android:id=@android:id/list2
  android:layout_width=fill_parent
  android:layout_height=wrap_content /

No.

Step #1: Switch away from ListActivity and just use Activity. ListActivity
is simply confusing you.

Step #2: Replace your android:id values in the above XML with ones that
look like

android:id=@+id/list1
android:id=@+id/list2

 ListView ls1=(ListView)findViewById(R.id.list1);
 ListView ls2=(ListView)findViewById(R.id.list2);

If you follow the above steps, those statements will work.

 then how to set List?
 ???
 SimpleCursorAdapter notes =
   new SimpleCursorAdapter(this, R.layout.notes_row_weekly,
 notesCursor, from, to);
   setListAdapter(notes); ???

ls1.setAdapter(), as documented in:

http://developer.android.com/reference/android/widget/ListView.html

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!



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



[android-developers] Re: NullPointerException : String imageFileName = myFile.imageFileName.toString(); when imageFileName is null

2009-05-17 Thread Mariano Kamp
You need to paste a bigger code sample then. The question would be then how
comes that imageFileName is null? You need to paste at least the part where
a value should have been assigned to it.

On Sun, May 17, 2009 at 6:21 AM, chrispix chris...@gmail.com wrote:


 Can you explain how it worked up until now? Maybe the file naming on
 the camera has changed?



 On May 16, 8:12 pm, Dianne Hackborn hack...@android.com wrote:
  Seriously, this never ever worked:
 
  String imageFileName;
  String theString = imageFileName.toString().
 
  Calling toString() on a null object has always and will always result in
 a
  NullPointerException.
 
 
 
 
 
  On Sat, May 16, 2009 at 2:41 PM, chrispix chris...@gmail.com wrote:
 
   Actually it did work prior to 1.5, it appears it has been fixed. You
   should give it a
   whirl! Thanks for the heads up on that.. Trying to make the migration
   from .NET to
   Java and some things that appeared like they would work apparently
   have changed
   some.
 
   Thanks again!
 
   Chris
 
   On May 16, 1:02 am, Romain Guy romain...@google.com wrote:
It couldn't have been working before 1.5. The only way to safely
convert an object to a String without a NullPointerException is to
 use
a StringBuilder/StringBuffer or use a String concatenation:
 
String imageFileName =  + myFile.imageFileName;
 
Or better yet, explicitly check for null :)
 
On Fri, May 15, 2009 at 10:10 PM,chrispixchris...@gmail.com wrote:
 
 if the value of imageFileName is null, why can I not change null
 into
 a string? It was working before 1.5.
 String imageFileName = myFile.imageFileName.toString();
 
 This gives me the a NullPointerException Error.
 
--
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.- 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] A suggested way to deal with long running tasks across context switches.

2009-05-17 Thread Parakoos

I was excited to see the introduction of the AsyncTask. Anything to
make the division of UI / Background work easier is good in my book.

What bugged me was that I couldn’t see a way to keep a long running
process alive during a context switch e.g. a layout orientation
change. As far as I could see, the common way to ‘solve’ the problem
was by stopping the process and then recreate it in the new Activity.
This will work in some cases, but in others it won’t work. For
example, a background task of creating a new user account on a website
cannot be re-sent easily.

I spent a day and hacked out an alternative way of doing things. My
approach was this.

* We know that the AsyncTask contains a Context which is the
Activity that creates it. So it must be destroyed when the Activity is
destroyed e.g. at a context switch due to a screen orientation change.
* Since we want to background task to continue ‘across’ a context
switch we cannot define the background task within the AsyncTask.
Instead we create a Future and pass that to some implementation of
AsyncTask that only wait for the Future to compute.
* At a context switch we can destroy the AsyncTask without
interrupting the Future which we can hold on to.
* When creating the new Activity post-context switch we create a
new fresh ASyncTask and give it the same still running Future.

The easiest way to understand this is to see it in action. I've
uploaded an example implementation of the above idea to:
http://www.shodansoftware.com/DevelopmentTools/BackgroundProcesses

You're free to check it out and make use of it as you please. If you
do use it though, I'd appreciate if you'd let me know just so I can
get that warm fuzzy feeling of having helped someone out. If you have
comments or suggestions, again, I'd like to know.

Thanks!

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



[android-developers] Re: How to set some lists in one layout?

2009-05-17 Thread Daehoon Jeon
If I write list ids like that I can't show list where I want to.I have
to separate id to two ListView .


 ls1.setAdapter(notes);
 ls2.setAdapter(notes);
this is not working.

I should set list with setListAdapter, but ListView does not support
setListAdaper.

 ls1.setListAdapter(notes);//The method setListAdapter(SimpleCursorAdapter)
is undefined for the type ListView
how to solve this problem ?

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



[android-developers] Re: How to set some lists in one layout?

2009-05-17 Thread Mark Murphy

 If I write list ids like that I can't show list where I want to.

Yes, you can. ListViews work like any other widgets.

 I have
 to separate id to two ListView .

Correct. That is what I wrote.

  ls1.setAdapter(notes);
  ls2.setAdapter(notes);
 this is not working.

It should.

 I should set list with setListAdapter

No, you shouldn't.

 but ListView does not support
 setListAdaper.

Correct. It supports setAdapter().

 how to solve this problem ?

Use setAdapter(), as I wrote last time.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!



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



[android-developers] Re: Errors on Windows 7

2009-05-17 Thread Al Sutton

I've just run my own tests with the Google 1.5_r1 SDK and Win 7 RC 32 bit and 
it worked without any problems and without the need to use compatibility mode.

I used a clean fresh install of Win 7 RC from the DVD and unzipped the SDK 
downloaded from Googles site.

Maybe something you've installed is causing problems (did you try and do an 
upgrade in place of a Win7 Beta?).

Al.

---

* Written an Android App? - List it at http://andappstore.com/ *

==
Funky Android Limited is registered in England  Wales with the 
company number  6741909. The registered head office is Kemp House, 
152-160 City Road, London,  EC1V 2NX, UK. 

The views expressed in this email are those of the author and not 
necessarily those of Funky Android Limited, it's associates, or it's 
subsidiaries. 


-Original Message-
From: android-developers@googlegroups.com 
[mailto:android-develop...@googlegroups.com] On Behalf Of Al Sutton
Sent: 16 May 2009 08:41
To: android-developers@googlegroups.com
Subject: [android-developers] Re: Errors on Windows 7


Have you tried connecting an Android 'phone and using adb?

I've never been able to get it adb to a device working on Vista, and despite 
moving from SP1 to SP2 RC, re-installing the driver, and everything else all I 
ever get is The device cannot start (Code 10) in device manager, so I'd be 
interested to know if the driver works on Win 7.

Al.

---

* Written an Android App? - List it at http://andappstore.com/ *

==
Funky Android Limited is registered in England  Wales with the 
company number  6741909. The registered head office is Kemp House, 
152-160 City Road, London,  EC1V 2NX, UK. 

The views expressed in this email are those of the author and not 
necessarily those of Funky Android Limited, it's associates, or it's 
subsidiaries. 

-Original Message-
From: android-developers@googlegroups.com 
[mailto:android-develop...@googlegroups.com] On Behalf Of info+farm
Sent: 15 May 2009 23:46
To: Android Developers
Subject: [android-developers] Errors on Windows 7


Dear all,

I installed the brand new Windows 7 RC Ultimate and tried to run
Android tools on it.
Unfortunately, tools(aapt, emulator ...) do not work on the new OS.

aapt.exe give Error;
Problem signature:
  Problem Event Name:   APPCRASH
  Application Name: aapt.exe
  Application Version:  0.0.0.0
  Application Timestamp:49ee9d70
  Fault Module Name:ntdll.dll
  Fault Module Version: 6.1.7100.0
  Fault Module Timestamp:   49eeb132
  Exception Code:   c008
  Exception Offset: 00039fef
  OS Version:   6.1.7100.2.0.0.256.1
  Locale ID:1033
  Additional Information 1: 0a9e
  Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
  Additional Information 3: 0a9e
  Additional Information 4: 0a9e372d3b4ad19135b953a78882e789

emulator.exe gives Error;
Problem signature:
  Problem Event Name:   APPCRASH
  Application Name: emulator.exe
  Application Version:  0.0.0.0
  Application Timestamp:49ee9cd3
  Fault Module Name:msvcrt.dll
  Fault Module Version: 7.0.7100.0
  Fault Module Timestamp:   49eeb128
  Exception Code:   8003
  Exception Offset: 0006d73c
  OS Version:   6.1.7100.2.0.0.256.1
  Locale ID:1033
  Additional Information 1: 0a9e
  Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
  Additional Information 3: 0a9e
  Additional Information 4: 0a9e372d3b4ad19135b953a78882e789

I just sent this post to inform users that Android tools are not
working on Windows 7 RC right now. If there are people, who have the
workaround for this, I will be appreciated to hear it.

Best,
jojo




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

2009-05-17 Thread Pierre Bonnefoy

The link you used can no longuer work with the new version of the sdk
because the parameters to pass to the emulator when you launch it have
changed.

Basically, what was described could work (the other methods described
in the answers requires that you install eclipse, which is not
mandatory if you just want to do in browser testings).

I know that the details of the correst command line have been
exchanged already on those lists, so with a fine search, you should be
able to find it, or one cool guy on this list should be able to give
it to you.

Regards


2009/5/17 Raphael r...@android.com:

 If you install via an ADT zip file, make sure you get the latest (0.9.1).

 Rather than using the zip file, use the update size in Eclipse to
 automatically get the latest version
 (https://dl-ssl.google.com/android/eclipse/). Remember that for most
 people this fails via https so just use the http link
 (http://dl-ssl.google.com/android/eclipse/).

 R/

 On Sat, May 16, 2009 at 10:03 PM, Nithin Varamballi nithi...@gmail.com 
 wrote:

 HI..

  I installed 1.5sdk successfully... First remove older ADT
 files...  And download the 0.9 ADT.. Its zip file.. After removing the
 old  ADT following steps
 i followed... In eclipse

 1- Help
 2- Software updates
 3- Available Software
 4- Add site
 5- Archive(add the ADTzip file located in your disk)
 6- Ok

 After installing i change the older 1.1 SDK path to 1.5

 1- windows
 2- preferences
 3- click android
 4- set sdk location from your disk
 5- Apply
 6- restart eclipse

 Thank You
 Nithin N V
 - 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: How to set some lists in one layout?

2009-05-17 Thread Daehoon Jeon
How do we get data from DB to the list?If I use setListAdapter I can get
data from DB like this :
 Cursor notesCursor = mDbHelper.fetchAllNotes();
  startManagingCursor(notesCursor);
  String[] from = new String[]{NotesDbAdapter.KEY_TITLE};
  int[] to = new int[]{R.id.text1};
  SimpleCursorAdapter notes =
  new SimpleCursorAdapter(this, R.layout.notes_row_weekly,
  notesCursor, from, to);
  setListAdapter(notes);

If use ls1.setList(); how to get data?

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

2009-05-17 Thread scorpio

Hi,

I added third party jar.It builds, but when executed showing
java.lang.verifyerror, what shall I do. Shall I unzip the jar, and
include all java classes that I needed.  I feel its an option, any
other better option is there.

What may be the exact reason for this error

Thanks
Nithin

On May 15, 1:04 am, Nithin nithin.war...@gmail.com wrote:
 Hi,

 I added a third party jar in my application and tried to run, but its
 showing, java.lang.VerifyError...

 What maybe he reason for this issue, please help

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



[android-developers] Re: How to set some lists in one layout?

2009-05-17 Thread Mark Murphy


 How do we get data from DB to the list?If I use setListAdapter I can get
 data from DB like this :
  Cursor notesCursor = mDbHelper.fetchAllNotes();
   startManagingCursor(notesCursor);
   String[] from = new String[]{NotesDbAdapter.KEY_TITLE};
   int[] to = new int[]{R.id.text1};
   SimpleCursorAdapter notes =
   new SimpleCursorAdapter(this, R.layout.notes_row_weekly,
   notesCursor, from, to);
   setListAdapter(notes);

 If use ls1.setList(); how to get data?

ls1.setAdapter(notes);

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!



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



[android-developers] Emulating GPS using DDMS on sdk 1.5 not working on an sdk 1.1 application run on a 1.1 sdk emulator

2009-05-17 Thread RodgerWilko!

Hi,

Has anyone else had this or know a solution?

I've just upgraded to sdk 1.5 and i'm trying to pump in fake gps co-
orindates using ddms and a gpx file on an application/emulator running
on the old sdk 1.1.  When I press the play button the emulator dose
not recieve the GPS updates which i've signed up for using a
locationlistener.

This use to work fine when I was developing using the sdk 1.1 using a
1.1 emulator in eclipse, i'm not sure why it has stopped working when
I upgraded to sdk 1.5 or how to get it working again, please help!!

Just to test, I ran the program with a target of 1.5 on a 1.5 sdk
emulator and the emulator picked up the new GPS co-ordinates perfectly
so it's really confusing!

Thanks in advance,

RodgerWilko!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Market countries - how are they determined ?

2009-05-17 Thread kiu

In the android market the countries where your app should be published
can be selected.

How is the country determined ?

Where the device was bought ?
Which country SIM is inserted ?
Which GSM network it is currently connected to ?
Which country was specified in the google account ?

Simon
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Emulating GPS using DDMS on sdk 1.5 not working on an sdk 1.1 application run on a 1.1 sdk emulator

2009-05-17 Thread RodgerWilko!

Ok - this was a strange one.  My application used the SD-card to
access data and the emulators virtual SD-card had a lock on it
(indicated by a directory with a .lock extension) .. so the
application was not recieving the updates as it could not access the
data on the SD-card ..

I removed the directory and the location updates started to flow!

On May 17, 9:06 pm, RodgerWilko! lach.mcc...@gmail.com wrote:
 Hi,

 Has anyone else had this or know a solution?

 I've just upgraded to sdk 1.5 and i'm trying to pump in fake gps co-
 orindates using ddms and a gpx file on an application/emulator running
 on the old sdk 1.1.  When I press the play button the emulator dose
 not recieve the GPS updates which i've signed up for using a
 locationlistener.

 This use to work fine when I was developing using the sdk 1.1 using a
 1.1 emulator in eclipse, i'm not sure why it has stopped working when
 I upgraded to sdk 1.5 or how to get it working again, please help!!

 Just to test, I ran the program with a target of 1.5 on a 1.5 sdk
 emulator and the emulator picked up the new GPS co-ordinates perfectly
 so it's really confusing!

 Thanks in advance,

 RodgerWilko!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: AChartEngine - a charting framework for Android applications

2009-05-17 Thread Dan Dromereschi

Hi,

The newly released version of AChartEngine (0.3.0) supports the
features that you have requested:
 * vertical X axis charts (only horizontal X axis charts were
supported previously) - available for the bar, line, area, time and
scatter charts
 * text on top of the chart value (or on the right side for the
vertical X axis charts)
 * custom text instead of automatically computed labels

Instructions on how to download and import in Eclipse an example
project with source code included can be found here
http://www.achartengine.org/content/goodies.html

Please see the screenshots available here 
http://www.achartengine.org/content/news.html
for a visual description of the new features.
Please keep sending us any kind of feedback, comments or ideas by
email, google group or by using our forum available at
http://www.achartengine.org/forum

Regards,

Dan

http://www.4viewsoft.com
http://www.achartengine.com



On Mar 30, 3:14 pm, sheik sheik...@gmail.com wrote:
 Hi,
  i have downloaded theachartenginejar file and worked on some
 examples . From past few days i was looking for the implementation of
 charts in android ... i think it has given the solution

 But still i have some concerns regarding the Barcharts in the tilted
 form.I shall attach the png file of barchart in tilted
 form .Kindly let me know is it possible using your api...any examples
 or code will be appreciated

 Keep up the good work...

 regards,
 Sheik

 On Mar 2, 7:18 pm, Dan dandromeres...@gmail.com wrote:

  Hello,

  We are proud to announce that the 0.2.0 version ofAChartEnginewas
  released.AChartEngineis a charting library forAndroidapplications.
  It supports the following chart types:
      * line chart
      * area chart
      * scatter chart
      * time chart
      * bar chart
      * pie chart

  All the above supported chart types can contain multiple series. Any
  chart can be built as a view that can be added to a view group or as
  an intent for starting an activity.
  New chart types will be added in the following releases of the
  library. Please send any kind of feedback that you have related to
  this library. The 0.3.0 release is planned for the end of March.

  You can visit the project website at:http://www.achartengine.org
  The library, the javadocs and a demo source code project can be
  downloaded fromhttp://code.google.com/p/achartengine

  Regards,

  Dan

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



[android-developers] Help : H324m compilation flags ( play from file recording into file )

2009-05-17 Thread srinu gorle

Hi All,
i would like to test 2wayEngine with 324 supprot in opencore with all
flags  combinations .

But i have failed to compile the 2Wayengine code with the follwing
flags PV_PLAY_FROM_FILE_SUPPORT, PV_RECORD_TO_FILE_SUPPORT.
i enabled these flags in the /engines/2way/test/build/local.mk
even i have tried enable the above flags in /engines/2way/Android.mk

its giving the follwing errors

pv_2way_engine.cpp:32:30: error: playfromfilenode.h: No such file or directory
pv_2way_engine.cpp:45:32: error: pvmf_splitter_node.h: No such file or directory
pv_2way_engine.cpp:72:39: error: pvvideoencmdfnode_factory.h: No such
file or directory
pv_2way_engine.cpp:76:34: error: pvdevsound_node_base.h: No such file
or directory

i couldnt find out the above required files in the opencore. i would
like to know why they have mentioned the file's under the conditional
compilation.

please let me know how can i resolve it.

Thanks.

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



[android-developers] Re: 'Take a picture' intent on 1.5

2009-05-17 Thread fala70

did you solve ? I've same problem

On 5 Mag, 00:24, BoD bodl...@gmail.com wrote:
 Anyone?

 Thanks for your help!

 BoD

 On May 4, 12:46 am, BoD bodl...@gmail.com wrote:

  Hi!

  Following this old 
  thread:http://groups.google.com/group/android-developers/browse_thread/threa...

  and this issue:http://code.google.com/p/android/issues/detail?id=1480

  I tried the following piece of code to take a picture on 1.5:

      private void takePic2() {
          final Intent imageCaptureIntent = new Intent
  (MediaStore.ACTION_IMAGE_CAPTURE);
          imageCaptureIntent.putExtra(MediaStore.EXTRA_OUTPUT,
  Uri.fromFile(new File(Environment
                  .getExternalStorageDirectory(), test.jpg)));
          startActivityForResult(imageCaptureIntent, 1);
      }

  It works but the resulting image is 512x384 (on the ADP1).

  The doc says If the EXTRA_OUTPUT is not present, then a small sized
  image is returned as a Bitmap object in the extra field. If the
  EXTRA_OUTPUT is present, then the full-sized image will be written to
  the Uri value of EXTRA_OUTPUT.

  But 512x384 looks 'rather small-sized' to me!

  So what the correct way to get the full-sized version?

  Thanks a lot for your help!

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

2009-05-17 Thread Mr.No

No, there is no EditText for the HomeScreen Widget

On 14 Mai, 14:14, pMay eniak.i...@googlemail.com wrote:
 It doesnt work with 1.5?

 On May 6, 10:32 am, Mr.No f.hi...@arcor.de wrote:

  Hello,
  in which Android-SDK version their will be a EditText for the
  App.Widget?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: aidl remote service call namespace question

2009-05-17 Thread dev_rob

I now have the TestInterface.aidl in both eclipse projects and project
2 (the service project) is added to project 1's build path.

I declared the service in the manifest-file with:

service android:name=.TestStringService
android:exported=true
android:process=:remote
intent-filter 
action android:name=de.roberlin.new_rpc.action.NEW_RPC/
/intent-filter
/service

and adb shell dumpsys package shows it successfully registered to
the emulator.

I try to bind to the service with:

String intentAction = de.roberlin.new_rpc.action.NEW_RPC;
Intent iService = new Intent(intentAction);
bindService(iService, myService, Context.BIND_AUTO_CREATE);

DDMS won't stop telling me:

05-17 14:14:34.285: WARN/ActivityManager(567): Unable to start
service Intent { action=de.roberlin.new_rpc.action.NEW_RPC }: not
found

In fact, after running project 1 (the activity binding to the service)
and getting the error message, when I do

adb shell dumpsys package

again, it does not list my service anymore. how can this be???

the steps were:

1.) installing the service onto a new emulator (adb shell dumpsys
package lists it then correctly)

2.) installing/running project 1 (leads to the error message above)

3.) now adb shell dumpsys package does not list the service anymore.
even if i reinstall it, it won't be listed anymore until I start a new
emulator and intall it freshly.

I really do not know, how to deal with this and would be really
thankful for any help!!

best regards!

On 17 Mai, 08:25, Dianne Hackborn hack...@android.com wrote:
 For the second question, you'll either want to define an abstract action in
 an intent-filter for the service and use that as the intent you bind to
 (typically the action is the name of the desired interface for binding to
 services), or create an explicit ComponentName with the package name + class
 name of the service being bound to and provide that to the Intent.  For this
 latter, make sure you have set android:exported=true for the service.

 Sorry I can't really help you with the first question, since I don't know
 ADT that well.  Basically you will need to have both applications like the
 generated aidl code into their app.



 On Sat, May 16, 2009 at 8:46 AM, dev_rob robwiene...@googlemail.com wrote:

  Hi android developers,

  I'm new to the great android platform, trying to get into RPC with
  aidl and services.

  I didn't find a sufficient answer to my problem in any posts, if there
  already is one, please excuse and point me to it, thanks.

  I made 2 projects.

  project 1 hast an activity that binds to a service from project 2 on a
  button click (all just for testing).

  1. issue:

  How can I make project 1 know (import) my TestInterface (from
  TestInterface.aidl out of project 2) for usage in:

  TestInterface mService = (TestInterface)
  TestInterface.Stub.asInterface(service);

  without adding project 2 to the build path, because if I'd have an
  installed service without the project code, I couldn't do it this way,
  too...??
  I read in one thread that TestInterface.aidl should just be added to
  project 1, too, but if I do this, in DDMS enforceInterface() complains
  and seems to just see/use the interface from project 1 and it doesn't
  work.

  2. issue:

  (here i add project 2 to project 1's build path, which i still think
  is not how it should work)

  If i bind to a system service, i can simply do something like

  bindService(new Intent(com.android.A_SERVICE);

  but if i have my own service in project 2, something like

  bindService(new Intent(com.project2.A_SERVICE);

  does not work (of course, service 2 is installed on the emulator at
  that point, i provide an intent-filter an set the android:exported-
  attribute to true). the error i get is:

  05-16 15:06:06.384: ERROR/dalvikvm(820): Could not find method
  de.roberlin.new_rpc.TestInterface$Stub.asInterface, referenced from
  method de.roberlin.new_rpc.New_RPC_Client$2.onServiceConnected
  

  this error makes really no sense to me, any suggestions?

  btw: i ran adb shell dumpsys package and my Service is registered:

  Service Resolver Table:
  ...
  Non-Data Actions:
       ...
       de.roberlin.new_rpc.action.NEW_RPC:
         436578f0 de.roberlin.new_rpc/.TestStringService

  The code from both projects can be reviewed at
 http://pastebin.com/f4bd0bc10

  I hope my points (special concern lies on the error message..) are not
  to nooby.

  I'd really appreciate any help! Thanks in advance!

 --
 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] Re: aidl remote service call namespace question

2009-05-17 Thread Dianne Hackborn
Er... you are sure that both .apks have different package names?  Anyway it
sounds like whatever problem you have has nothing to do with services
themselves, but just getting both apps installed at the same time?

On Sun, May 17, 2009 at 7:35 AM, dev_rob robwiene...@googlemail.com wrote:


 I now have the TestInterface.aidl in both eclipse projects and project
 2 (the service project) is added to project 1's build path.

 I declared the service in the manifest-file with:

 service android:name=.TestStringService
android:exported=true
android:process=:remote
intent-filter 
action android:name=de.roberlin.new_rpc.action.NEW_RPC/
/intent-filter
 /service

 and adb shell dumpsys package shows it successfully registered to
 the emulator.

 I try to bind to the service with:

 String intentAction = de.roberlin.new_rpc.action.NEW_RPC;
Intent iService = new Intent(intentAction);
 bindService(iService, myService, Context.BIND_AUTO_CREATE);

 DDMS won't stop telling me:

 05-17 14:14:34.285: WARN/ActivityManager(567): Unable to start
 service Intent { action=de.roberlin.new_rpc.action.NEW_RPC }: not
 found

 In fact, after running project 1 (the activity binding to the service)
 and getting the error message, when I do

 adb shell dumpsys package

 again, it does not list my service anymore. how can this be???

 the steps were:

 1.) installing the service onto a new emulator (adb shell dumpsys
 package lists it then correctly)

 2.) installing/running project 1 (leads to the error message above)

 3.) now adb shell dumpsys package does not list the service anymore.
 even if i reinstall it, it won't be listed anymore until I start a new
 emulator and intall it freshly.

 I really do not know, how to deal with this and would be really
 thankful for any help!!

 best regards!

 On 17 Mai, 08:25, Dianne Hackborn hack...@android.com wrote:
  For the second question, you'll either want to define an abstract action
 in
  an intent-filter for the service and use that as the intent you bind to
  (typically the action is the name of the desired interface for binding to
  services), or create an explicit ComponentName with the package name +
 class
  name of the service being bound to and provide that to the Intent.  For
 this
  latter, make sure you have set android:exported=true for the service.
 
  Sorry I can't really help you with the first question, since I don't know
  ADT that well.  Basically you will need to have both applications like
 the
  generated aidl code into their app.
 
 
 
  On Sat, May 16, 2009 at 8:46 AM, dev_rob robwiene...@googlemail.com
 wrote:
 
   Hi android developers,
 
   I'm new to the great android platform, trying to get into RPC with
   aidl and services.
 
   I didn't find a sufficient answer to my problem in any posts, if there
   already is one, please excuse and point me to it, thanks.
 
   I made 2 projects.
 
   project 1 hast an activity that binds to a service from project 2 on a
   button click (all just for testing).
 
   1. issue:
 
   How can I make project 1 know (import) my TestInterface (from
   TestInterface.aidl out of project 2) for usage in:
 
   TestInterface mService = (TestInterface)
   TestInterface.Stub.asInterface(service);
 
   without adding project 2 to the build path, because if I'd have an
   installed service without the project code, I couldn't do it this way,
   too...??
   I read in one thread that TestInterface.aidl should just be added to
   project 1, too, but if I do this, in DDMS enforceInterface() complains
   and seems to just see/use the interface from project 1 and it doesn't
   work.
 
   2. issue:
 
   (here i add project 2 to project 1's build path, which i still think
   is not how it should work)
 
   If i bind to a system service, i can simply do something like
 
   bindService(new Intent(com.android.A_SERVICE);
 
   but if i have my own service in project 2, something like
 
   bindService(new Intent(com.project2.A_SERVICE);
 
   does not work (of course, service 2 is installed on the emulator at
   that point, i provide an intent-filter an set the android:exported-
   attribute to true). the error i get is:
 
   05-16 15:06:06.384: ERROR/dalvikvm(820): Could not find method
   de.roberlin.new_rpc.TestInterface$Stub.asInterface, referenced from
   method de.roberlin.new_rpc.New_RPC_Client$2.onServiceConnected
   
 
   this error makes really no sense to me, any suggestions?
 
   btw: i ran adb shell dumpsys package and my Service is registered:
 
   Service Resolver Table:
   ...
   Non-Data Actions:
...
de.roberlin.new_rpc.action.NEW_RPC:
  436578f0 de.roberlin.new_rpc/.TestStringService
 
   The code from both projects can be reviewed at
  http://pastebin.com/f4bd0bc10
 
   I hope my points (special concern lies on the error message..) are not
   to nooby.
 
   I'd really appreciate any help! Thanks in advance!
 
  --
  Dianne Hackborn
  Android 

[android-developers] Sprite imaging for 2D game programming

2009-05-17 Thread g1port.com

Hi guys,

For a 2D game programming, I'm trying to learn about loading
an image file for all states of a game character (simply a walking
soldier lets say) and simply animate it. I think this classic method
is called as sprite imaging that you load whole image of all states of
the character that you want to animate.

Is there anyone that can provide some sample code about this or at
least can you tell me which classes to use, how to refer some 'part
of' whole image file and animate it etc.

Your help is much appreciated.

Thanks a lot.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: A suggested way to deal with long running tasks across context switches.

2009-05-17 Thread Dianne Hackborn
Async task doesn't take a Context, so I think you are making this more
complicated than it needs to be.  You can just propagate an active AsyncTask
through onRetainNonConfigurationInstance() as long as the object doesn't
have any ties to the current activity -- so basically make sure it is static
(if an inner class), and be able to change its pointer back to the Activity
or whatever when you get it in the next activity's onCreate() after
onRetainNonConfigurationInstance().

On Sun, May 17, 2009 at 1:26 AM, Parakoos parak...@gmail.com wrote:


 I was excited to see the introduction of the AsyncTask. Anything to
 make the division of UI / Background work easier is good in my book.

 What bugged me was that I couldn’t see a way to keep a long running
 process alive during a context switch e.g. a layout orientation
 change. As far as I could see, the common way to ‘solve’ the problem
 was by stopping the process and then recreate it in the new Activity.
 This will work in some cases, but in others it won’t work. For
 example, a background task of creating a new user account on a website
 cannot be re-sent easily.

 I spent a day and hacked out an alternative way of doing things. My
 approach was this.

* We know that the AsyncTask contains a Context which is the
 Activity that creates it. So it must be destroyed when the Activity is
 destroyed e.g. at a context switch due to a screen orientation change.
* Since we want to background task to continue ‘across’ a context
 switch we cannot define the background task within the AsyncTask.
 Instead we create a Future and pass that to some implementation of
 AsyncTask that only wait for the Future to compute.
* At a context switch we can destroy the AsyncTask without
 interrupting the Future which we can hold on to.
* When creating the new Activity post-context switch we create a
 new fresh ASyncTask and give it the same still running Future.

 The easiest way to understand this is to see it in action. I've
 uploaded an example implementation of the above idea to:
 http://www.shodansoftware.com/DevelopmentTools/BackgroundProcesses

 You're free to check it out and make use of it as you please. If you
 do use it though, I'd appreciate if you'd let me know just so I can
 get that warm fuzzy feeling of having helped someone out. If you have
 comments or suggestions, again, I'd like to know.

 Thanks!

 Gustav a.k.a. Parakoos
 



-- 
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: aidl remote service call namespace question

2009-05-17 Thread dev_rob

I think it's rather a problem with namespaces. And the package names
in both projects are indeed identical!

But as (one of my original questions) both projects have to contain
the TestInterface.aidl the package names must be the same, because
otherwise there is a different package name in TestInterface.aidl and
then it's not the same interface anymore and enforceInterface()
complains about that...

If you have a suggestion for this issue, it would be great (I guess
there is a simple solution for this)! I could see then, if that has
something to do with the fact, that the service seems not to be
registered after executing the calling activity (project 1).

Thanks again!

On 17 Mai, 17:21, Dianne Hackborn hack...@android.com wrote:
 Er... you are sure that both .apks have different package names?  Anyway it
 sounds like whatever problem you have has nothing to do with services
 themselves, but just getting both apps installed at the same time?



 On Sun, May 17, 2009 at 7:35 AM, dev_rob robwiene...@googlemail.com wrote:

  I now have the TestInterface.aidl in both eclipse projects and project
  2 (the service project) is added to project 1's build path.

  I declared the service in the manifest-file with:

  service android:name=.TestStringService
         android:exported=true
         android:process=:remote
         intent-filter 
                 action android:name=de.roberlin.new_rpc.action.NEW_RPC/
         /intent-filter
  /service

  and adb shell dumpsys package shows it successfully registered to
  the emulator.

  I try to bind to the service with:

  String intentAction = de.roberlin.new_rpc.action.NEW_RPC;
                         Intent iService = new Intent(intentAction);
  bindService(iService, myService, Context.BIND_AUTO_CREATE);

  DDMS won't stop telling me:

  05-17 14:14:34.285: WARN/ActivityManager(567): Unable to start
  service Intent { action=de.roberlin.new_rpc.action.NEW_RPC }: not
  found

  In fact, after running project 1 (the activity binding to the service)
  and getting the error message, when I do

  adb shell dumpsys package

  again, it does not list my service anymore. how can this be???

  the steps were:

  1.) installing the service onto a new emulator (adb shell dumpsys
  package lists it then correctly)

  2.) installing/running project 1 (leads to the error message above)

  3.) now adb shell dumpsys package does not list the service anymore.
  even if i reinstall it, it won't be listed anymore until I start a new
  emulator and intall it freshly.

  I really do not know, how to deal with this and would be really
  thankful for any help!!

  best regards!

  On 17 Mai, 08:25, Dianne Hackborn hack...@android.com wrote:
   For the second question, you'll either want to define an abstract action
  in
   an intent-filter for the service and use that as the intent you bind to
   (typically the action is the name of the desired interface for binding to
   services), or create an explicit ComponentName with the package name +
  class
   name of the service being bound to and provide that to the Intent.  For
  this
   latter, make sure you have set android:exported=true for the service.

   Sorry I can't really help you with the first question, since I don't know
   ADT that well.  Basically you will need to have both applications like
  the
   generated aidl code into their app.

   On Sat, May 16, 2009 at 8:46 AM, dev_rob robwiene...@googlemail.com
  wrote:

Hi android developers,

I'm new to the great android platform, trying to get into RPC with
aidl and services.

I didn't find a sufficient answer to my problem in any posts, if there
already is one, please excuse and point me to it, thanks.

I made 2 projects.

project 1 hast an activity that binds to a service from project 2 on a
button click (all just for testing).

1. issue:

How can I make project 1 know (import) my TestInterface (from
TestInterface.aidl out of project 2) for usage in:

TestInterface mService = (TestInterface)
TestInterface.Stub.asInterface(service);

without adding project 2 to the build path, because if I'd have an
installed service without the project code, I couldn't do it this way,
too...??
I read in one thread that TestInterface.aidl should just be added to
project 1, too, but if I do this, in DDMS enforceInterface() complains
and seems to just see/use the interface from project 1 and it doesn't
work.

2. issue:

(here i add project 2 to project 1's build path, which i still think
is not how it should work)

If i bind to a system service, i can simply do something like

bindService(new Intent(com.android.A_SERVICE);

but if i have my own service in project 2, something like

bindService(new Intent(com.project2.A_SERVICE);

does not work (of course, service 2 is installed on the emulator at
that point, i provide an intent-filter an set the android:exported-
attribute to 

[android-developers] Fastest way to load images

2009-05-17 Thread The Savage Killer

Hey, I'm currently developing a game, and I need to know the best way
to reference its sprites for drawing. Right now I have a pretty simple
runnable thread that starts after the application starts, so it
doesn't hang, and loads up every drawable to a variable. Like so;

new Thread(new Runnable() {
public void run() {
Resources res = mContext.getResources();
BackgroundImage = res.getDrawable
(R.drawable.clouds2);
   mBackgroundRays = res.getDrawable
(R.drawable.lightrays);
   mBackgroundLoaded = true;
   mMenuBunz = res.getDrawable(R.drawable.menu);
mMenuLoaded = true;
mGameLayout = res.getDrawable
(R.drawable.game);
mFoods[0] = res.getDrawable(R.drawable.bunbot);
mFoods[1] = res.getDrawable(R.drawable.patty);
mFoods[2] = res.getDrawable(R.drawable.pattybad);
mFoods[3] = res.getDrawable(R.drawable.gold);
mFoods[4] = res.getDrawable(R.drawable.bacon);
mFoods[5] = res.getDrawable(R.drawable.baconbad);
mFoods[6] = res.getDrawable(R.drawable.cheese);
mFoods[7] = res.getDrawable(R.drawable.cheesebad);
mFoods[8] = res.getDrawable(R.drawable.onions);
mFoods[9] = res.getDrawable(R.drawable.onionsbad);
mFoods[10] = res.getDrawable(R.drawable.tomatoes);
mFoods[11] = res.getDrawable(R.drawable.tomatoesbad);
mFoods[12] = res.getDrawable(R.drawable.lettuce);
mFoods[13] = res.getDrawable(R.drawable.lettucebad);
mFoods[14] = res.getDrawable(R.drawable.buntop);
mFoods[15] = res.getDrawable(R.drawable.life);
mFallingFood[0] = new Food();
mFallingFood[1] = new Food();
mFallingFood[2] = new Food();
mFallingFood[3] = new Food();
mFallingFood[4] = new Food();
mFallingFoods = FOOD_MAX_FALLING;
mGameLoaded = true;
mMenuScores = res.getDrawable(R.drawable.highscore);
mScoresLoaded = true;
mMenuHelp = res.getDrawable(R.drawable.help);
mHelpLoaded = true;

mResLoaded = true;
}
  }).start();

That's about 700kb worth of images loaded, but its loading times on
the phone are random. Sometime the images take 5 seconds to load and
at other times they can take up to 20 seconds. Can someone please tell
me how to properly load up my sprites? Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: video play error

2009-05-17 Thread Marco Nelissen

On Sat, May 16, 2009 at 9:51 PM, Nithin Varamballi nithi...@gmail.com wrote:

 Thanks for reply...

           But i tried another video i e test.mp4 through sdcard...
 But it works fine
 May emulator support all .mp4 files...?

Not really, for two reasons. First of all, mp4 is a container
format, not an encoding, and this container can contain various
encoded streams, including unsupported ones. Second, even if the
format is a supported one like H.264, the emulator would have to
decode it in software (whereas the phone has hardware support), and
might not be fast enough to keep up.

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

2009-05-17 Thread schwiz

take a look at this reference
http://developer.android.com/guide/topics/resources/available-resources.html

and take a look through some of the tutorials here
http://www.anddev.org/

On May 17, 10:23 am, g1port.com gmt...@gmail.com wrote:
         Hi guys,

         For a 2D game programming, I'm trying to learn about loading
 an image file for all states of a game character (simply a walking
 soldier lets say) and simply animate it. I think this classic method
 is called as sprite imaging that you load whole image of all states of
 the character that you want to animate.

 Is there anyone that can provide some sample code about this or at
 least can you tell me which classes to use, how to refer some 'part
 of' whole image file and animate it etc.

         Your help is much appreciated.

         Thanks a lot.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] SoftKeyboard Example Problem

2009-05-17 Thread BlackLight

Hello.

I'm trying to understand how SoftKeyboard example from sdk 1.5 works.
I made apk and installed it on emulator 1.5. I see only default
keyboard (Android Keyboard). Please, give me some information (url?)
to read more about custom softkeyboards.

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



[android-developers] Re: SoftKeyboard Example Problem

2009-05-17 Thread Menny

If you run the sample in 1.5 SDK in the emulator, you'll be able to
use it by enabling it in Settings-Localetext.
Then go to any text-box, and do long press on it, till a context menu
will open up.
Select from this menu Input method, and select the new soft
keyboard.

On May 17, 6:56 pm, BlackLight blacklight1...@gmail.com wrote:
 Hello.

 I'm trying to understand how SoftKeyboard example from sdk 1.5 works.
 I made apk and installed it on emulator 1.5. I see only default
 keyboard (Android Keyboard). Please, give me some information (url?)
 to read more about custom softkeyboards.

 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] trouble with using keyboard-input to move things on screen, using requestFocus, OnKeyListener etc unsuccessfully.

2009-05-17 Thread klirr

package com.android.shmup;

import android.app.Activity;
import android.content.Context;
import android.graphics.*;
import android.os.Bundle;
import android.view.View;
import android.view.KeyEvent;
import android.view.View.OnKeyListener;

public class Shmup extends Activity { //GraphicsActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(new GameView(this));
}

private static class GameView extends View implements
OnKeyListener {
private Paint mPaint = new Paint();
private int x;
private int y;

public GameView(Context context) {
super(context);
x = 135;
y = 303;
setOnKeyListener(this);
requestFocus();
}

@Override
protected void onDraw(Canvas canvas) {
Paint paint = mPaint;
canvas.translate(10, 10);
canvas.drawColor(Color.rgb(184,134,11));
paint.setColor(Color.rgb(107,142,35));
paint.setStrokeWidth(1);
canvas.drawRect(x,y,x+30,y+7,paint);
canvas.drawRect(x+10,y+7,x+20,y+27,paint);
canvas.drawRect(x+5,y+27,x+25,y+32,paint);
requestFocus();
}

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
//  if (keyCode == KeyEvent.KEYCODE_M) {
//  x = 145;
//  y = 100;
//  this.invalidate();
//  }
x = 145;
y = 100;
//this.invalidate();
invalidate();
return true;
}

  public boolean onKey(View v, int keyCode, KeyEvent event) {
  x = 145;
  y = 100;
  v.invalidate();
  this.invalidate();
  return true;
  }

}

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



[android-developers] Re: A suggested way to deal with long running tasks across context switches.

2009-05-17 Thread Romain Guy

Like Dianne said, an AsyncTask doesn't take a Context. If you are
careful about what references you keep in the AsyncTask, there will be
no problem at all.

The implementation you link to has two issues in my opinion: it is not
as easy and straightforward as AsyncTask, and you lose the ability to
post progress on the UI thread from doInBackground().

On Sun, May 17, 2009 at 8:28 AM, Dianne Hackborn hack...@android.com wrote:
 Async task doesn't take a Context, so I think you are making this more
 complicated than it needs to be.  You can just propagate an active AsyncTask
 through onRetainNonConfigurationInstance() as long as the object doesn't
 have any ties to the current activity -- so basically make sure it is static
 (if an inner class), and be able to change its pointer back to the Activity
 or whatever when you get it in the next activity's onCreate() after
 onRetainNonConfigurationInstance().

 On Sun, May 17, 2009 at 1:26 AM, Parakoos parak...@gmail.com wrote:

 I was excited to see the introduction of the AsyncTask. Anything to
 make the division of UI / Background work easier is good in my book.

 What bugged me was that I couldn’t see a way to keep a long running
 process alive during a context switch e.g. a layout orientation
 change. As far as I could see, the common way to ‘solve’ the problem
 was by stopping the process and then recreate it in the new Activity.
 This will work in some cases, but in others it won’t work. For
 example, a background task of creating a new user account on a website
 cannot be re-sent easily.

 I spent a day and hacked out an alternative way of doing things. My
 approach was this.

    * We know that the AsyncTask contains a Context which is the
 Activity that creates it. So it must be destroyed when the Activity is
 destroyed e.g. at a context switch due to a screen orientation change.
    * Since we want to background task to continue ‘across’ a context
 switch we cannot define the background task within the AsyncTask.
 Instead we create a Future and pass that to some implementation of
 AsyncTask that only wait for the Future to compute.
    * At a context switch we can destroy the AsyncTask without
 interrupting the Future which we can hold on to.
    * When creating the new Activity post-context switch we create a
 new fresh ASyncTask and give it the same still running Future.

 The easiest way to understand this is to see it in action. I've
 uploaded an example implementation of the above idea to:
 http://www.shodansoftware.com/DevelopmentTools/BackgroundProcesses

 You're free to check it out and make use of it as you please. If you
 do use it though, I'd appreciate if you'd let me know just so I can
 get that warm fuzzy feeling of having helped someone out. If you have
 comments or suggestions, again, I'd like to know.

 Thanks!

 Gustav a.k.a. Parakoos




 --
 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] What is Context for?

2009-05-17 Thread Makeable

I have just started on a new application that will use SQLite for
persistance and Im a bit confused over the usage of a context when
utilizing the SQLiteOpenHelper.

I have a base class called Storable, which my models extend if they
need to be persisted.
i had intended to use a synchronized singleton database adapter, but I
can't for the life of me understand how to utilize the
SQLiteOpenHelper as it requires a context, which my models don't
appear to possess.

Im aware that I can get around this by not using the SQLOpenHelper -
but if this restriction is in place, I would assume its to prevent
people creating apps the wrong way for android.

What is the best practice way for saving models in the database?

I'm now on my 26th hour of no sleep, so any advice would be very much
appreciated :)

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



[android-developers] The GIMP cannot digest the standard widget frames

2009-05-17 Thread JP

To paraphrase Chris Nesladek from his blog post:
http://android-developers.blogspot.com/2009/04/widget-design-guidelines.html

My designer and me have found that the GIMP does not correctly read
the standard widget frames available for download here:
http://developer.android.com/guide/practices/ui_guidelines/widget_design.html

I am surprised this has not been flagged by the Linux faithful out
there.  Anyways, please relay this to Chris and the designers.

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

2009-05-17 Thread jtaylor

Sounds Good.

+ Juan


On May 11, 3:17 pm, Marco Nelissen marc...@android.com wrote:
 On Mon, May 11, 2009 at 11:24 AM, jtaylor jatto@gmail.com wrote:

  Shouldn't there be a place outside of the Issues page, where one can
  report spelling errors that are in the docs and articles? File a bug
  for a little spelling error??

 You could also submit a patch that fixes the error.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Help: View Not Shown After TableLayout

2009-05-17 Thread efan

Yes, it works fine now after changed to height=wrap_content.

Thanks to all replied.

On May 16, 8:59 pm, Romain Guy romain...@google.com wrote:
 YourTableLayouthas height=fill_parent, it's therefore as tall as its
 parent, so there's no more room left on screen to show the TextView.



 On Sat, May 16, 2009 at 2:58 PM, efan e...@efansoftware.com wrote:

  I need show some text descriptionafteraTableLayoutbut it isnot
 shown.

  Layout xml file like this (the complete code is here:
 http://code.google.com/p/zz-doctor/source/browse/trunk/ZZ/res/layout/...

  LinearLayout
     ...
     TableLayout
          ...
     /TableLayout

     TextView
         android:id=@+id/rxFormulaDesc /
  /LinearLayout

  It works fine when the rxFormulaDescViewis before theTableLayout.
  But requirements want theTableLayoutshownfirst. It just doesnot
 shownup when the rxFormulaDescViewis putaftertheTableLayout. No
  error message in either screen or log. Same Java code.

  TheTableLayoutitself shows up fine - no matter hard-coded content or
  dynamic content, and anyviewbefore it also shows fine.

  I tried other type ofViewaftertheTableLayout, same result.

  Thanks for your attention!

 --
 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: Frame-by-frame animation issue

2009-05-17 Thread steve_macleod

Thanks for the reply.

I've been looking into this some more, and it looks views must be
referenced from the thread in which they were inflated. Looks like I
should be interacting with views from the main thread, and using a
Handler object to interact with this thread from the worker thread.

On 17 May, 02:15, Dianne Hackborn hack...@android.com wrote:
 You probably shouldn't be doing this at all.  Certainly, you shouldn't be
 touching the view hierarchy from another thread.  I would expect what you
 are saying to actually work (and that you would get much more subtle
 errors), but it's hard to say without seeing the code and considering that
 there is a thread there running independently of the view hierarchy it is
 touching.

 On Sat, May 16, 2009 at 12:29 PM, steve_macleod
 steven_macl...@hotmail.comwrote:







  OK, I have been looking into this some more, and it seems that the
  reference to my ImageView is null.
  My code is organised as follows:

  Activity onCreate sets an onClick event
  when the onClick event is activated, setContentView(layout_01) is
  executed (this is the xml file which contains the ImageView) -  as
  part of this xml file, a class which extends SurfaceView is inflated.
  onCreate of this SurfaceView creates a thread (which is in inner
  class) - that thread attempts to use the ImageView via findViewById,
  which returns null.

  Am I out-of-scope in attempting to reference the ImageView like this?
  If so, how should I reference it?

  Thanks,

  On May 16, 4:38 pm, steve_macleod steven_macl...@hotmail.com wrote:
   Hi,
   I am attempting to animate an ImageView using frame-by-frame
   animation. I am using the following code:

   ImageView pacImageV = (ImageView) findViewById(R.id.pacAnim);
   pacImageV.setBackgroundResource(R.anim.pacanim);
   pacManCharAnim = (AnimationDrawable) pacImageV.getBackground();

   *

   ?xml version=1.0 encoding=utf-8?
   FrameLayout xmlns:android=http://schemas.android.com/apk/res/
   android
       android:layout_width=fill_parent
       android:layout_height=fill_parent

       android.pacman.com.PacManMainView
         android:id=@+id/pacman_main_view
         android:layout_width=fill_parent
         android:layout_height=fill_parent/

       RelativeLayout
           android:layout_width=fill_parent
           android:layout_height=fill_parent 

           TextView
             android:id=@+id/gamescreen_txt
                     android:text=@string/hello
                     android:visibility=visible
             android:layout_width=wrap_content
             android:layout_height=wrap_content
             android:layout_centerInParent=true
             android:gravity=center_horizontal
             android:textColor=#88ff
             android:textSize=24sp
             android:paddingTop=400px/
        /RelativeLayout

        ImageView
           android:id=@+id/pacAnim
           android:layout_width=20px
           android:layout_height=20px
           android:scaleType=center
           android:src=@drawable/pac01/

   /FrameLayout

   *

   animation-list xmlns:android=http://schemas.android.com/apk/res/
   android
       android:oneshot=true
       item android:drawable=@drawable/pac01 android:duration=200 /

       item android:drawable=@drawable/pac02 android:duration=200 /

   /animation-list

   *

   Logcat shows a null pointer exception for the
   pacImageV.setBackgroundResource(R.anim.pacanim) line.
   Perhaps I am following the example incorrectly. I am using the 1.5
   sdk. Can anyone assist with this?

 --
 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.- 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: trouble with using keyboard-input to move things on screen, using requestFocus, OnKeyListener etc unsuccessfully.

2009-05-17 Thread klirr

added setFocusable(true); but still doesn't work.


package com.android.shmup;

import android.app.Activity;
import android.content.Context;
import android.graphics.*;
import android.os.Bundle;
import android.view.View;
import android.view.KeyEvent;
import android.view.View.OnKeyListener;

public class Shmup extends Activity { //GraphicsActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(new GameView(this));
}

private static class GameView extends View implements
OnKeyListener {
private Paint mPaint = new Paint();
private int x;
private int y;

public GameView(Context context) {
super(context);
x = 135;
y = 303;
setOnKeyListener(this);
setFocusable(true);
requestFocus();
}

@Override
protected void onDraw(Canvas canvas) {
Paint paint = mPaint;
canvas.translate(10, 10);
canvas.drawColor(Color.rgb(184,134,11));
paint.setColor(Color.rgb(107,142,35));
paint.setStrokeWidth(1);
canvas.drawRect(x,y,x+30,y+7,paint);
canvas.drawRect(x+10,y+7,x+20,y+27,paint);
canvas.drawRect(x+5,y+27,x+25,y+32,paint);
}

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
//  if (keyCode == KeyEvent.KEYCODE_M) {
//  x = 145;
//  y = 100;
//  this.invalidate();
//  }
x = 145;
y = 100;
//this.invalidate();
invalidate();
return true;
}

  public boolean onKey(View v, int keyCode, KeyEvent event) {
  x = 145;
  y = 100;
  v.invalidate();
  this.invalidate();
  return true;
  }

}

}

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



[android-developers] Re: trouble with using keyboard-input to move things on screen, using requestFocus, OnKeyListener etc unsuccessfully.

2009-05-17 Thread Romain Guy

I just tried by copy and pasting your source code in a new Android
project using the Eclipse plugin and it works just fine.

On Sun, May 17, 2009 at 1:38 PM, klirr haskell...@gmail.com wrote:

 added setFocusable(true); but still doesn't work.


 package com.android.shmup;

 import android.app.Activity;
 import android.content.Context;
 import android.graphics.*;
 import android.os.Bundle;
 import android.view.View;
 import android.view.KeyEvent;
 import android.view.View.OnKeyListener;

 public class Shmup extends Activity { //GraphicsActivity {

   �...@override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(new GameView(this));
    }

    private static class GameView extends View implements
 OnKeyListener {
        private Paint mPaint = new Paint();
        private int x;
        private int y;

        public GameView(Context context) {
            super(context);
            x = 135;
            y = 303;
            setOnKeyListener(this);
            setFocusable(true);
            requestFocus();
        }

       �...@override
        protected void onDraw(Canvas canvas) {
            Paint paint = mPaint;
            canvas.translate(10, 10);
            canvas.drawColor(Color.rgb(184,134,11));
            paint.setColor(Color.rgb(107,142,35));
            paint.setStrokeWidth(1);
            canvas.drawRect(x,y,x+30,y+7,paint);
            canvas.drawRect(x+10,y+7,x+20,y+27,paint);
            canvas.drawRect(x+5,y+27,x+25,y+32,paint);
        }

       �...@override
        public boolean onKeyDown(int keyCode, KeyEvent event) {
 //              if (keyCode == KeyEvent.KEYCODE_M) {
 //                      x = 145;
 //                      y = 100;
 //                      this.invalidate();
 //              }
                x = 145;
                y = 100;
                //this.invalidate();
                invalidate();
                return true;
        }

      public boolean onKey(View v, int keyCode, KeyEvent event) {
          x = 145;
          y = 100;
          v.invalidate();
          this.invalidate();
          return true;
      }

    }

 }

 




-- 
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: ( problem for experts ) update/refresh list problem

2009-05-17 Thread Adem KARAKOLLU
Any idea


On Sun, May 17, 2009 at 5:13 AM, Adem KARAKOLLU karako...@gmail.com wrote:

 I have two cursor, one of them from contact content provider, other one
 from database. id fields are sycnhorinzed. i want to show them in same
 column with two row in list.
 i m think that i have to use simpleCursorAdapter, because arrayadapter and
 other adapters can not show two cursor in a list.
 simpleCursorAdapter=new
 SimpleCursorAdapter(this,R.layout.row,matrixCursor,new
 String[]{matrixCursor.getColumnName(1),matrixCursor.getColumnName(2)},new
 int[]{R.id.TextView01,R.id.TextView02});
 my problem is simpleCursorAdapter.notifyDataSetChanged(); is not
 working.
  protected void onResume() {

  cursor2.requery();
  cursor3=myDbAdapter.getAll();
  System.out.println(ak_:Onresumed);
  simpleCursorAdapter.notifyDataSetChanged();

 so my list is not refresing/updating altough all cursors all results are
 updating.
 Is there any idea?

 --
 ADEM KARAKOLLU




-- 
ADEM KARAKOLLU

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

2009-05-17 Thread Raphael

The correct place to ask Market questions is
http://www.google.com/support/forum/p/Android+Market

R/

On Sun, May 17, 2009 at 4:27 AM, kiu sch...@googlemail.com wrote:

 In the android market the countries where your app should be published
 can be selected.

 How is the country determined ?

 Where the device was bought ?
 Which country SIM is inserted ?
 Which GSM network it is currently connected to ?
 Which country was specified in the google account ?

 Simon

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

2009-05-17 Thread steve_macleod

Hi,
I have the following xml layout:

android.pacman.com.PacManMainView
  android:id=@+id/pacman_main_view
  android:layout_width=fill_parent
  android:layout_height=fill_parent


   ImageView android:id=@+id/pacAnim
android:src=@drawable/pac02
android:layout_width=20px
android:layout_height=20px/
/android.pacman.com.PacManMainView

PacManMainView extends SurfaceView. I can draw to this, it works OK.
However, when I attempt to get a reference to the ImageView like this:

@Override
public void surfaceCreated(SurfaceHolder holder) {
/* test reference to imageview
ImageView pacImageV = (ImageView) findViewById(R.id.pacAnim);

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

2009-05-17 Thread steve_macleod

Hi,
I have the following xml layout:

android.pacman.com.PacManMainView
  android:id=@+id/pacman_main_view
  android:layout_width=fill_parent
  android:layout_height=fill_parent


   ImageView android:id=@+id/pacAnim
android:src=@drawable/pac02
android:layout_width=20px
android:layout_height=20px/

/android.pacman.com.PacManMainView


PacManMainView extends SurfaceView. I can draw to this, it works OK.
However, when I attempt to get a reference to the ImageView from
PacManMainView like this:


@Override
public void surfaceCreated(SurfaceHolder holder) {
   /* test reference to imageview
   ImageView pacImageV = (ImageView) findViewById(R.id.pacAnim);
}


I get a null each time. Is there something real simple Im missing?

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] Module version conflicts between wlan module and Android kernel source

2009-05-17 Thread Jim Bray

Hi,

  I'm tinkering with building and installing Android from source.
Basically I've got it down fairly well, but I seem to have run into a
bit of a problem with the wlan module, probably from HTC.

  Having pulled the 2.6.27 kernel sources and built that with
a .config pulled from the phone, and using that as the kernel image
instead of the prebuilt one, I get the following wifi failure message
in dmesg:

wlan: version magic '2.6.27-00205-gf2dabc0 preempt mod_unload ARMv6 '
should be '2.6.27-00392-g8312baf preempt mod_unload ARMv6 '

probably because the .config I pulled from the phone has:

CONFIG_LOCALVERSION=-00392-g8312baf

So I rebuilt with the '00205' localversion and now I get in dmesg:

[   61.122497] wlan: Unknown symbol trout_pwrsink_set

but trout_pwrsink_set was changed to htc_pwrsave_set way back in
February:

[ARM]: trout: Switch from trout_pwrsink - htc_pwrsink  33/8933/1
http://android.git.kernel.org/?p=kernel/msm.git;a=commitdiff;h=44a01f54989b1c8669a8075189886a1bdf29bc17

  I'm clearly getting an obsolete wlan module somehow, Any ideas for
how I can get a wlan module that goes with the '00392' kernel would be
appreciated.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Module version conflicts between wlan module and Android kernel source

2009-05-17 Thread Jeff Sharkey

The android-porting list might be a better place to ask this, as they
deal with lower-level hardware.

j

On Sun, May 17, 2009 at 2:55 PM, Jim Bray jimsante...@gmail.com wrote:

 Hi,

  I'm tinkering with building and installing Android from source.
 Basically I've got it down fairly well, but I seem to have run into a
 bit of a problem with the wlan module, probably from HTC.

  Having pulled the 2.6.27 kernel sources and built that with
 a .config pulled from the phone, and using that as the kernel image
 instead of the prebuilt one, I get the following wifi failure message
 in dmesg:

 wlan: version magic '2.6.27-00205-gf2dabc0 preempt mod_unload ARMv6 '
 should be '2.6.27-00392-g8312baf preempt mod_unload ARMv6 '

 probably because the .config I pulled from the phone has:

 CONFIG_LOCALVERSION=-00392-g8312baf

 So I rebuilt with the '00205' localversion and now I get in dmesg:

 [   61.122497] wlan: Unknown symbol trout_pwrsink_set

 but trout_pwrsink_set was changed to htc_pwrsave_set way back in
 February:

 [ARM]: trout: Switch from trout_pwrsink - htc_pwrsink  33/8933/1
 http://android.git.kernel.org/?p=kernel/msm.git;a=commitdiff;h=44a01f54989b1c8669a8075189886a1bdf29bc17

  I'm clearly getting an obsolete wlan module somehow, Any ideas for
 how I can get a wlan module that goes with the '00392' kernel would be
 appreciated.

 




-- 
Jeff Sharkey
jshar...@android.com

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



[android-developers] How to make games faster? Using view and redraw is way to slow it seems.

2009-05-17 Thread klirr

I have done a simple game where I draw on a View and use invalidate()
to force onDraw to be called.
This however doesn't seem to scale at all since even for this little
game it is quite slow.

So what is the solution, to use openGL? that is what all games should?
and then I should use frames rather than redrawing?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Module version conflicts between wlan module and Android kernel source

2009-05-17 Thread Jim Bray

  Thanks. I found an 'Android Linux Kernel Development' group I didn't
know about.
I'll try there.

JB


On May 17, 6:27 pm, Jeff Sharkey jshar...@android.com wrote:
 The android-porting list might be a better place to ask this, as they
 deal with lower-level hardware.

 j



 On Sun, May 17, 2009 at 2:55 PM, Jim Bray jimsante...@gmail.com wrote:

  Hi,

   I'm tinkering with building and installing Android from source.
  Basically I've got it down fairly well, but I seem to have run into a
  bit of a problem with the wlan module, probably from HTC.

   Having pulled the 2.6.27 kernel sources and built that with
  a .config pulled from the phone, and using that as the kernel image
  instead of the prebuilt one, I get the following wifi failure message
  in dmesg:

  wlan: version magic '2.6.27-00205-gf2dabc0 preempt mod_unload ARMv6 '
  should be '2.6.27-00392-g8312baf preempt mod_unload ARMv6 '

  probably because the .config I pulled from the phone has:

  CONFIG_LOCALVERSION=-00392-g8312baf

  So I rebuilt with the '00205' localversion and now I get in dmesg:

  [   61.122497] wlan: Unknown symbol trout_pwrsink_set

  but trout_pwrsink_set was changed to htc_pwrsave_set way back in
  February:

  [ARM]: trout: Switch from trout_pwrsink - htc_pwrsink  33/8933/1
 http://android.git.kernel.org/?p=kernel/msm.git;a=commitdiff;h=44a01f...

   I'm clearly getting an obsolete wlan module somehow, Any ideas for
  how I can get a wlan module that goes with the '00392' kernel would be
  appreciated.

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



[android-developers] Re: Null reference for ImageView

2009-05-17 Thread Marco Nelissen

I'm not 100% sure, but I don't think a SurfaceView can have child
views (since it's not a ViewGroup).


On Sun, May 17, 2009 at 2:53 PM, steve_macleod
steven_macl...@hotmail.com wrote:

 Hi,
 I have the following xml layout:

 android.pacman.com.PacManMainView
      android:id=@+id/pacman_main_view
      android:layout_width=fill_parent
      android:layout_height=fill_parent


       ImageView android:id=@+id/pacAnim
                        android:src=@drawable/pac02
                        android:layout_width=20px
                        android:layout_height=20px/

 /android.pacman.com.PacManMainView


 PacManMainView extends SurfaceView. I can draw to this, it works OK.
 However, when I attempt to get a reference to the ImageView from
 PacManMainView like this:


 @Override
 public void surfaceCreated(SurfaceHolder holder) {
   /* test reference to imageview
   ImageView pacImageV = (ImageView) findViewById(R.id.pacAnim);
 }


 I get a null each time. Is there something real simple Im missing?

 Thanks


 


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



[android-developers] Re: Null reference for ImageView

2009-05-17 Thread steve_macleod

Thanks for the reply.
Ill look into this. What is the best way to get a reference to the
ImageView from the custom view code, if this is the case?



On 18 May, 00:19, Marco Nelissen marc...@android.com wrote:
 I'm not 100% sure, but I don't think a SurfaceView can have child
 views (since it's not a ViewGroup).

 On Sun, May 17, 2009 at 2:53 PM, steve_macleod



 steven_macl...@hotmail.com wrote:

  Hi,
  I have the following xml layout:

  android.pacman.com.PacManMainView
       android:id=@+id/pacman_main_view
       android:layout_width=fill_parent
       android:layout_height=fill_parent

        ImageView android:id=@+id/pacAnim
                         android:src=@drawable/pac02
                         android:layout_width=20px
                         android:layout_height=20px/

  /android.pacman.com.PacManMainView

  PacManMainView extends SurfaceView. I can draw to this, it works OK.
  However, when I attempt to get a reference to the ImageView from
  PacManMainView like this:

  @Override
  public void surfaceCreated(SurfaceHolder holder) {
    /* test reference to imageview
    ImageView pacImageV = (ImageView) findViewById(R.id.pacAnim);
  }

  I get a null each time. Is there something real simple Im missing?

  Thanks- Hide quoted text -

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



[android-developers] Re: Null reference for ImageView

2009-05-17 Thread Marco Nelissen

If this is indeed the case, then the ImageView isn't actually there,
so you can't get a reference to it.


On Sun, May 17, 2009 at 4:45 PM, steve_macleod
steven_macl...@hotmail.com wrote:

 Thanks for the reply.
 Ill look into this. What is the best way to get a reference to the
 ImageView from the custom view code, if this is the case?



 On 18 May, 00:19, Marco Nelissen marc...@android.com wrote:
 I'm not 100% sure, but I don't think a SurfaceView can have child
 views (since it's not a ViewGroup).

 On Sun, May 17, 2009 at 2:53 PM, steve_macleod



 steven_macl...@hotmail.com wrote:

  Hi,
  I have the following xml layout:

  android.pacman.com.PacManMainView
       android:id=@+id/pacman_main_view
       android:layout_width=fill_parent
       android:layout_height=fill_parent

        ImageView android:id=@+id/pacAnim
                         android:src=@drawable/pac02
                         android:layout_width=20px
                         android:layout_height=20px/

  /android.pacman.com.PacManMainView

  PacManMainView extends SurfaceView. I can draw to this, it works OK.
  However, when I attempt to get a reference to the ImageView from
  PacManMainView like this:

  @Override
  public void surfaceCreated(SurfaceHolder holder) {
    /* test reference to imageview
    ImageView pacImageV = (ImageView) findViewById(R.id.pacAnim);
  }

  I get a null each time. Is there something real simple Im missing?

  Thanks- Hide quoted text -

 - Show quoted text -
 


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



[android-developers] Re: How to make games faster? Using view and redraw is way to slow it seems.

2009-05-17 Thread Marco Nelissen

If using OpenGL doesn't make sense for your game, check out SurfaceView.


On Sun, May 17, 2009 at 4:12 PM, klirr haskell...@gmail.com wrote:

 I have done a simple game where I draw on a View and use invalidate()
 to force onDraw to be called.
 This however doesn't seem to scale at all since even for this little
 game it is quite slow.

 So what is the solution, to use openGL? that is what all games should?
 and then I should use frames rather than redrawing?
 


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

2009-05-17 Thread steve_macleod

So if I had:

FrameLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:layout_width=fill_parent
android:layout_height=fill_parent

android.pacman.com.PacManMainView
  android:id=@+id/pacman_main_view
  android:layout_width=fill_parent
  android:layout_height=fill_parent
/android.pacman.com.PacManMainView

ImageView android:id=@+id/pacAnim
 android:src=@drawable/pac02
 android:layout_width=20px
 android:layout_height=20px/
/FrameLayout

How would I go about getting a reference to the ImageView from
PamManMainView?

Thanks again



On 18 May, 00:56, Marco Nelissen marc...@android.com wrote:
 If this is indeed the case, then the ImageView isn't actually there,
 so you can't get a reference to it.

 On Sun, May 17, 2009 at 4:45 PM, steve_macleod



 steven_macl...@hotmail.com wrote:

  Thanks for the reply.
  Ill look into this. What is the best way to get a reference to the
  ImageView from the custom view code, if this is the case?

  On 18 May, 00:19, Marco Nelissen marc...@android.com wrote:
  I'm not 100% sure, but I don't think a SurfaceView can have child
  views (since it's not a ViewGroup).

  On Sun, May 17, 2009 at 2:53 PM, steve_macleod

  steven_macl...@hotmail.com wrote:

   Hi,
   I have the following xml layout:

   android.pacman.com.PacManMainView
        android:id=@+id/pacman_main_view
        android:layout_width=fill_parent
        android:layout_height=fill_parent

         ImageView android:id=@+id/pacAnim
                          android:src=@drawable/pac02
                          android:layout_width=20px
                          android:layout_height=20px/

   /android.pacman.com.PacManMainView

   PacManMainView extends SurfaceView. I can draw to this, it works OK.
   However, when I attempt to get a reference to the ImageView from
   PacManMainView like this:

   @Override
   public void surfaceCreated(SurfaceHolder holder) {
     /* test reference to imageview
     ImageView pacImageV = (ImageView) findViewById(R.id.pacAnim);
   }

   I get a null each time. Is there something real simple Im missing?

   Thanks- Hide quoted text -

  - Show quoted text -- Hide quoted text -

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



[android-developers] Re: Null reference for ImageView

2009-05-17 Thread Marco Nelissen

From PacManMainView, you would first get the parent view (the
FrameLayout), and from there you can find the ImageView.


On Sun, May 17, 2009 at 5:16 PM, steve_macleod
steven_macl...@hotmail.com wrote:

 So if I had:

 FrameLayout xmlns:android=http://schemas.android.com/apk/res/
 android
    android:layout_width=fill_parent
    android:layout_height=fill_parent

 android.pacman.com.PacManMainView
      android:id=@+id/pacman_main_view
      android:layout_width=fill_parent
      android:layout_height=fill_parent
 /android.pacman.com.PacManMainView

 ImageView android:id=@+id/pacAnim
     android:src=@drawable/pac02
     android:layout_width=20px
     android:layout_height=20px/
 /FrameLayout

 How would I go about getting a reference to the ImageView from
 PamManMainView?

 Thanks again



 On 18 May, 00:56, Marco Nelissen marc...@android.com wrote:
 If this is indeed the case, then the ImageView isn't actually there,
 so you can't get a reference to it.

 On Sun, May 17, 2009 at 4:45 PM, steve_macleod



 steven_macl...@hotmail.com wrote:

  Thanks for the reply.
  Ill look into this. What is the best way to get a reference to the
  ImageView from the custom view code, if this is the case?

  On 18 May, 00:19, Marco Nelissen marc...@android.com wrote:
  I'm not 100% sure, but I don't think a SurfaceView can have child
  views (since it's not a ViewGroup).

  On Sun, May 17, 2009 at 2:53 PM, steve_macleod

  steven_macl...@hotmail.com wrote:

   Hi,
   I have the following xml layout:

   android.pacman.com.PacManMainView
        android:id=@+id/pacman_main_view
        android:layout_width=fill_parent
        android:layout_height=fill_parent

         ImageView android:id=@+id/pacAnim
                          android:src=@drawable/pac02
                          android:layout_width=20px
                          android:layout_height=20px/

   /android.pacman.com.PacManMainView

   PacManMainView extends SurfaceView. I can draw to this, it works OK.
   However, when I attempt to get a reference to the ImageView from
   PacManMainView like this:

   @Override
   public void surfaceCreated(SurfaceHolder holder) {
     /* test reference to imageview
     ImageView pacImageV = (ImageView) findViewById(R.id.pacAnim);
   }

   I get a null each time. Is there something real simple Im missing?

   Thanks- Hide quoted text -

  - Show quoted text -- Hide quoted text -

 - Show quoted text -
 


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



[android-developers] Throttling rate of messages to handler

2009-05-17 Thread al capwn
My app makes use of threads and uses handlers to send messages to the gui.
The thread maintain a connection to a server and receive messages from it.

The problem I'm having is that sometimes messages arrive really fast, and
although the app doesn't anr, the UI freezes as it tries to cope with the
fast influx of messages in the queue.

The rate at which messages arrive from the server is beyond my control, but
I need to find a way to throttle to make sure the UI stays responsive. I've
read about people having issues in games where touch events have a negative
effect on fps and they've used thread.sleep to throttle. Although similar to
my issue, I don't think it would work for me because both the UI and
background threads as just as important here.

Does anyone have any other ideas for solving this? Thanks.

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



[android-developers] Efficiency question re:resources

2009-05-17 Thread James McMurray
Can anyone tell me which is more efficient:

1) Getting a resource id with getIdentifier(name, defType, package) or

2) doing a database lookup on a unique field

Thanks!

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



[android-developers] Re: aidl remote service call namespace question

2009-05-17 Thread Dianne Hackborn
If you have give the .apks the same name, you can't have them both installed
at the same time, because they are both effectively the same app.

You can have classes in whatever namespace you want inside of the .apk (and
even publish these in the manifest via fully qualified class names).

On Sun, May 17, 2009 at 8:37 AM, dev_rob robwiene...@googlemail.com wrote:


 I think it's rather a problem with namespaces. And the package names
 in both projects are indeed identical!

 But as (one of my original questions) both projects have to contain
 the TestInterface.aidl the package names must be the same, because
 otherwise there is a different package name in TestInterface.aidl and
 then it's not the same interface anymore and enforceInterface()
 complains about that...

 If you have a suggestion for this issue, it would be great (I guess
 there is a simple solution for this)! I could see then, if that has
 something to do with the fact, that the service seems not to be
 registered after executing the calling activity (project 1).

 Thanks again!

 On 17 Mai, 17:21, Dianne Hackborn hack...@android.com wrote:
  Er... you are sure that both .apks have different package names?  Anyway
 it
  sounds like whatever problem you have has nothing to do with services
  themselves, but just getting both apps installed at the same time?
 
 
 
  On Sun, May 17, 2009 at 7:35 AM, dev_rob robwiene...@googlemail.com
 wrote:
 
   I now have the TestInterface.aidl in both eclipse projects and project
   2 (the service project) is added to project 1's build path.
 
   I declared the service in the manifest-file with:
 
   service android:name=.TestStringService
  android:exported=true
  android:process=:remote
  intent-filter 
  action
 android:name=de.roberlin.new_rpc.action.NEW_RPC/
  /intent-filter
   /service
 
   and adb shell dumpsys package shows it successfully registered to
   the emulator.
 
   I try to bind to the service with:
 
   String intentAction = de.roberlin.new_rpc.action.NEW_RPC;
  Intent iService = new Intent(intentAction);
   bindService(iService, myService, Context.BIND_AUTO_CREATE);
 
   DDMS won't stop telling me:
 
   05-17 14:14:34.285: WARN/ActivityManager(567): Unable to start
   service Intent { action=de.roberlin.new_rpc.action.NEW_RPC }: not
   found
 
   In fact, after running project 1 (the activity binding to the service)
   and getting the error message, when I do
 
   adb shell dumpsys package
 
   again, it does not list my service anymore. how can this be???
 
   the steps were:
 
   1.) installing the service onto a new emulator (adb shell dumpsys
   package lists it then correctly)
 
   2.) installing/running project 1 (leads to the error message above)
 
   3.) now adb shell dumpsys package does not list the service anymore.
   even if i reinstall it, it won't be listed anymore until I start a new
   emulator and intall it freshly.
 
   I really do not know, how to deal with this and would be really
   thankful for any help!!
 
   best regards!
 
   On 17 Mai, 08:25, Dianne Hackborn hack...@android.com wrote:
For the second question, you'll either want to define an abstract
 action
   in
an intent-filter for the service and use that as the intent you bind
 to
(typically the action is the name of the desired interface for
 binding to
services), or create an explicit ComponentName with the package name
 +
   class
name of the service being bound to and provide that to the Intent.
  For
   this
latter, make sure you have set android:exported=true for the
 service.
 
Sorry I can't really help you with the first question, since I don't
 know
ADT that well.  Basically you will need to have both applications
 like
   the
generated aidl code into their app.
 
On Sat, May 16, 2009 at 8:46 AM, dev_rob robwiene...@googlemail.com
 
   wrote:
 
 Hi android developers,
 
 I'm new to the great android platform, trying to get into RPC with
 aidl and services.
 
 I didn't find a sufficient answer to my problem in any posts, if
 there
 already is one, please excuse and point me to it, thanks.
 
 I made 2 projects.
 
 project 1 hast an activity that binds to a service from project 2
 on a
 button click (all just for testing).
 
 1. issue:
 
 How can I make project 1 know (import) my TestInterface (from
 TestInterface.aidl out of project 2) for usage in:
 
 TestInterface mService = (TestInterface)
 TestInterface.Stub.asInterface(service);
 
 without adding project 2 to the build path, because if I'd have an
 installed service without the project code, I couldn't do it this
 way,
 too...??
 I read in one thread that TestInterface.aidl should just be added
 to
 project 1, too, but if I do this, in DDMS enforceInterface()
 complains
 and seems to just see/use the interface from project 1 and it
 doesn't
 work.
 
 2. 

[android-developers] Re: Throttling rate of messages to handler

2009-05-17 Thread Dianne Hackborn
Correct it wouldn't work, since there is a lot of careful dispatching code
in the window manager that this sleep trick is actually relying on.

There are many ways you can perform throttling, depending on your exact
situation.  For example:

1. Put a delay before you send a message, so if you get more information
from the server during that time it can be batched together.
2. Watch for situations where you are generating many messages within a
certain amount of time, and start batching/delaying when in that situation.
3. Have some mechanism to find out when the app is done processing a
message, and don't send the next message until that occurs (batching
activity from the server during that time).  (Fwiw, this is basically what
the window manager does for dispatching events to applications.)

On Sun, May 17, 2009 at 5:47 PM, al capwn alcapw...@googlemail.com wrote:

 My app makes use of threads and uses handlers to send messages to the gui.
 The thread maintain a connection to a server and receive messages from it.

 The problem I'm having is that sometimes messages arrive really fast, and
 although the app doesn't anr, the UI freezes as it tries to cope with the
 fast influx of messages in the queue.

 The rate at which messages arrive from the server is beyond my control, but
 I need to find a way to throttle to make sure the UI stays responsive. I've
 read about people having issues in games where touch events have a negative
 effect on fps and they've used thread.sleep to throttle. Although similar to
 my issue, I don't think it would work for me because both the UI and
 background threads as just as important here.

 Does anyone have any other ideas for solving this? 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: What is Context for?

2009-05-17 Thread Marco Nelissen

Your application/activity will be given a Context by the system. Use that.

On Sun, May 17, 2009 at 10:36 AM, Makeable m...@makeable.co.uk wrote:

 I have just started on a new application that will use SQLite for
 persistance and Im a bit confused over the usage of a context when
 utilizing the SQLiteOpenHelper.

 I have a base class called Storable, which my models extend if they
 need to be persisted.
 i had intended to use a synchronized singleton database adapter, but I
 can't for the life of me understand how to utilize the
 SQLiteOpenHelper as it requires a context, which my models don't
 appear to possess.

 Im aware that I can get around this by not using the SQLOpenHelper -
 but if this restriction is in place, I would assume its to prevent
 people creating apps the wrong way for android.

 What is the best practice way for saving models in the database?

 I'm now on my 26th hour of no sleep, so any advice would be very much
 appreciated :)

 


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

2009-05-17 Thread BlackLight

Thank you.

On May 17, 8:23 pm, Menny menn...@gmail.com wrote:
 If you run the sample in 1.5 SDK in the emulator, you'll be able to
 use it by enabling it in Settings-Localetext.
 Then go to any text-box, and do long press on it, till a context menu
 will open up.
 Select from this menu Input method, and select the new soft
 keyboard.

 On May 17, 6:56 pm, BlackLight blacklight1...@gmail.com wrote:

  Hello.

  I'm trying to understand how SoftKeyboard example from sdk 1.5 works.
  I made apk and installed it on emulator 1.5. I see only default
  keyboard (Android Keyboard). Please, give me some information (url?)
  to read more about custom softkeyboards.

  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] Can you record a video of the screen?

2009-05-17 Thread Sheepz

I know you can use the ddms view in eclipse to take a snapshot of the
screen, but can you somehow make a video like that?
thanks,
E.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] How to make SMS composing UI same Like Default.

2009-05-17 Thread Gulfam

Hi,

   I am trying to make user interface same like default sms composing
ui screen  but unable to make same like that.
any one can share xml with me if he/she have developed or give me any
idea how to do it.

Thanks in advance,

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

2009-05-17 Thread Ruiming Li
You can try the  following code :

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

setContentView(R.layout.main); //If your layout is main.xml

TextView tv = (TextView)findViewById(R.id.TextView01);

tv.setText(Hello, Android\n);
}


The Root Cause of the error is  R.id.TextView01 is NULL, if you do not call
setContentView(R.layout.main);

2009/5/15 Francesco Pace paxa...@gmail.com

 Thanks, but I have same error.
 New code is :

 public void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 TextView tv = (TextView)this.findViewById(R.id.TextView01);
 setContentView(tv);
 tv.setText(Hello, Android\n);
 }

 Boh.

 2009/5/15 Robert robert.li.ruim...@gmail.com

 You can try it to move setcontextview() to the first line in oncreate
 function.good lock.

 Francesco Pace paxa...@gmail.com写道:


 Thanks, but I have this error :
 
 ERROR/AndroidRuntime(1096): java.lang.RuntimeException: Unable to start
 activity

 ComponentInfo{com.cecco.android.hello/com.cecco.android.hello.HelloWorld}:
 java.lang.NullPointerException: println needs a message
 
 in my code :
 
 public void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 
 TextView tv = (TextView)this.findViewById(R.id.TextView01);
  tv.setText(Hello, Android\n);
  setContentView(tv);
 }
 
 But when I use this statement TextView tv = new TextView(this) my
 application running correctly.
 My main.xml file is  :
 
 LinearLayout
android:id=@+id/LinearLayout01
android:layout_width=fill_parent
android:layout_height=fill_parent
   xmlns:android=
 http://schemas.android.com/apk/res/android
 
 TextView
   android:text=TextView01
   android:id=@+id/TextView01
   android:layout_width=wrap_content
   android:layout_height=wrap_content
 /TextView
 /LinearLayout
 
 and my R.java :
 
 public final class R {
 public static final class attr {
 }
 public static final class drawable {
 public static final int icon=0x7f02;
 }
 public static final class id {
 public static final int LinearLayout01=0x7f05;
 public static final int TextView01=0x7f050001;
 }
 public static final class layout {
 public static final int main=0x7f03;
 }
 public static final class string {
 public static final int app_name=0x7f040001;
 public static final int hello=0x7f04;
 }
 
 2009/5/15 iDeveloper ideveloper...@gmail.com
 
  If you just want to print these on the activity, use a TextView and set
 its
  text to your sysouts
  TextView tv = (TextView)findViewById...
  tv.setText(Whatever you want to print);
 
 
 
 
  On 15-May-09, at 1:54 PM, Francesco Pace wrote:
 
  Hi, thanks.
  But I want print these informations on my android application..
 There
  is a particular UI?
 
  2009/5/15 iDeveloper ideveloper...@gmail.com
 
  You can use Log.d for printing debug statements to the LogCat and
 Log.e
  for error statements.
 
 
 
 
  On 15-May-09, at 1:25 PM, Francesco Pace wrote:
 
  Hi Mariano, thanks for your time.
  Example :
 
  / CODE APPLICATION
  *System.out.println(Hello);
  foo1();   // Simple function
  System.out.println(World);
  foo2();   // Simple function
  System.out.println(Today);
  System.out.println(Yesterday);*
 
  I know that I can't use System.out.println on Android.
 
  / DISPLAY CONSOLE  (NO WINDOW COMMAND LINE)
  *- Hello
  - World  (after foo1())
  - Today  (after foo2())
  - Yesterday*
 
  adb -e logcat display the output of the currently running emulator
 on
  window command line, I need to show logs on interface.
  Can you help me? Thanks for all.
 
  2009/5/15 Mariano Kamp mariano.k...@gmail.com
 
  Not sure if I understand you correctly.
  You can run adb -e logcat on the command line to display the output
 of
  the currently running emulator. Is that what are looking for?
 
 
  On Fri, May 15, 2009 at 9:32 AM, Francesco Pace paxa...@gmail.com
 wrote:
 
  Hi developers,
  I need a help. I need to display all Logcats Log on console of my
  emulator, as do it the simple program Hello World.
  Can you help 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: How to set some lists in one layout?

2009-05-17 Thread Daehoon Jeon
It's very helpful for me. Thanks for help.there is another problem
I can display lists, but I don't know how
to set onItemClickListener ?

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

2009-05-17 Thread Dianne Hackborn
I would guess possibly the former, but you should time them and see.  (And
avoid either of them for performance critical code, since they are both
expensive.)

On Sun, May 17, 2009 at 7:39 PM, James McMurray
james.t.mcmur...@gmail.comwrote:

 Can anyone tell me which is more efficient:

 1) Getting a resource id with getIdentifier(name, defType, package) or

 2) doing a database lookup on a unique field

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