I have some Java code that does this pretty cleanly. I re-use the same
listener for all the buttons and just switch on the button ID to
deliver the different actions for each one. Let me know if you'd like
me to post it.
--
You received this message because you are subscribed to the Google
Sure. It's shown below, a little modified for your case:
public class FiftyButtonActivity extends Activity {
// Button IDs
final static private int[] buttonIDs = {
R.id.BID1,
R.id.BID2 ,
...
Does the game make money in some way, either through initial purchase
fees, subscription, or advertising? Anyone purchasing the IP would
want to see a case for how they would recoup their investment and make
a profit.
--
You received this message because you are subscribed to the Google
Groups
Are you seeing anything interesting coming out of logcat during the
long scan cases?
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group,
There's a reason why advertising copy is short. Research going back
more than 50 years has shown that shoppers spend only a few moments
evaluating a product. An application that costs no more than a box of
cereal should not have any more descriptive text than a box of cereal.
An app that costs as
Locale is an Anrdoid app that costs $10 and is in the 10,000-50,000
downloads category. Their blurb in the Marketplaces is well under the
325 character limit. Their technology is not rocket science. Their
marketing is.
So Locale is what, an app judges use to identify the person who's phone is
Ladies and Gentlemen,
I think we've discovered a business opportunity in the Android Market.
Someone needs to write a book about how to market Android apps. Maybe
it could be a little broader and include iPhone app marketing too with
comparisons and contrasts between the two markets.
--
You
Mark Murphy's book on advanced Android programming has a whole chapter
on this:
http://www.amazon.com/gp/product/0981678017/ref=oss_product
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to
I haven't used the Java HttpClient before and the documentation is
confusing. Say I want to send a POST to the URL https://domain/foo/
bar. I'm accessing a server with an XML API that defines the message
to send like this:
POST https://domain/foo/bar
Content-Type: application/xml
Content-Length:
It's a whole lot easier to develop for Bluetooth. Here's a well
developed kit for experimenting with it:
http://www.amarino-toolkit.net/
As long as it doesn't need high bandwidth, you can find a Bluetooth
version of just about any peripheral.
--
You received this message because you are
Another vote for XmlPullParser. It rocks.
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
So I added the following lines to create the header:
httppost.setHeader(Content-Type, application/xml);
httppost.setHeader(Content-Length, );
httppost.setHeader(SERVER-ACTION, API_AddField );
I didn't do anything about adding the POST line.
I'm
Good, I made the change. It turns out that StringEntity has a
getContentLength method, just as you surmised. I'm still getting a
ClientProtocolException, though. I have wireshark installed and I also
have the -tcpdump flag set in my AVD. The AVD is dumping a cap file
which wireshark opens, though
I set the following filter in wireshark:
http.request.uri matches domain
where domain has been changed in this forum for security reasons. No
messages were found. Either the -tcpdump is not working as expected
(though there's a whole lot of other traffic being logged in the cap
file), or my
Ah, I think I found one source of difficulty. The protocol is HTTPS,
not HTTP. I found a bunch of HTTPS traffic in the cap file but it's
pretty hard to determine what's wrong. Everything looks normal, though
it's a little more complicated than the usual case because of the
HTTPS key exchange and
A simpler approach, since I can see the outbound message in wireshark,
might be to do an HTTP request to the same URL. It will fail, of
course, but at least I will see an unencrypted version of the message
I'm sending. There's a lot going on in that HTTPS key exchange,
though, and some of that
Alright, just for simplicity, I pointed the client at http://www.amazon.com.
I can see the DNS look-up request and reply messages, which is what I
would consider the first part of the process. But then there is no
subsequent post message. Looks like the client is failing, but partway
through the
VMWare can do this. It can save the running state of everything on an
instance and restore and resume where it left off. The emulator would
never even know it had been interrupted.
On Aug 25, 12:17 pm, Denis Souza denis.so...@gmail.com wrote:
I guess the emulator's problem could be solved with
Very nice. Google should buy them and offer this stuff as part of the
standard Android dev platform. Or maybe Google is already working on
something just as slick.
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send
I'm seeing the same thing. In fact, almost all of my new downloads are
showing as inactive, whatever that means.
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To
I moved some of my useful utility code into a library where multiple
projects can easily access it. Among those utility classes is one that
parses values out of some files in the res folder using the following
call:
myXmlParser =
I also tried passing the result of getResources().getXml() from the
main package to the library utility, an object of type
XmlResourceParser and I'm still getting the same error.
I'm wondering if my R object has become corrupted by my earlier try at
passing one of the R.xml.foo numbers. I know
Well, I found part of the problem, though I don't know for sure how to
fix it. The main project is creating R.java in the library project
instead of in the main. Deleting R.java from the library project just
caused the main project to recreate it. Any idea how to fix this short
of creating a new
So I removed the library from the main project, which caused Eclipse
to build the R.java in the main project. However, the library project
still has an R.java, which I'm pretty sure is wrong. Adding the
library back into the main project causes the same error as reported
above. How can I prevent a
I've moved some of my common code into a library project so that
multiple projects can access it. I created an empty project, set it to
be a library in the properties screen, then imported some classes.
Next, I created a new (non library) project and added my new library
project to it.
I should also note that removing the library does not make the project
build. In fact all the R resources are shown as unresolved. It appears
that adding the new library breaks the R builder.
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
My user hits a button and kicks off a process that takes 3 steps in
about 10 seconds total. I'd like to pop up Toast messages Step 1,
Step 2, Step 3, Finished! as the process progresses. I'm using
the standard Java Thread interface to run the process in a thread and
I've found that trying to pop
I'd like to have column headings in a TableLayout and I'd like those
headings to remain visible when the table is scrolled vertically. One
option is to create a separate TableLayout just for the column
headings but it's a little complicated keeping the column widths
consistent between the two
Brilliant! This is exactly what I was looking for.
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
I changed the name of a project with a package of the same name.
However, the Resource Manager is still building R.java in gen/com/
oldname instead of gen/com/newname. I can't find the setting in
Eclipse that tells the Resource Manager where to store the R.java
file. I also notice that the package
I do something similar to Brian but, since I have just a few Intents
to manage, I store strings in the Shared Preferences database. It's
simpler to use than SQLite if you just have a few pieces of
(serializable) data.
On Aug 29, 6:03 am, Brian Swartzfager bcswa...@gmail.com wrote:
I just
That worked great. 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
Is there a way to make a ListView mutually exclusive like a RadioGroup
so that selecting one item deselects the others?
IMHO, if you are concerned about the number of radio buttons, you
should be using a ListView.
--
Mark Murphy (a Commons
I want to set up a table layout that scrolls like a spreadsheet. The
top row of column headings should scroll horizontally but be pinned
when scrolling vertically. The left-most column of row labels should
scroll vertically but be pinned when scrolling horizontally. The
number of rows and columns
What if I set up LinearLayout arranged horizontally with a set of
ListViews? The left-most ListView would be a list of row labels. The
whole works would be in a HorizontalScrollView. The column headings
would be set with ListView.addHeader. Then the only difficult task
would be synchronizing the
What do you think about the difficulty of synchronizing the scrolling
of the ListViews?
On Aug 30, 10:21 am, Mark Murphy mmur...@commonsware.com wrote:
I am uncertain that ListViews can go in a HorizontalScrollView, though
it is worth a try.
--
Mark Murphy (a Commons
I don't think the memory load will be as bad as you imagine. I plan to
give the user a pick-list of which columns they want to see in the
table. In practice, they will rarely choose more than a handful.
Likewise, there are rarely more than a few dozen rows. So total memory
footprint is o200Kbytes.
I use sensors extensively and find that they work best in a Service
which you can bind to your Activity.
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe
I like to read book reviews on my phone. It would be nice if I could
select the title of the book and have it added to my Amazon wish-list.
Amazon has good web service interfaces that should make this pretty
simple.
--
You received this message because you are subscribed to the Google
Groups
XmlResourceParser parser =
context.getResources().getXml(R.xml.filename);
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
The service is started automatically when you bind to it and stopped
when the last customer unbinds from it. In this way, multiple
activities or applications can all use the sensor service and it gets
started and stopped by the system as appropriate.
On Sep 2, 1:34 am, Paolo brand...@gmail.com
I'm using ListActivity with an ArrayAdapter as the list adapter and
getting a resource not found exception. When I build the ArrayAdapter
I call the constructor like this:
new ArrayAdapterString(this,resourceID,stringList);
If my list row layout in layout/listLayout.xml looks like this:
?xml
I'm getting the following exception message:
android.content.res.Resources$NotFoundException: Resource ID
#0x7f070004 type #0x12 is not valid
First, I'm not sure if this error is due to a bad resource ID or a bad
resource type. The resource that is associated with this error is:
I've used ListViews before but what's really different in this case is
the fact that my ArrayAdapter is being built in an AsyncTask. When I
call the constructor for the ArrayAdapter, I'm using the context
MyActivity.this, which is the context of the parent of the
AsyncTask. I wonder if this is
OK, I moved the code that builds the ArrayAdapter from the AsyncTask
into the main thread and it works. So it's definitely related to not
being able to find the resource when the adapter is built in an
AsyncTask. Strangely, the error doesn't happen during the execution of
the async task. It
I tried passing the resource ID to the AsyncTask, rather than using
R.id.chooseTableRowTextView from within the async thread and that did
not solve the problem. So it appears that the real issue is finding
the right context for ArrayAdapter's constructor. Perhaps the only way
to make this work is
Calling the ArrayAdapter constructor from the main thread worked.
Looks like I found a bug in the the ArrayAdapter.
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To
I believe I've found a bug in the ArrayAdapter class. What is the
proper method for filing a description of the bug and sample code that
reproduces it?
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to
I turns out that I misinterpreted my results. The Resource Not Found
error persists, even if the ArrayAdapter is created in the main thread
and then filled in the Async Thread. Anyone have any ideas for other
things to try?
--
You received this message because you are subscribed to the Google
The link provided in the OP tries to install some sort of malware when
you visit it. My security software blocked it but others may not be so
well protected. I suggest deleting the OP.
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post
That's not far from what I'm doing already. I'm creating the ListView
and ArrayAdapter and calling setListAdapter in the main thread. Then I
fill a separate ArrayList in the AsyncTask.doInBackground. Then, in
AsyncTask.onPostExecute which runs in the main thread, I fill the
ArrayAdapter from the
Here's the code where I set the resource:
tableListAdapter = new
ArrayAdapterString(this,R.id.chooseTableRowTextView);
setListAdapter( tableListAdapter );
Note that R.id.chooseTableRowTextView = 0x7f070004 and is a TextView.
Here's the full stacktrace from
I tried changing it to the name of the layout and got an exception
saying java.lang.IllegalStateException: ArrayAdapter requires
the resource ID to be a TextView. The layout file I pointed to is
this:
?xml version=1.0 encoding=utf-8?
LinearLayout android:id=@+id/chooseTabelRowLinearLayout
The first choice proved problematic because the Resource parser didn't
like a file in the layout folder that didn't have a layout in it. The
second choice is working great. Thanks!
Now, you have two choices:
1. Get rid of the LinearLayout from your row XML, since it is doing
you no good, and
How about sending and receiving tweets? How much info does the game
need to exchange?
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group,
I'm looking for an example of ListView.addHeaderView (View v, Object
data, boolean isSelectable).
Has anyone seen one?
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to
Here's a good place to start: http://en.wikipedia.org/wiki/GSM#Voice_codecs
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email
I have a data provider who pushes out a new access key from time to
time via SMS. Currently, my users have to copy and paste from the SMS
message into my application preferences. The SMS message with the new
key has a prefix along the lines of Thank you for being a customer of
X. Here's your
I want to add some checkboxes to a LinearLayout at runtime. The
orientation is vertical and I want the checkboxes to appear at the
bottom. I create each checkbox like this:
CheckBox box = new CheckBox(this);
Then I add the box to the current view like this:
addContentView( box , params );
What
Mark,
I changed it to do as you suggest:
LinearLayout layout = new LinearLayout(this);
layout.setOrientation(LinearLayout.VERTICAL);
setContentView(layout);
but what should be the LayoutParms for the added widgets in order to
get the desired
My application will run extensively in partial wakelock mode and I'm
very curious to see what standby power consumption consequences that
has for various popular phones. Maybe we should start a thread just
for that purpose where people can post their observations of battery
life in this mode for
Try Drawable.setAlpha where a value of 0 is fully transparent and 255
is fully occulting.
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this
Is there a standard pattern for handling a running AsyncTask with
screen rotation? My AsyncTask runs for about 10 seconds. I could call
AsyncTask.cancel in the Activity's onDestroy method and restart the
task in onCreate but that would waste cycles, bandwidth, and user
time. I'm guessing there is
Yeah, Mark's option 1 looks like the best approach for my application.
Android should provide more infrastructure for this sort of thing
because async web services are becoming almost universal and they
always require something like this when they interact with the UI.
--
You received this
It seems like AsyncTask could be patched up pretty effectively with
attach(String threadTag) and dettach(String threadTag) methods. You
would call dettach with a user-provided tag from your Activity's
onDestroy method and call attach with the same tag. If attach returns
false then you know there
Because, as Dr Horrible has taught us - evil is so much fun:
http://www.drhorrible.com/
(why people uses its brain for evil rather than good? :( )
Regards,
--
If you want freedom, compile the source.
Sebastián Treuhttp://labombiya.com.ar
--
You received this message because you are
I've got a line in my manifest that looks like this:
application android:icon=@drawable/icon android:label=@string/
app_name android:debuggable=true
But I see the default Android icon on the desktop instead of the one
in drawable/icon. What else do I need to do?
--
You received this
I tried it like this and it didn't work. Am I putting it in the wrong
place.
activity android:label=@string/app_name
android:name=.MainActivity android:icon=@drawable/icon
intent-filter
action android:name=android.intent.action.MAIN/
category
Tre,
That was my idea at first, that I had forgotten something fundamental.
I did a clean/rebuild of the project, uninstalled the app, and re-
installed.
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to
It's pretty clear from all the activity around this issue in this
forum in multiple threads over the past several months that there's a
painful design flaw regarding AsyncTasks and screen rotation. The
basic issue that people want to address is how to handle the onDestroy
when an AsyncTask is
I'm stuck on a tough architectural problem. I have a collection of web
services that produce data that will populate UI components -
TextViews, ListViews, and so on. Each web service may take up to about
10 seconds to respond, or it might not respond at all. When I click a
button in the UI that
I think the real problem with the Android documentation is its
minimalist approach. Google wants to be sure the docs are accurate and
doesn't want maintenance of them to explode into a huge task. So
external links to other information sources and code examples (that
might be in error) are kept to
As far as I can see from the docs, createPendingResult works with
onActivityResult, which works with startActivityForResult. In other
words, it only works with an Activity, not a Service. It's too bad
they don't have startServiceForResult. The broadcast/receive approach
looks interesting.
It's
But the Service class has no setResult method. How would it provide
the data to onActivityResult?
Yes, it works with a service. The client side has to be an activity;
the one sending the message can be anything, including a service.
It's just amazing how hard this is with Android.
Three different patterns described in one hour. Impressive. And a lot
of food for thought. It's a pity that Google doesn't just draw a line
in the sand and say this is how we want to do it and then provide a
bunch of infrastructure to make it simple in 90% of the cases.
On Sep 14, 8:50 am, Brion
Tre,
The call them in a separate thread part below is clearly wrong:
From (http://developer.android.com/guide/developing/tools/aidl.html) :
By default, IPC calls are synchronous. If you know that an IPC
service takes more than a few milliseconds to complete, you should not
call it in the
I'm getting a java.lang.InstantiationException when I attempt to call
startService to start my IntentService. As a test, I temporarily
declared my IntentService as a Service and it launched fine. Is there
something different about using startService to start an IntentService
versus a Service?
--
Yes, I have that stub when the code is in IntentService mode and
commented out when in Service mode. Anyway, it would not build without
it so I don't think that's the problem. Here's the stub:
public MyServiceClass(String name) {
super(name);
}
On Sep 14, 3:24 pm,
Is there anything different required in the manifest?
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
That fixed 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
My IntentService is happily chugging away and sends a broadcast of
results when it's done:
intent.setAction(mySpecialName);
sendBroadcast(intent);
Meanwhile, my main thread has a receiver defined like this:
I'm launching an IntentService using startActivity from inside the
onClickListener of a button. startActivity returns immediately. No
blocking there. But the button stays pressed until the IntentService
finishes its work. In addition, the screen does not respond to
rotation while the IntentService
The example looks pretty much the same as what I'm doing. I think the
problem might be related to the UI blocking I see, which is described
here:
http://groups.google.com/group/android-developers/browse_thread/thread/7611f9f7fcd16876#
Maybe the broadcast is getting dropped while the UI is
I'm guessing something about what he's doing is illegal...and it's
across state lines so it's a federal case. You should file a complaint
with the FBI.
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to
A little more study of this behavior is making me suspect that the
problem is not the UI getting blocked but that the IntentService
thread is hogging the CPU. It shouldn't be doing that (Unless the
HttpPost is doing something stupid like polling a register) but I
think I'll roll out some profiling
My IntentService is blocking my UI thread and I wanted to find out
why. So I turned on profiling in the onStartCommand method of the
IntentService and turned it off at the end of the onStartMethod. The
working being done in between is web access with the Apache HTTP
client.
According to the
I'm broadcasting an Intent that is not being received as expected. Can
I use DDMS (or some other tool) to view the broadcast queue to verify
that the Intent is there?
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group,
That fixed it. The documentation is a little confusing but at least
the tools let me discover my mistake quickly.
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To
I occasionally put in some code to work around a bug in the OS. When I
do, I always surround it with a conditional on the OS version. And
deprecated methods seem to continue working for several more OS
versions, giving active developers a chance to update before the old
methods break. Have you
Doug,
I agree, the Android OS and tool chain is really impressive. The
documentation and examples could use a little work but a lot of
independent developers (Mark Murphy, for example) have extended them
in very useful ways.
There remain some substantial weaknesses in the Android Marketplace
and
AFAIK, getInt doesn't work. Everybody does getString and Integer.parse.
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
I'm having some difficulty getting a broadcast message to arrive at
the expected receiver. So I turned on logging like this:
intent.addFlags(Intent.FLAG_DEBUG_LOG_RESOLUTION);
However, there is no message in logcat when I call the broadcast
method with this flag set. Should I be
Gold,
Be aware that accessing a remote database is asynchronous. You can't
let it block the main thread and you need to handle delays (with some
sort of progress dialog in UI) and timeouts (if network connectivity
is interrupted). And if you plan to allow edits, the whole picture
gets more
I would expect the following code to generate a message in the logcat
but it doesn't. Any ideas?
new intent = new Intent(com.android.myappname.myaction);
intent.setFlags(Intent.FLAG_DEBUG_LOG_RESOLUTION);
sendBroadcast(intent);
--
You received this message because you are subscribed to the
I find that AsyncTasks are more trouble than they are worth. It's much
simpler to use an IntentService and put your background work in the
onHandleIntent method. Then just broadcast a new Intent back to your
UI thread and catch it in an onReceive method.
--
You received this message because you
I made a landscape and a portrait version of my background image and
designed them both to look ok (not great but ok) when squished to
square. And square is the worst case unless some particular phone
implementation is completely illogical.
--
You received this message because you are subscribed
I used to think Google was a one trick pony - search. But Android's
pretty good. So it's a two trick pony. Getting Google Groups right
would be a third trick and I just don't think they're up to it.
--
You received this message because you are subscribed to the Google
Groups Android Developers
How about if you wrap a Service around your library and access it
either with Intents or Bind/AIDL? It's a bit of work to set up but
very convenient once you have it going.
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this
By the way, the Android-centric name for the pattern you want is
Content Provider. You can search the documentation for that phrase.
SQLite is an example of a content provider where you normally create
an Adapter that wraps around the raw SQLite API to present an
application-specific API to the
You should take a look at the BeagleBoard (http://beagleboard.org/
project/android/). It's a platform made specifically for doing low
level development work with embedded operating systems, including
Android.
--
You received this message because you are subscribed to the Google
Groups Android
1 - 100 of 515 matches
Mail list logo