Re: [android-developers] ArrayIndexOutOfBoundsException

2012-04-04 Thread Ted Scott
Try here http://javaranch.com or perhaps take a Java course? Android 
development is much easier when you speak the language.


On 4/4/2012 4:48 AM, Graham Bright wrote:

Hi,

I can't figure out why I am getting and out of bounds exception ? Any
ideas



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


Re: [android-developers] ListView and Database

2012-03-31 Thread Ted Scott

Hi Ricardo,

First, I'm sure others will chime in if this is bad advice, but my 
understanding is that it is better to use the compatibility package and 
cursor loaders and a load manager. See 
http://developer.android.com/reference/android/widget/SimpleCursorAdapter.html 
and the base CursorAdapter.


That said, from is simply a list of columns in the PROJECTION exposed by 
the cursor that are of interest to the ListView ids in the to array. 
This is in order of the two arrays such that the data from from[x] is 
passed to the view with the id in to[x].


Given the list view row definition:

?xml version=1.0 encoding=utf-8?
LinearLayout xmlns:android=http://schemas.android.com/apk/res/android;
  android:layout_width=fill_parent
  android:layout_height=34dp
  android:gravity=bottom
  android:orientation=horizontal

TextView xmlns:android=http://schemas.android.com/apk/res/android;
android:id=@+id/foo
android:layout_width=100dp
android:layout_height=30dp
android:textSize=16dp
android:gravity=center_vertical
android:paddingLeft=5dip
android:singleLine=true
/
TextView xmlns:android=http://schemas.android.com/apk/res/android;
android:id=@+id/bar
android:layout_width=50dp
android:layout_height=30dp
android:textSize=20dp
android:gravity=right|center_vertical
android:paddingLeft=5dip
android:singleLine=true
/
/LinearLayout

And assuming that you have column1 and column2 in your cursor's 
projection, and want to map the contents of column1 to the textview foo 
and column2 to textview bar, from and to would be defined something like:


String[] from =  new String[] { column1 , coulmn2};
int[] to   = new int[] { R.id.foo , R.id.bar };

Clear as mud?

-Ted

On 3/31/2012 9:36 PM, Ricardo Santos wrote:

Hello everyone!

  I have in my application, I hace a list view that needs to be 
populated with data from a database, I have tested my database and my 
app is handling the data correctly, but I cant populate the list view, 
I have read about the SimpleCursorAdapter but I cant understand how to 
use the class, specially the from and to fields, does anyone know how 
to use it?


  My class is not extending ListActivity, my list view is inside a dialog.

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


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


Re: [android-developers] Re: Dev Environment - maven-android-eclipse

2012-03-22 Thread Ted Scott

On 3/22/2012 11:25 AM, Michael Sims wrote:

Android + Maven + Eclipse is definitely possible, but speaking from
experience, it's painful.  Tedious to get working, builds are very
very slow and fragile.  You can do it, but it'll hurt.


I think I had the pain part figured out ;) Slow, I wasn't too sure of 
and fragile is my concern that I will add some feature and hopelessly 
break the build.



For what it's worth, IntelliJ + Android + Maven works wonderfully.
Because I was working on a largish Android app that was built with
Maven, I switched to IntelliJ CE and I've been a very happy camper
since then.  Everything supported out of the box (no plugins to
install), everything cooperates, and the build is fast and stable.
Switching IDEs is a big deal though, but if you really like Maven, I
personally believe that is your best option


Since this is only my project and one with the goal of learning the 
platform, at least trying IntelliJ won't be that big of a deal. I 
thought it was commercial, but looking at the page, I think the free 
community edition would be sufficient to get a feel for the platform. I 
was concerned that if I really wanted maven support that I would have to 
revert to the command line and emacs.



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


Re: [android-developers] Dev Environment - maven-android-eclipse

2012-03-22 Thread Ted Scott

On 3/21/2012 8:59 PM, James Black wrote:


I would expect that a problem is using other libraries. Are all of the 
jar files built for the Android?




Good point. Yes, the android relevant libraries are built for android. 
The major malfunction that brought the question on is a problem when 
basing a style on a style in a maven managed library. This is an 
apparently known issue with the android-maven configuration plugin and 
came up when I tried to import the gaug.es app project into eclipse and 
stumbled over a few things with the style issue unresolveable, at least 
easily.


I have it playing together for a trivial app, but I don't know where the 
pitfalls are, and I would rather focus on learning the android platform 
instead of a continuing troubleshooting of the development environment.


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


Re: [android-developers] Re: Dev Environment - maven-android-eclipse

2012-03-22 Thread Ted Scott

Hi Ricardo,

First let me thank you for doing the m2e-android plugin! Thank you for 
pointing out that it exists, I was very generic in my questions.


That was part of the path that got me asking about this. I started with 
trying to use ActionBarSherlock in my project and saw they seemed to be 
using maven so I thought I would give it a go. I couldn't get their 
samples going with maven under eclipse (probably my fault since I 
changed the project heirarchy) but I couldn't get the roboguice going 
easily under a pure eclipse build, but to be fair I didn't spend a lot 
of time on it as well.


I did get the gaug.es app built from the command line, and brought it 
into eclipse, stumbled over a couple of lifecycle not supported errors 
(and thanks for the ignore this in the pom support, btw) but then I hit 
the wall with the theme issue pretty much as described here: 
https://github.com/github/gauges-android/issues/14 (which I see you've 
responded to). While it's not a show stopper, it is inconvenient to 
build and deploy only from the command line and losing the build issue 
detection and support inside eclipse.


Really I was wondering if others have this all playing nice enough 
together to be building pretty complex applications with it before I 
spent too much effort on it with my app, which really is a project for 
learning the android platform more than anything.


-Ted

On 3/22/2012 10:55 AM, Ricardo Gladwell wrote:

Hi Ted

This is possible, please see the Android Connector for M2E (Maven for 
Eclipse):


http://rgladwell.github.com/m2e-android/

Regards...

--
Ricardo Gladwell ricardo.gladw...@gmail.com
http://www.google.com/profiles/ricardo.gladwell
Twitter: @rgladwell

On Wednesday, March 21, 2012 4:17:41 PM UTC, Ted S. wrote:

This is somewhat off topic, but I couldn't think of a better place
to ask.

Is anyone successfully using maven and eclipse to develop android
apps?
If so, are they complex apps? I really like the dependency management
aspects of maven, but getting eclipse to play nicely with maven in an
android project is problematic. In my ideal world I would be able to
build and deploy in eclipse for development/debugging and use
maven to
do production builds.

So, have you tried and rejected using maven? Or have you tried and
gotten it to work nicely?

I'm about ready to give up on getting it all to play nicely.

-Ted

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


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

[android-developers] Dev Environment - maven-android-eclipse

2012-03-21 Thread Ted Scott

This is somewhat off topic, but I couldn't think of a better place to ask.

Is anyone successfully using maven and eclipse to develop android apps? 
If so, are they complex apps? I really like the dependency management 
aspects of maven, but getting eclipse to play nicely with maven in an 
android project is problematic. In my ideal world I would be able to 
build and deploy in eclipse for development/debugging and use maven to 
do production builds.


So, have you tried and rejected using maven? Or have you tried and 
gotten it to work nicely?


I'm about ready to give up on getting it all to play nicely.

-Ted

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


Re: [android-developers] How to keep activity running

2012-03-19 Thread Ted Scott

On 3/19/2012 9:01 PM, Dianne Hackborn wrote:
Personally I would say that for any question that implies you are 
subclassing Application, the answer is no. :)
Subclassing from Application doesn't let you do anything more than you 
could other ways, and there is a good chance it is going to lead you 
into a worse app design that you will ultimately be fighting with.


I just ran across roboguice. At first glance it seems like it requires 
that Application be subclassed so it can do its injection thing. Would 
you concede that use as an exception to your rule of thumb? While I 
haven't experimented with it yet (still climbing learning curves) I'm 
curious about what other developers think of it.


For something like navigation, the correct way to do this is to use a 
Service, and call Service.startForeground() when you are actively 
doing work the user cares about (navigating).  This will also require 
that you post a notification, making the user aware of what you are 
doing (which by definition they already are, since the only reason to 
be foreground is because this is something the user directly cares 
about, so the notification gives them a facility to get back to it and 
manage it).




If one needed all the state but not really a service, isn't this what 
the Activity/ActivityFragment models? The state goes in the Activity and 
it is responsible for each ActivityFragment that it hosts and is in a 
position to ensure the proper state for the given fragment. I could well 
be out in left field here being fairly new to Android, but it seems to 
me that Notification is a little limited in what can be done as far as 
user interactions go?



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


Re: [android-developers] Newbie question - first attempt to run App on device gets Force Close

2012-03-16 Thread Ted Scott
Double check that the emulator you run on is versioned  lower than your 
device.


Observe the launch with DDMS view which should report the exception.

Run it under the debugger on your device.

On 3/16/2012 5:14 AM, Mister Macaverty wrote:

My app runs fine on the device emulator.

When I connect it to my device, however, and I run it, it gets as far
as showing the app title then I get a Force Close message.

Any suggestions for the approach I should take for finding out what's
causing the problem?

Many thanks
MM



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


Re: [android-developers] Re: Galaxy Nexus is not properly implementing getExternalStorageDirectory; can anyone confirm?

2012-03-15 Thread Ted Scott

On 3/14/2012 5:06 PM, GJTorikian wrote:
I wrote a reply to this, but I guess it was censored. I 
was complaining about manufacturer fragmentation, again.


If I have a directory like this: mnt/sdcard/app/dir

mkdirs(app/dir) fails; mkdirs(app) followed by mkdirs(app/dir) 
works. This is extremely unusual.


That's pretty much standard *nix behavior, Android being a modified 
linix kernal it's what I would expect.


--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Followup questions about detecting install / first launch

2012-03-15 Thread Ted Scott


I'm still getting my head around the API and can use a check if I'm 
understanding this right.


On 3/15/2012 6:48 AM, Mark Murphy wrote:

On Thu, Mar 15, 2012 at 4:06 AM, giles iangilesian@gmail.com  wrote:

I need to execute some code on app install event. How do i do it.

You don't.


Ok, I understand that ACTION_PACKAGE_INSTALL wasn't implemented. There 
is no broadcast to the app when its package is installed. Doesn't the 
installer from Market^H^H^H^H^H^H Play start the app as the default? I 
haven't published an app as yet so I'm not sure if it's configurable 
from the deployment console.



After some googleing i found there is no direct way. So which is the best
work around for that.

You do the work when the user first runs your app.


API 12 gave us ACTION_PACKAGE_FIRST_LAUNCH and 
ACTION_MY_PACKAGE_REPLACED. I've been writing to 8 and piggybacked my 
first run code to the DB helper, since what I'm doing needs a DB. I 
suppose it's easy enough to store an already ran flag in preferences and 
check that.


What are the techniques people have been using to manage this? Storing 
static versioning and checking it? Using the manifest versioning data? 
This may seem like a lame question, but curiosity has gotten the better 
of me. I guess what I'm asking is there are a lot of ways to skin this 
cat, what are people doing?


Is it worth using the broadcasts and maintaining  your own state to 
provide backward compatibility or is everyone saying bag that and just 
rolling their own?



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

2012-03-09 Thread Ted Scott
I have a service that obtains and stores sample data from a web service. 
It is triggered by alarms, gets a sample which may or may not be new, 
stores it in my DB.


At that point, if a new sample was added, and the activity that lists 
the samples is active, I want to notify it to refresh the cursor to 
include the new sample. If the activity isn't running, I don't care 
because it will be fine when it launches. If I set up a receiver and 
send a broadcast won't the broadcast cause it to launch if the activity 
isn't running? That is behavior that I don't want.


This isn't really a show stopper, but I would appreciate any strategy 
ideas you might have in making this happen in a reasonable amount of effort.


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


Re: [android-developers] Detecting if activity is running from service

2012-03-09 Thread Ted Scott


Thanks Mark.

On 3/9/2012 11:36 AM, Mark Murphy wrote:

On Fri, Mar 9, 2012 at 11:28 AM, Ted Scottt...@hootinholler.com  wrote:

At that point, if a new sample was added, and the activity that lists the
samples is active, I want to notify it to refresh the cursor to include the
new sample. If the activity isn't running, I don't care because it will be
fine when it launches. If I set up a receiver and send a broadcast won't the
broadcast cause it to launch if the activity isn't running? That is behavior
that I don't want.

Use an ordered broadcast to notify your foreground activity, and
possibly display a Notification if the activity is not in the
foreground:

http://commonsware.com/blog/2010/08/11/activity-notification-ordered-broadcast.html

Here is a sample demonstrating this:

https://github.com/commonsguy/cw-advandroid/tree/master/Broadcast/Ordered
I'll have a look and probably have some questions after I do. I already 
optionally send a notify that a new sample was stored.

Or, have your activity get its data from the service via a
ContentProvider, and use a ContentObserver (which happens
automagically if you are using a CursorLoader).

Ah, I'm coding to API level 8 so I'm using a managedQuery. It seemed 
like a lot of devices would be cut out if I went to a higher API level. 
I guess I'm feeling the frustrations of the moving platform now.


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


Re: [android-developers] Detecting if activity is running from service

2012-03-09 Thread Ted Scott

Thanks Justin!

I was already reading that page and thinking along the lines of maybe 
I'll just live with the minor issue. ;)


On 3/9/2012 11:39 AM, Justin Anderson wrote:

You can take a look at this:
http://developer.android.com/reference/android/app/ActivityManager.html#getRunningTasks%28int%29

But beware... The definition of a running app may not be what you 
think on Android.


Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Fri, Mar 9, 2012 at 9:28 AM, Ted Scott t...@hootinholler.com 
mailto:t...@hootinholler.com wrote:


I have a service that obtains and stores sample data from a web
service. It is triggered by alarms, gets a sample which may or may
not be new, stores it in my DB.

At that point, if a new sample was added, and the activity that
lists the samples is active, I want to notify it to refresh the
cursor to include the new sample. If the activity isn't running, I
don't care because it will be fine when it launches. If I set up a
receiver and send a broadcast won't the broadcast cause it to
launch if the activity isn't running? That is behavior that I
don't want.

This isn't really a show stopper, but I would appreciate any
strategy ideas you might have in making this happen in a
reasonable amount of effort.

-- 
You received this message because you are subscribed to the Google

Groups Android Developers group.
To post to this group, send email to
android-developers@googlegroups.com
mailto:android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
mailto:android-developers%2bunsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


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


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

Re: [android-developers] Detecting if activity is running from service

2012-03-09 Thread Ted Scott

On 3/9/2012 12:36 PM, Mark Murphy wrote:

On Fri, Mar 9, 2012 at 12:29 PM, Ted Scottt...@hootinholler.com  wrote:

feeling the frustrations of the moving platform now.

The Android Support package supports the Loader framework going back
to Android 1.6, if you are willing and able to inherit from
FragmentActivity.

^_-  Support Package?! Oh, I see I have some reading to do. Thanks! Looking 
at the SDK page, I don't know how I missed looking at that. Any pointers you 
might have to a nutshell description or pitfalls would be appreciated.

I'll have to look at the inheritance chain about being able to work 
FragmentActivity in. I have a position and expansion state tracking 
object sitting between my activity and ExpandableListActivity.

And, you can still use a ContentObserver to let you know when the
stuff you queried in your managedQuery() is altered(). It's just not
automatic (IIRC).

Ok, now that I know what to look for, I can probably figure it out. This 
may be the simplest solution. Thanks.


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


Re: [android-developers] Detecting if activity is running from service

2012-03-09 Thread Ted Scott

On 3/9/2012 1:52 PM, Mark Murphy wrote:

On Fri, Mar 9, 2012 at 1:35 PM, Ted Scottt...@hootinholler.com  wrote:

^_-  Support Package?! Oh, I see I have some reading to do. Thanks!
Looking at the SDK page, I don't know how I missed looking at that. Any
pointers you might have to a nutshell description or pitfalls would be
appreciated.

http://en.wikipedia.org/wiki/Nutshell

:-)


Straight lines R us

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


Re: [android-developers] Android customize expandable list view encountered a problem

2012-03-08 Thread Ted Scott

On 3/5/2012 10:38 PM, Zheng Martin wrote:
please go to see this topic first. 
http://stackoverflow.com/questions/9562043/expandablelistview-when-i-click-button-update-imageview#comment12121717_9562043 



I pasted the problem in stackoverflow, without any answer.

please help me to resolve it when you are free.

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 

Answered

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


Re: [android-developers] Re: CursorAdapter? or OtherAdapter?

2012-03-04 Thread Ted Scott
What Mark was asking is why are rows you do not need included in the 
results pointed to by the cursor.


The cursor is loaded by a DB query. That is where you should apply 
filtering, etc and the cursor should contain only what you need to 
display at that moment. If your cursor has extra data, then adjust your 
query to return only the rows you need. If you need several different 
queries you can use more than one URI in your content provider so that 
you map one URI to one query.


Choosing between an ArrayAdapter and a CursorAdapter really should be 
driven by where the data are stored and how big of a list you have. 
Without more knowlege of your app, it's hard to know which would be 
better, but in general it is silly to unload a cursor into an array for 
display when you can just use the cursor unless you have a compelling 
reason not to.


On 3/3/2012 11:28 AM, Build Account wrote:

Hello.

Well,
I don't understand what you point out 'these' part.
But simply say it again,
I'm looking for simplest way to not touch the current cursor further.
And i can not use selectionArg since that available datas are kind
of...random.(of course there is a condition to filter out row by row :
( ).

Is there any way to mask(or filter) record as what I need under cursor
adapter?
if there is no way, I may shoud use ArrayAdapter by manually

What do you think?



On Mar 3, 9:11 pm, Mark Murphymmur...@commonsware.com  wrote:

Why are these rows in your Cursor in the first place, if they are not
to be used?





On Sat, Mar 3, 2012 at 1:59 AM, Build Accountnewandroi...@gmail.com  wrote:

Hello,
If I have a cursor and need to display as a list through adapter,
then which adapter is best under below condition?
  The cursor have datas(of course).
But this cursor contains some of rows which should not be displayed.
For example, totally 10 records, but index 1, 4, 5, 8 should not be
displayed.
(Means, not sequentially sorted. and also cannot sort it by sort
order.).
With above cursor data,
how to filter out only available datas(which index 0, 2, 3, 6, 7, 9)
in adapter?
Any ideas or way to do???
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

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

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


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


Re: [android-developers] nested listview

2012-02-26 Thread Ted Scott
Sounds like you want an ExpandableListView 
http://developer.android.com/reference/android/widget/ExpandableListView.html


On 2/26/2012 9:25 AM, hazem omies wrote:

hi,,,

how i can make nested listview as follow :

main activity contain a listview binding from web servers XML
parser  ,,my issue is when click on item ,,the seconed listview open
related to this item as nested ,,??



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


Re: [android-developers] nested listview

2012-02-26 Thread Ted Scott
If I understand what you mean, then yes, except it is all handled in the 
ExpandableListView. You provide 2 lists, via some adapter, one is the 
parent list and the other a child list which you get by over-riding a 
getChildren method, depending how your lists are obtained.  (In an 
implementation I did, I use a DB to back the lists, so I use a 
SimpleCursorTreeAdapter and I override getChildrenCursor) Have a look at 
the expandable list examples in the api demos, there are 3 data source 
flavors in there.


On 2/26/2012 10:24 AM, hazem omies wrote:

hi Ted ,

many thanks Ted , but i need when open item passing value to other 
intent listview ,,this is doable ??


On Sun, Feb 26, 2012 at 5:10 PM, Ted Scott t...@hootinholler.com 
mailto:t...@hootinholler.com wrote:


Sounds like you want an ExpandableListView

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



On 2/26/2012 9:25 AM, hazem omies wrote:

hi,,,

how i can make nested listview as follow :

main activity contain a listview binding from web servers XML
parser  ,,my issue is when click on item ,,the seconed
listview open
related to this item as nested ,,??


-- 
You received this message because you are subscribed to the Google

Groups Android Developers group.
To post to this group, send email to
android-developers@googlegroups.com
mailto:android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
mailto:android-developers%2bunsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


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


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

Re: [android-developers] Re: Beginner Question

2012-02-23 Thread Ted Scott


On 2/23/2012 11:55 AM, Kookamonga wrote:

Mark has way more experience than me, so I'll let him give the
definitive answer... But my two cents are that it depends on the
situation. :-)

I don't think there is a definitive answer here, only reasonable ones.

For example, if the widget for which you are writing the listener will
only appear in this Activity, then having the Activity itself
implement the interface is probably fine. But, say for example you're
creating some layout that appears on all of your activities (maybe a
common group of buttons or something like that), then I would create a
separate reusable listener class that saves you from having to
duplicate code.
Good point. I don't have a particular problem starting out with the 
anonymous class early in the project. When it's needed elsewhere It's a 
straight forward refactoring to extract the class. I'm pretty new to 
Android, at first glance, I'm not sure how useful this would be in the 
button group. Wouldn't each button need its own listener? Wouldn't there 
be an activity associated with them?



On Feb 23, 11:35 am, rhaazyrha...@gmail.com  wrote:

I think I over estimated my ability to jump right into this without
learning a bit more about the java language.
Thanks again!
http://javaranch.com is a pretty good resource for getting up to speed 
in the language.



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


Re: [android-developers] Re: start at boot app gives instantiationException:

2012-02-23 Thread Ted Scott

On 2/23/2012 11:18 AM, Thomas wrote:

I've continued to experiment.  I wanted to send an attachment file but
but here is a portion of the  logcat showing the RxBcast failing at
bootup and after the Emulator is opened then running correctly.
look for **  I unlock  emulator
The same thing happens on my DroidX2 Fails on boot after keyboard is
unlocked and then works correct when started by touching icon.

***  Bad stuff here
E/AndroidRuntime(  237): FATAL EXCEPTION: mainE/AndroidRuntime(  237):
java.lang.RuntimeException: Unable to instantiate receiver
com.needham.PiesOfCod.RxBcast: java.lang.ClassNotFoundException:
com.needham.PiesOfCod.RxBcast in loader dalvik.system.PathClassLoader[/
data/app/com.needham.RxBcast-1.apk]E/AndroidRuntime(  237): at
android.app.ActivityThread.handleReceiver(ActivityThread.java:2789)E/

Looks like a configuration issue. Before you started experimenting, did 
you get the stuff I posted working?


What's in your manifest? What does your project's code tree look like?

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


Re: [android-developers] Re: start at boot app gives instantiationException:

2012-02-23 Thread Ted Scott

That's one error and certainly explains the class not found exception.

I'm not sure but you also might need a default category for the activity 
definition.

category android:name=android.intent.category.DEFAULT /

What do you mean by you have to debug as an Android? Of course you have 
to run the code on a device to debug it. Also you won't be able to 
attach the debugger to your receiver because it will fire before the 
DDMS is attached.


On 2/23/2012 4:50 PM, YuviDroid wrote:

There's something odd with the package names :S:S:S

If your BroadcastReceiver package name is package 
com.needham.RxBcast; then also in the manifest you should use the 
same package:

receiver android:name=com.needham.RxBcast.RxBcast 

or correct the package name and make it package com.needham; and the 
receiver in the manifest: receiver android:name=com.needham.RxBcast .



On Thu, Feb 23, 2012 at 10:32 PM, Thomas tbirchm...@usa.net 
mailto:tbirchm...@usa.net wrote:


It is the program you sent me.  I noticed that I have to debug as an
Android to get the
Log.d  statements to work.



package com.needham.RxBcast;

import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.util.Log;


public class RxBcast extends BroadcastReceiver {

   private static final String TAG = RxBcast77;
   private static final int NOTE_ID = 1;

   @Override
   public void onReceive(Context c, Intent i) {
   // check and handle registerable actions
   String act = i.getAction();
   Log.d(TAG, Rxd + act );
   if( act.equals(i.ACTION_BOOT_COMPLETED) ) {
   Intent si = new Intent(c, PiesOfCodActivity.class);
   si.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
   c.startActivity(si);
   }
   } // onReceive

}

*
package com.needham.RxBcast;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

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

   private static final String TAG = RxBcast77;

   public void onCreate(Bundle savedInstanceState) {


   Log.d(TAG, POCA777 + savedInstanceState );
  super.onCreate(savedInstanceState);
   TextView tv = new TextView(this);
   tv.setText(Hello, Pies of Cod!);
   setContentView(tv);
   }
}

**
?xml version=1.0 encoding=utf-8?
manifest xmlns:android=http://schemas.android.com/apk/res/android;
   package=com.needham.RxBcast
   android:versionCode=1
   android:versionName=1.0 

uses-sdk android:minSdkVersion=7 /
uses-permission
android:name=android.permission.RECEIVE_BOOT_COMPLETED /

application
android:icon=@drawable/ic_launcher
android:label=@string/app_name 
activity
android:name=.PiesOfCodActivity
android:label=@string/app_name 
intent-filter
action android:name=android.intent.action.MAIN /

category android:name=android.intent.category.LAUNCHER /
/intent-filter
/activity

!-- android.intent.action.BOOT_COMPLETED --
receiver android:name=com.needham.PiesOfCod.RxBcast 
intent-filter
action android:name=android.intent.action.BOOT_COMPLETED /
/intent-filter
intent-filter
action android:name=com.needham.PiesOfCode.LAUNCH_APP /
/intent-filter
/receiver

/application
/manifest


On Feb 23, 2:16 pm, Ted Scott t...@hootinholler.com
mailto:t...@hootinholler.com wrote:
 On 2/23/2012 11:18 AM, Thomas wrote: I've continued to
experiment.  I wanted to send an attachment file but
  but here is a portion of the  logcat showing the RxBcast
failing at
  bootup and after the Emulator is opened then running correctly.
  look for **  I unlock  emulator
  The same thing happens on my DroidX2 Fails on boot after
keyboard is
  unlocked and then works correct when started by touching icon.

  ***  Bad stuff here
  E/AndroidRuntime(  237): FATAL EXCEPTION:
mainE/AndroidRuntime(  237):
  java.lang.RuntimeException: Unable to instantiate receiver
  com.needham.PiesOfCod.RxBcast: java.lang.ClassNotFoundException:
  com.needham.PiesOfCod.RxBcast in loader
dalvik.system.PathClassLoader[/
  data/app/com.needham.RxBcast-1.apk]E/AndroidRuntime(  237):  
 at

 
android.app.ActivityThread.handleReceiver(ActivityThread.java:2789)E/

 Looks like a configuration issue. Before you started
experimenting, did

Re: [android-developers] Re: start at boot app gives instantiationException:

2012-02-21 Thread Ted Scott
Did you follow the steps I outlined? What intent are you speaking of 
that can't find the app? Speaking of the app, you're talking about the 
hello world or pies of cod app, right? What do you mean by an external app?


Tell us exactly what you are doing and maybe we can help.

On 2/21/2012 9:11 AM, Thomas wrote:

Thanks to all who have contributed answers to my questions.  The last
problem is that the intent cannot find the called app.  Perhaps it's a
misspelling or perhaps the fact it's an external app and I need some
slightly different intent format, or maybe lots of things.  I'll keep
at this and when I get the syntax correct, I'll post the answer.
Google searching turns up lot of commentary on the subject but all of
the snippets have proven not to work.
Best,
Tom B

On Feb 20, 6:46 pm, Ted Scottt...@hootinholler.com  wrote:

On 2/20/2012 2:26 PM, Thomas wrote:


I'll make another request then.  Please post the code and manifest for
a simple something that will start the helloworld app at bootup.
The helloworld app is just a test case to see if things are working at
bootup. I have a far more complicated embedded application to test
after that.
Best,
Tom B

You know I explained where to get the information you were missing is
at, I even explained what you were confused about.  If indeed you have a
far more complicated embedded app to test, judging by the level of your
questions and failure to understand or even explore the material given
to you, I predict you will be bricking that device.

Nonetheless for the comedic value I give you Pies Of Cod, or at least
the parts you asked for. Yes this code executes and launches the app
Pies Of Cod when it is in a proper app environment. It took me about
half an hour to cobble together. Of course you'll want to adjust the
imports and packages to fit your environment so I omitted them. The view
is the main.xml you get from an eclipse generated hello world app.

First make a new android app named PiesOfCod in your workspace. Launch
it and make sure it runs.

Then you need to create a receiver class:
public class RxBcast extends BroadcastReceiver {

  private static final String TAG = RxBcast;
  private static final int NOTE_ID = 1;

  @Override
  public void onReceive(Context c, Intent i) {
  // check and handle registerable actions
  String act = i.getAction();
  Log.d(TAG, Rxd + act );
  if( act.equals(i.ACTION_BOOT_COMPLETED) ) {
  Intent si = new Intent(c, PiesOfCodActivity.class);
  si.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  c.startActivity(si);
  }
  } // onReceive

}

Then change the strings:

?xml version=1.0 encoding=utf-8?
resources
string name=helloPies Of Cod!/string
string name=app_namePiesOfCod/string
/resources

Then adjust the manifest, yes you will have to use your package names,
etc. mine won't work for you:

uses-sdk android:minSdkVersion=8 /
uses-permission android:name=android.permission.RECEIVE_BOOT_COMPLETED /

application
  android:icon=@drawable/ic_launcher
  android:label=@string/app_name
activity
  android:name=.PiesOfCodActivity
  android:label=@string/app_name
intent-filter
action android:name=android.intent.action.MAIN /

category android:name=android.intent.category.LAUNCHER /
/intent-filter
/activity

!-- android.intent.action.BOOT_COMPLETED --
receiver android:name=com.hootinholler.PiesOfCod.RxBcast
intent-filter
action android:name=android.intent.action.BOOT_COMPLETED /
/intent-filter
intent-filter
action android:name=com.hootinholler.PiesOfCode.LAUNCH_APP /
/intent-filter
/receiver

/application

Build it, launch it, then restart the AVD that you have it installed on
and it should be open when you unlock the AVD.

Good luck with your very complicated embedded application, and please
keep us informed on how that is going.


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


Re: [android-developers] Re: start at boot app gives instantiationException:

2012-02-21 Thread Ted Scott

On 2/21/2012 3:02 PM, Thomas wrote:

The compile error:
* PiesOfCodActivity cannot be resolved to a type

The error essentially is that the RxBcast cannot be aware of an
external app that exists on an Android somewhere.  The
PiesOfCodActivity is a retitled helloworld that works just fine on
my Android.
Perhaps there is some sort of intent construction where the app-to-be-
is a string that represents future runtime intentions.
Thanks for all of your good thoughts and help.
Of course not you put it in a different application. That's not what I 
thought you asked about, I thought you wanted an app that would launch 
at boot. Did you get it working with the receiver in the same package?


To launch another activity outside your package you need different 
information in the intent. One way is to specify the package of the 
other app:
Intent si = new 
Intent(Intent.ACTION_MAIN).setPackage(com.hootinholler.PiesOfCod);


The other app needs to have an action MAIN defined in its manifest and 
it also needs a category DEFAULT

category android:name=android.intent.category.DEFAULT /

I've tested this here with one application that only has the 
PiesOfCodActivity in the PiesOfCod package and another app that only has 
the RxBcast in a Pies package and constructs the intent as above.


Really this didn't take that much to solve given a little reading and 
experimentation. I agree with Tre that you should probably read up on 
Intents and how they get created and resolved.


Also I don't think it will be a good idea to have an app with no 
launchable activity as it could make it hard for users to uninstall


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


Re: [android-developers] Re: start at boot app gives instantiationException:

2012-02-20 Thread Ted Scott
Review the components section here 
http://developer.android.com/guide/topics/fundamentals.html


You are confusing a BroadcastReceiver with an Activity, and there's 
nothing you can add to the manifest to correct that since an activity 
tag can't describe or invoke a receiver. If you want to launch something 
at boot, then code a receiver that launches the app.


On 2/20/2012 10:34 AM, Thomas wrote:

Actually, I don't.  What should the manifest be in this case?
Tom B

On Feb 20, 10:05 am, TreKingtreking...@gmail.com  wrote:

You have the following:

public abstract class StartAtBootActivity extends *BroadcastReceiver*{




*activity *android:name=.StartAtBootActivity

See the problem with this scenario?

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


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


Re: [android-developers] Re: start at boot app gives instantiationException:

2012-02-20 Thread Ted Scott

On 2/20/2012 2:26 PM, Thomas wrote:

I'll make another request then.  Please post the code and manifest for
a simple something that will start the helloworld app at bootup.
The helloworld app is just a test case to see if things are working at
bootup. I have a far more complicated embedded application to test
after that.
Best,
Tom B



You know I explained where to get the information you were missing is 
at, I even explained what you were confused about.  If indeed you have a 
far more complicated embedded app to test, judging by the level of your 
questions and failure to understand or even explore the material given 
to you, I predict you will be bricking that device.


Nonetheless for the comedic value I give you Pies Of Cod, or at least 
the parts you asked for. Yes this code executes and launches the app 
Pies Of Cod when it is in a proper app environment. It took me about 
half an hour to cobble together. Of course you'll want to adjust the 
imports and packages to fit your environment so I omitted them. The view 
is the main.xml you get from an eclipse generated hello world app.


First make a new android app named PiesOfCod in your workspace. Launch 
it and make sure it runs.


Then you need to create a receiver class:
public class RxBcast extends BroadcastReceiver {

private static final String TAG = RxBcast;
private static final int NOTE_ID = 1;

@Override
public void onReceive(Context c, Intent i) {
// check and handle registerable actions
String act = i.getAction();
Log.d(TAG, Rxd + act );
if( act.equals(i.ACTION_BOOT_COMPLETED) ) {
Intent si = new Intent(c, PiesOfCodActivity.class);
si.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
c.startActivity(si);
}
} // onReceive

}

Then change the strings:

?xml version=1.0 encoding=utf-8?
resources
string name=helloPies Of Cod!/string
string name=app_namePiesOfCod/string
/resources


Then adjust the manifest, yes you will have to use your package names, 
etc. mine won't work for you:


uses-sdk android:minSdkVersion=8 /
uses-permission android:name=android.permission.RECEIVE_BOOT_COMPLETED /

application
android:icon=@drawable/ic_launcher
android:label=@string/app_name 
activity
android:name=.PiesOfCodActivity
android:label=@string/app_name 
intent-filter
action android:name=android.intent.action.MAIN /

category android:name=android.intent.category.LAUNCHER /
/intent-filter
/activity

!-- android.intent.action.BOOT_COMPLETED --
receiver android:name=com.hootinholler.PiesOfCod.RxBcast 
intent-filter
action android:name=android.intent.action.BOOT_COMPLETED /
/intent-filter
intent-filter
action android:name=com.hootinholler.PiesOfCode.LAUNCH_APP /
/intent-filter
/receiver

/application

Build it, launch it, then restart the AVD that you have it installed on 
and it should be open when you unlock the AVD.


Good luck with your very complicated embedded application, and please 
keep us informed on how that is going.


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


Re: [android-developers] What is the significance of main.xml.out file?

2012-02-19 Thread Ted Scott

On 2/17/2012 11:27 PM, Kedar wrote:

What is the  significance of main.xml.out file?

Sometimes while debugging the application, I am getting an error in
the main.xml file

Basically it means that you have invoked some transformation on the 
main.XML file, possibly by having it selected and hitting the run button 
(there are configurations that control this behavior on the list within 
the last month)


You should probably delete it since it will confuse the build of your 
project.


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

2012-02-18 Thread Ted Scott
Is there a way to find out if I have an existing alarm waiting or do I 
have to create some sort of state variable and keep track of it?



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

2012-02-18 Thread Ted Scott
I'm running a service that monitors a metric and I want it to colorize 
the app icon dependent on the values.


Do I have to build a widget to interact with it or is there some way I 
can just replace the image?


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

2012-02-15 Thread Ted Scott
Please don't take this the wrong way, I'm not complaining, just 
observing. I have to say that between the ESL and txt speak this list 
has some really funny moments.


The mental image I got from pies of cod will have me smiling for the 
rest of the week. I'm wondering if it's some new way of preparing lutefisk.


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


Re: [android-developers] building workspace lockup in eclipse

2012-02-13 Thread Ted Scott
There's  a problem in r16 when launching on v2.2 with logcat when the 
launch logcat on error is set. It causes a deadlock condition. It's 
slated for a fix on r17.


Go to window - preferences - android - logcat and uncheck launch 
logcat on error.


On 2/13/2012 6:52 AM, vivek elangovan wrote:

hi members,
  * I have two Android projects in my Eclipse
workspace
  * Compiling the first  project works fine
  * The second one always hangs (at 27% complete)
  * Every time i have to restart my eclipse and have to
compile the project again

what may be the 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


Re: [android-developers] What do you all use for automated testing?

2012-02-13 Thread Ted Scott

On 2/13/2012 8:17 AM, Mark Murphy wrote:

On Sun, Feb 12, 2012 at 7:34 PM, Todd Grigsbytgrigsby...@gmail.com  wrote:

I use a college kid.  He's getting intern credits.  Highly recommended.

Yeah, but isn't automating a college kid a violation of the Geneva Convention?

:-)


Nah, provide pizza and beer and they are self-automating. YMMV

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


Re: [android-developers] Re: Almost nobody is rating my app.

2012-02-09 Thread Ted Scott
As long as you are not tying the enhancement to a rating level, I don't 
think that would violate the policy.


Now telling whether or not someone actually rated the app is a different 
issue.


On 2/9/2012 1:18 PM, Mark Phillips wrote:


My apologies for recommending something against the market policies. I 
was not aware of that policy. I am just starting out, so I have not 
gotten that far in the process to actually put an app  on the market.


BTW, I was not advocating making an offer for a better rating. I meant 
an incentive for the user to just rate the game.


Mark

On Feb 9, 2012 11:08 AM, a1 arco...@gmail.com 
mailto:arco...@gmail.com wrote:


Could you release an update and offer something for the
rating? Additional levels, characters, some way to personalize
the game for the user? 



Which is, of course, violation of market content policy terms
(http://www.android.com/us/developer-content-policy.html  see
Spam and Placement section: Developers also should not attempt
to change the placement of any Product in the Store by rating an
application multiple times, or by offering incentives to users to
rate an application with higher or lower ratings.)

To OP, 1 rating for ca. 400-500 user is what I'm seeing in my free
games, also take a quick look at other free games on market it's
looks like this is more or less what you should expect.

--
Bart
-- 
You received this message because you are subscribed to the Google

Groups Android Developers group.
To post to this group, send email to
android-developers@googlegroups.com
mailto:android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
mailto:android-developers%2bunsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

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


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

[android-developers] FYI ADT r16 hangs running AVD 2.2 on relaunch or debug

2012-02-06 Thread Ted Scott
This is an update to the problem I encountered and posted on earlier. 
The fix is scheduled for r17.


There are 3 hang cases which apply to AVD 2.2:
1: Relaunching a changed application which hangs at 27% progress.
2: Launching the application in the debugger. Both cases hang when the 
launch logcat on error is true and logcat level is verbose.

3: Launching the DDMS perspective

The workaround is to uncheck launch logcat at 
window-preferences-android-LogCat


The problem report is here: 
http://code.google.com/p/android/issues/detail?id=24926



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


Re: [android-developers] Re : eclipse crash

2012-02-03 Thread Ted Scott
Are you running an AVD on 2.2? There is a weird problem with eclipse and 
that version of the emulator. See issue 24926 
http://code.google.com/p/android/issues/detail?id=24926


Try this:

1. In Window -  Preferences -  Android -  logcat, turn off the option to 
automatically show logcat
if there is a warning/error from an app in workspace.


On 2/3/2012 6:45 AM, vivek elangovan wrote:

Hi members,
i am using eclipse-java-indigo-SR1(32-bit ubuntu
10.04) for android projects development.If i build some application
and run it as android application it works fine,but if i make some
changes to my class files and again running it as android application
the eclipse building project and stops at 27%. And it is working fine
when I have to complete stop eclipse and start again.what may be the
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


Re: [android-developers] Android LocationManager GPS Reading Never Changes While Screen is Off

2012-02-03 Thread Ted Scott


I do a similar thing by running a service from an alarm, it checks 
position every 15 mins. It works while I'm just toting the phone around 
in my pocket screen locked. It even works while the app is closed as 
long as the app has been started since boot and the alarm initialized.


Maybe it has something to do with the activity being suspended?

On 1/31/2012 9:50 PM, Joshua Witter wrote:

I posted this same question on StackOverflow if anyone wants the karma
for answering it there.

This is on an Android phone running 2.3.3 Gingerbread. I am trying to
log a GPS location while the screen is off. When the screen is on, the
GPS gives correct outputs... driving around in my car I have a phone
hooked up to my laptop and I read the output with logcat. Under the
same conditions, when I turn off the screen the GPS gives the same
location over and over, until I turn on my screen again at which time
it works properly.

Here is my manifest file (note the WAKE_LOCK and GPS permissions as
well as the LocationService definition):



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


Re: [android-developers] What do these errors mean (using Eclipse)?

2012-02-01 Thread Ted Scott

On 2/1/2012 4:11 AM, atcal wrote:

I'm trying to define my own View subclass.

public class myView extends View {

 myView(Context context) {
 View(context);
 }
}

Eclipse flags the first line of my constructor with an error Implicit
super conctructor View() is undefined. Must explicitly invoke another
constructor and the second line is flagged with the error The method
View(Context context) is undefined for the type myView.

What does all this mean? The android documentation shows the
constructor View(Context context) as public. Why can't I use it?


There are several reasons why View() is not available and will never be 
available.


It means you don't understand class instantiation and the life cycle of 
a class. This is not an Android issue at all and I suggest that you 
spend some time learning Java fundamentals. These folks are generally 
pretty helpful with that http://www.javaranch.com/



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


Re: [android-developers] Re: What do these errors mean (using Eclipse)?

2012-02-01 Thread Ted Scott

On 2/1/2012 11:01 AM, atcal wrote:

On Feb 1, 4:25 pm, Ted Scottt...@hootinholler.com  wrote:

On 2/1/2012 4:11 AM, atcal wrote:






I'm trying to define my own View subclass.
public class myView extends View {
  myView(Context context) {
  View(context);
  }
}
Eclipse flags the first line of my constructor with an error Implicit
super conctructor View() is undefined. Must explicitly invoke another
constructor and the second line is flagged with the error The method
View(Context context) is undefined for the type myView.
What does all this mean? The android documentation shows the
constructor View(Context context) as public. Why can't I use it?

There are several reasons why View() is not available and will never be
available.

It means you don't understand class instantiation and the life cycle of
a class. This is not an Android issue at all and I suggest that you
spend some time learning Java fundamentals. These folks are generally
pretty helpful with thathttp://www.javaranch.com/- Hide quoted text -

- Show quoted text -

Ted,

Thanks. You are probably right. While I have 10 yrs experience of C++
with Windows and Java looks deceptively similar, things like this are
tripping me up. I do understand about classes and instantiating
objects but obviously not the peculiarities of Java. I've tried to
register at javaranch but the website is not fast at sending back the
registration activation email. I'll have to learn to be patient.

I meant that they have tutorials and stuff. Since you have the syntax  
etc from c++ then maybe the O'Riely book Java in a Nutshell would be 
helpful. Oh, and you can forget the evil multiple inheritance and 
pointer stuff. ;)


Probably a little tedious for you, but there is this: 
http://docs.oracle.com/javase/tutorial/java/javaOO/index.html which 
lacks a bit of detail as to why, but does cover the how of fundamentals.




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


Re: [android-developers] Re: Crash after StartActivity

2012-01-30 Thread Ted Scott

I have an app that invokes a service in the background from an alarm:

// Ok, let's try running the service via a repeating alarm...
// We need to make a PendingIntent from the service intent...
Intent si = new Intent(this, xxxService.class);
PendingIntent pi = PendingIntent.getService(this, 0, si, 
PendingIntent.FLAG_UPDATE_CURRENT);


// Set the first time the alarm should trigger to be an hour 
ago in milliseconds...

long when = new Date().getTime() - 36;
AlarmManager alarm = (AlarmManager) 
getSystemService(Context.ALARM_SERVICE);
alarm.setInexactRepeating(alarm.RTC_WAKEUP, when, 
alarm.INTERVAL_HOUR, pi);


It does a web service call approximately every hour after the app is run 
the first time. Because it uses the Inexact method it is likely the 
phone is doing something else also. The user never sees it run.


If you are launching an Activity that needs the screen then I think that 
is when you need the NEW_ACTIVITY_FLAG? I have the following in use to 
start an activity that displays a record selected on a list:


// display the whole record in its own activity.
Intent detailIntent = new Intent(Intent.ACTION_VIEW,
Uri.parse(Sample.CONTENT_URI+/+id),
ctx,
xxxActivity.class);
detailIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
try {
ctx.startActivity(detailIntent);
}
catch (Exception e) {
String foo = e.getMessage();
Log.e(Caught It:,foo);
}

I'm not yet sure I'm clear myself on when the flag is required.

On 1/29/2012 1:03 PM, Kostya Vasilyev wrote:

Correct.

Keep in mind though, that, except for some specific cases (an alarm 
clock and the like), this -- an activity popping out of nowhere -- can 
be an unexpected and jarring experience for the user.


I can see it as a plot device for Final Destination 6: someone's 
bleeding to death, trying to call 911 on his Android phone, and is 
interrupted by a popup window: 5 days to Jane's birthday. Cut to black.


:)

-- Kostya

29 января 2012 г. 21:41 пользователь Rudolf Polzer 
rudolf.pol...@i-r-p.de mailto:rudolf.pol...@i-r-p.de написал:


The LogCat contents after the crash is

ERROR/AndroidRuntime(19994): java.lang.RuntimeException: Unable to
start receiver irp.plan.OnAlarmReceiver:
android.util.AndroidRuntimeException: Calling startActivity() from
outside of an Activity  context requires the
FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
...
ERROR/AndroidRuntime(19994): Caused by:
android.util.AndroidRuntimeException: Calling startActivity() from
outside of an Activity  context requires the
FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?

So I guess I have to add the FLAG_ACTIVITY_NEW_TASK flag to the
intent to start the activity, because the startActivity() is
called from inside the message receiver OnAlarmReceiver.


Am 29.01.2012 16:09, schrieb Kostya Vasilyev:

Press F8 (Resume) in Eclipse a few times until you get the
crash dialog
on the device.

Then check the logcat.

Look for the part after Caused by:

-- Kostya

29.01.2012 15:21, Rudolf Polzer пишет:

The manifest file contains
activity android:name=.WakeActivity/activity
within theapplication tag.

The stack is
ActivityThread.handleReceiver(ActivityThread$ReceiverData)
line:
2639
ActivityThread.access$3100(ActivityThread, ActivityThread
$ReceiverData) line: 119
ActivityThread$H.handleMessage(Message) line: 1913
ActivityThread$H(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 123



-- 
You received this message because you are subscribed to the Google

Groups Android Developers group.
To post to this group, send email to
android-developers@googlegroups.com
mailto:android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
mailto:android-developers%2bunsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


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


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

[android-developers] r16 and eclipse - debugger and relaunch is hosed

2012-01-30 Thread Ted Scott
This is driving me nuts. A couple of others have reported it, but no one 
seems to have a work around or even why this is happening.


I had a working set of projects until the r16 SDK/ADT update. Now I can 
run an emulator with an app the first time I launch it. I cannot run or 
launch under the debugger, as the emulator hangs waiting for the 
debugger to connect. On relaunch, eclipse sits at 27% progress while 
launching app.


Eclipse must be restarted to launch, and when eclipse is stopped the run 
image of eclipse is still in memory and must be killed.


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


Re: [android-developers] Have I missed some step to be able to post?

2012-01-30 Thread Ted Scott

Thanks, Mark!

I just didn't know the drill, and seeing some very basic questions being 
posted got me wondering. Now that I got the flood I realize I was simply 
being impatient.


On 1/30/2012 12:10 PM, Mark Murphy wrote:

[android-developers], like most Google Groups, is moderated. The
moderator just flushed the queue. You should now be able to post
without further interruption.

Or, use StackOverflow and the android tag.

On Sun, Jan 29, 2012 at 4:16 PM, Ted S.t...@hootinholler.com  wrote:

I've been having problems with the r16 update to the AVD manager and
ADT in eclipse Indigo.

I've attempted to post a reply to someone else with similar issues.
I've answered a couple of other posts and I'm not seeing my posts.

Am I waiting on someone to approve me? Have I missed some step in
registering?

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





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


Re: [android-developers] Re: Android SDK Tools r16 and problems with Eclipse

2012-01-30 Thread Ted Scott
I'm surprised there only seems to be you and I talking about this. I 
wonder what makes us special?


I really don't want to lose the configuration in eclipse and the DBs on 
my AVDs which is what I fear will happen if I have to reinstall everything.


On 1/30/2012 12:02 PM, DanielleM wrote:

I'm so glad someone else has been having these issues as well. I
haven't tried to roll back to an earlier version of the SDK yet...and
I'm afraid it's going to require a complete uninstall and re-install
which is why I've been hesitant to do this.

I hope there will be some kind of fix soon.

On Jan 27, 5:46 pm, Ted S.t...@hootinholler.com  wrote:

I'm having the same problems in eclipse Indigo.

I can run an app on the emulator first time.

Reloading a changed app hangs at 27% launch. Requires relaunching eclipse,
and leaves old eclipse image running which must be killed.

Attempting to debug results in Waiting for debugger to attach on AVD,
eclipse never shifts to debug perspective.

This behavior is new to r16 update. I'm not sure how to back out the
update, and have not found a workaround as yet.


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


Re: [android-developers] Re: Android SDK Tools r16 and problems with Eclipse

2012-01-30 Thread Ted Scott

Danielle,

Is your LogCat view set to 'verbose'? I just changed mine to 'debug' and 
everything started working. I opened a defect report on this: 
http://code.google.com/p/android/issues/detail?id=24926


Let me know if it works for you.

-Ted

On 1/30/2012 1:10 PM, DanielleM wrote:

Yes that's my fear too. And I had been having the issues you describe
about the interface hanging at 27% when trying to re-launch an
emulator...although I'm thinking I was having those problems even
right before r16. That was very annoying but at least you could close
it, kill the process and restart and it would work. When everything
totally freezes and crashes when trying to get screen captures from
the DDMS screen is what makes it useless.

I had to transfer my files to another machine that I happened to not
have updated yet in order to get those. But that situation may not
always be possible if I'm working remotely and only have my laptop to
work on.

It's just nice to know that I'm not the only one with these issues. :)

On Jan 30, 12:52 pm, Ted Scottt...@hootinholler.com  wrote:

I'm surprised there only seems to be you and I talking about this. I
wonder what makes us special?

I really don't want to lose the configuration in eclipse and the DBs on
my AVDs which is what I fear will happen if I have to reinstall everything.

On 1/30/2012 12:02 PM, DanielleM wrote:








I'm so glad someone else has been having these issues as well. I
haven't tried to roll back to an earlier version of the SDK yet...and
I'm afraid it's going to require a complete uninstall and re-install
which is why I've been hesitant to do this.
I hope there will be some kind of fix soon.
On Jan 27, 5:46 pm, Ted S.t...@hootinholler.comwrote:

I'm having the same problems in eclipse Indigo.
I can run an app on the emulator first time.
Reloading a changed app hangs at 27% launch. Requires relaunching eclipse,
and leaves old eclipse image running which must be killed.
Attempting to debug results in Waiting for debugger to attach on AVD,
eclipse never shifts to debug perspective.
This behavior is new to r16 update. I'm not sure how to back out the
update, and have not found a workaround as yet.


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


Re: [android-developers] Re: Android SDK Tools r16 and problems with Eclipse

2012-01-30 Thread Ted Scott


Out of desperation I started poking it with a stick whilst yelling 
BEHAVE! ;)


Actually, I started going through settings fairly methodically since I 
figured if not many were seeing this issue it was probably some 
configuration that isn't very common. I was pleasantly surprised when it 
started working and it's really good to have some confirmation that this 
is a real problem.


On 1/30/2012 3:07 PM, DanielleM wrote:

Ted,

Yes that actually worked for me as well!!! I don't know how you
figured that out but nice job. I never would have thought that
changing that one particular setting could have that big of an effect.

Hopefully this will get fixed now that you've filed a report.

Thanks,
Danielle

On Jan 30, 3:00 pm, Ted Scottt...@hootinholler.com  wrote:

Danielle,

Is your LogCat view set to 'verbose'? I just changed mine to 'debug' and
everything started working. I opened a defect report on 
this:http://code.google.com/p/android/issues/detail?id=24926

Let me know if it works for you.

-Ted

On 1/30/2012 1:10 PM, DanielleM wrote:








Yes that's my fear too. And I had been having the issues you describe
about the interface hanging at 27% when trying to re-launch an
emulator...although I'm thinking I was having those problems even
right before r16. That was very annoying but at least you could close
it, kill the process and restart and it would work. When everything
totally freezes and crashes when trying to get screen captures from
the DDMS screen is what makes it useless.
I had to transfer my files to another machine that I happened to not
have updated yet in order to get those. But that situation may not
always be possible if I'm working remotely and only have my laptop to
work on.
It's just nice to know that I'm not the only one with these issues. :)
On Jan 30, 12:52 pm, Ted Scottt...@hootinholler.comwrote:

I'm surprised there only seems to be you and I talking about this. I
wonder what makes us special?
I really don't want to lose the configuration in eclipse and the DBs on
my AVDs which is what I fear will happen if I have to reinstall everything.
On 1/30/2012 12:02 PM, DanielleM wrote:

I'm so glad someone else has been having these issues as well. I
haven't tried to roll back to an earlier version of the SDK yet...and
I'm afraid it's going to require a complete uninstall and re-install
which is why I've been hesitant to do this.
I hope there will be some kind of fix soon.
On Jan 27, 5:46 pm, Ted S.t...@hootinholler.com  wrote:

I'm having the same problems in eclipse Indigo.
I can run an app on the emulator first time.
Reloading a changed app hangs at 27% launch. Requires relaunching eclipse,
and leaves old eclipse image running which must be killed.
Attempting to debug results in Waiting for debugger to attach on AVD,
eclipse never shifts to debug perspective.
This behavior is new to r16 update. I'm not sure how to back out the
update, and have not found a workaround as yet.


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