I've got an application that needs to show a notification of certain events
in a day, depending on the event.
I know how to do it, if I need a service to stay running in the background,
or it will run in the background getting these events on certain days.
2 questions are:
1 - to notify of
I have this simple XML in the drawable folder:
selector xmlns:android=http://schemas.android.com/apk/res/android;
item android:drawable=@drawable/dark_pressed
android:state_pressed=true /
item android:drawable=@drawable/dark_focused
android:state_focused=true
Hi!
I'm trying to create a shape with a border on 3 sides (top and sides, not
at the bottom):
shape xmlns:android=http://schemas.android.com/apk/res/android;
solid android:color=#000 /
stroke android:width=2dp android:color=#888 /
corners android:topLeftRadius=2dip
in advance!
Pinheiro
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
Hi!
I've done a simple TabActivity that loads several Intents into the
tabs. It works fine in Froyo or later but gives this error on older
versions:
E/AndroidRuntime( 1958): java.lang.NullPointerException
E/AndroidRuntime( 1958):at
android.widget.TabWidget.dispatchDraw(TabWidget.java:173)
Hi!
Anyone knows how to use animated markers in MapView? For instance, a
man jumping up and down in a map. Preferably, the shadow would be
updated as well.
Thanks in advance!
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this
Hi!
I've changed a few resources in a app, tried to run it and got the
build error:
ERROR: Unknown option '--no-crunch'
Android Asset Packaging Tool
I think the problem is not with my project (Android 2.2) but with AAPT
itself since I got this error right after upgrading the libraries
Looks like you updated to the latest eclipse plugin but didn't update
the SDK component.
aapt (part of platform-tools) revision 8 is needed to use the latest ADT.
You are right, that solved the problem, thanks!
--
You received this message because you are subscribed to the Google
Groups
Looks like you updated to the latest eclipse plugin but didn't update
the SDK component.
aapt (part of platform-tools) revision 8 is needed to use the latest ADT.
You are right, that solved the problem, thanks!
--
You received this message because you are subscribed to the Google
Groups
I've done an app that must work in the background fetching messages
from a web site that must never sleep. For that I'm using
PARTIAL_WAKE_LOCK, let the screen turn off and wake it when there is a
new message. Here's some code:
--
public void onCreate(Bundle savedInstanceState) {
One more thing:
FULL_WAKE_LOCK or FLAG_KEEP_SCREEN_ON should solve the problem but I
don't want to use them because of effects on the battery.
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to
Hi!
Thanks for the answer.
FULL_WAKE_LOCK or FLAG_KEEP_SCREEN_ON should solve the problem but I
Huh? Your effects on the battery are already there with what you're
Well, at least the screen is off and I don't have to make a screen
saver (don't know if LCD burn-in is still a problem?) ;-)
Not if you are using PARTIAL_WAKE_LOCK. You need a FULL_WAKE_LOCK. As the
documentation states for ACQUIRE_CAUSES_WAKEUP:
Thanks but that doesn't solve my problem, I really, really want to
turn the screen off after some time of inactivity and turn it on only
after a message arrives or the user
Not if you are using PARTIAL_WAKE_LOCK. You need a FULL_WAKE_LOCK
Thanks but that doesn't solve my problem, I really, really want
to turn the screen off after some time of inactivity and turn it on
only after a message arrives or the user touches the screen or button.
Update: PARTIAL_WAKE_LOCK
Just to clarify one thing:
you don't want to use the requestLocationUpdates().
I suppose you meant: you don't want to call requestLocationUpdates()
for continuous updates, right?In the BroadcastReceiver activity, I'll
call the requestLocationUpdates() and then removeUpdate() as soon as
there is a
I need to make an app that transmits GPS information each 5 minutes
(the information gathering can be switched on and off in the app).
The question is: to ensure that the information is gathered should I
call the requestLocationUpdates() on an regular app or should I use a
widget running in the
That's exactly what I wanted to know, thanks a lot!
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
Hi!
I have an unusual problem: I've made an app that will be shown at an
exposition booth. What I need is a way to prevent the screen from
going off, i.e., the activity will be run forever (no battery problem,
it will always be powered).
I've tried to shortcut OnPause() to return instantly and
Many thanks for the fast reply, it works :)
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
Hi!
I'm trying to do an slide animation but in 4 stripes: 0-25% of the new
image slides from the right to the left, then 25-50% of the image an
so on.
From what I've read in the SDK this should work but doesn't:
?xml version=1.0 encoding=utf-8?
set
Hi!
I'm developing a simple photo gallery application that pulls files
from the Net and uses a ViewFlipper to change Views.
Since I don't know how many Views the ViewFlipper will have, I have to
add all the views in code and not in XML.
My question is: are all the Views of the ViewFlipper loaded
Thanks for the fast reply, it confirms my fears :-|
AdapterViewFlipper on Honeycomb.
Opsssieee, no can do... the app has to be compatible with 2.2.
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to
Hi!
I made an app that loads URLs dinamically in a WebView.
Since I need to add some custom headers I just call
webview.loadUrl(url,extraheaders).
The problem is that the extraheaders parameter only works in Froyo,
not in previous versions.
So, how to pass headers on previous versions? Anyone has
That only tells you about stuff you are doing. Which can't be kept in sync
with what is actually in the database, and doesn't prevent you from
colliding with anything already in there.
Duplicate contacts aren't that much of a nuisance, imho. They're easy
to fix and prevent. Specially if you
all, it seems Google was more concerned about someone reading your
contacts to get your private information than they were about a
malicious program writing bogus values to your contacts (though I can
see that as an attack vector too).
Exactly, BOTH are attack vectors so it should be
Btw, if you are writing an application that is blindly stuffing contacts
into the contact provider without looking at what is currently there... I
think this is fairly fundamentally flawed to start with.
I beg to differ. If the application is well-made you'll get at least
an warning that a
it would have to READ the contacts first. How would it possibly know
it was a duplicate otherwise?
Easy, use the SharedPreferences to store the contacts the user added.
Of course, this could fail if the user deletes the contact but it's a
minor problem.
--
You received this message because
It is very hard to ensure that someone with write access can't also get data
back from the provider, so generally no.
It's a bit lame, imho. According to Google, developers should use the
least permissions possible. But how can we do that if we have to use
READ_CONTACTS to write contacts?
I'm trying to add a contact inside an app but the only working code
I've found requires READ_CONTACTS permission. Here's the code:
ContentValues values = new ContentValues();
values.put(Contacts.People.NAME, contactName);
Uri uri =
Hi!
How can we detect if an Activity is run for the 1st time? I mean, it's
run just after the user clicked on the icon in the homescreen and not
after some event like screen rotation?
For instance:
public class Incoming extends Activity {
private boolean firstrun=true;
Thanks a lot, TreKing!
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For
I'm creating an app that will use a dialog similar to the share dialog
(intent.action.SEND) with my own options.
Is there a built-in theme in the SDK I can use to emulate the look of
this dialog?
Note: I don't want to create an Intent, I just want to create a
similar looking layout.
--
You
I've created a complex application that uses SQLite and would like to
give the user an option to install a very simple widget on the
homescreen (just a number taken from the database).
Do I have to create a new .apk just for the widget? I've tried to cut-
and-paste the WordWidget example but it
Thanks, YuviDroid!
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For
What's the current status for using Google Directions in Android apps?
Will Google release a library to use it or programmers will have to do
it the hard way using the API? Will the API limitation of 2500 queries/
day also apply for apps?
Thanks in advance!
--
You received this message because
After testing the various techniques to populate a large database
(50.000 records, 700KB), I've decided to download a SQLite database
directly from the Web to the phone (it takes just a few seconds, the
alternatives took up to 3 minutes).
My question is that since there isn't a method to get it,
Thanks Mark!
The problem is that that only works if the database already exists.
I guess I could create a dummy database just to see where it is
created but it's a nasty kludge.
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this
It worked! Thanks, Mark!
The documentation lead me to believe that it would only work if the
database is *already* created but that it's not true.
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to
I'm trying to draw some points (around 200) in a MapOverlay and
noticed that the application gets slow and the phone becomes
unresponsive. Here's my code:
MapOverlay mapOverlay = new MapOverlay();
ListOverlay listOfOverlays = mapa.getOverlays();
listOfOverlays.clear();
Any reason you're not using an ItemizedOverlay?
Afaik, ItemizedOverlay only supports one marker type, right? I want to
be able to use several.
Of course I could use several ItemizedOverlays, each with it's own
marker, but I guess that will impact perfomance.
--
You received this message
Thanks, Mark!
Strangely, I can't seem to make your code work.
If I use:
public MyItemOverlay() {
super(null);
... the rest of your code...
It crashes with NullPointer in:
@Override public void draw(Canvas canvas, MapView mapView,boolean
shadow) {
Thanks BITS.
Unfortunately the doc is not very helpful since it doesn't even give
an hint on how to use different markers in the same ItemOverlay.
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to
Thanks, Mark!
It seems to solve my 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
Thanks, Dmitri. I've tried using _ID also but the results are the
same.
Also, sql parameters should always be passed using placeholders (question
mark) and an array of arguments.
Could you please give an example?
--
You received this message because you are subscribed to the Google
Groups
I was trying to delete a contact using the code in the docs:
ArrayListContentProviderOperation ops = Lists.newArrayList();
ops.add(ContentProviderOperation.newDelete(Data.CONTENT_URI)
.withSelection(Data._ID + =?, new String[]
{String.valueOf(dataId)})
.build());
Thanks Dmitri.
Btw, do you know how to delete a contact without using a batch?
This doesn't work, I don't know why:
getContentResolver().delete(ContactsContract.Contacts.CONTENT_URI,
ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME+=+nameToDelete,
null);
--
You received this message because
Hi!
I'm creating an app that needs to create a contact. My 1st attempt
was:
ContentValues values = new ContentValues();
values.put(Contacts.People.NAME, Name);
values.put(People.Phones.TYPE, People.Phones.TYPE_MOBILE);
values.put(People.Phones.NUMBER, +1);
Uri myUri =
Thanks for your help, Romain.
What is the correct way to show a (non-scrollable) footer below a
Scrollview?
This doesn't work since the bottom of the content hides behind the
footer:
FrameLayout (height=wrap_content)
Scrollview
TextView - a very large text to scroll
Forgot to mention. This could be solved with a fixed footer height and
putting layout_marginBottom in the scrollview but it's not a nice
solution, imho.
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to
Works! Thanks Treking and Romain.
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
Hi!
I've made a complex layout that has the following structure:
ScrollView
RelativeLayout
RelativeLayout
an image and several textviews
/RelativeLayout
several textviews
/RelativeLayout
/ScrollView
Since
Opsie, it seems the problem is that the scrollview is inside a
framelayout because I have navigation buttons at the bottom of the
screen. Non-scrollable, of course.
Seems like this is too complex for the SDK. Will have to figure out an
alternative.
--
You received this message because you are
Hi!
I'm planning on creating an app with a news page with image, title,
content, etc.
The flip animations used in most ViewFlipper applications are great
but have one problem: only work with a ViewFlipper with a determinate
number of view (in my case, I don't know how many news there are).
The
Exactly what I thought. Thanks, Mark!
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
Hi!
I need to use a large number of small images in a project and tried to
create directories under Drawable to put them but don't know how to
open them.
For instance, this doesn't work:
aux=smallimage;
int resID = getResources().getIdentifier(com.my.package:drawable/
icons/+aux,null,null); //
Hi!
I don't know if this is a bug in Eclipse or something wrong in the
SDK. I have a project with a Build Target set to 1.5 and want to
support all screen sizes.
So, as mentioned in the Dev Guide, I've put in manifest.xml:
...
uses-sdk android:minSdkVersion=3 /
...
supports-screens
Thanks, Bob!
Unfortunately, it seems Launcher's handle is not accessible (at least
it's not in the SDK).
Bummer, will have to reinvent the wheel and make my own :-(
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group,
Hi!
Quick question: what is the drawable ID of the handle for the
application's SlidingDrawer used in the home screen?
Thanks in advance!
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to
Hi!
Since Intent.putextra doesn't accept Cursor, what is the alternative
to pass a complex structure to a class?
For instance:
Cursor c; // assigned elsewhere
...
Intent myIntent = new Intent(this, my.class);
myIntent.putExtra(mycursor, c); // this won't work :-(
startActivity(myIntent);
... in
Hi!
I've created a rather complex layout for listview rows where only the
first line is visible (the rest use android:visibility=hidden).
When an item is selected, I want all the invisible objects to appear
(selected.setVisibility(1)) - checking first if I have to hide again
the previous
Gotcha! Thanks, Mark!
Unfortunately, it solves half the problem. When clicked, the hidden
objects appear but the older selection doesn't disappear:
private int selection=-1;
...
public void onListItemClick(ListView parent, View v,int position,
long id) {
TextView tv;
View
Hi!
I'm creating an app that has 2 levels of navigation:
1) Top level (options A B C)
2) Bottom level (option 1 2 3)
Each of the top tabs (A,B,C) have different content in the bottom tabs
(1,2,3)
Using two levels of tabs is confusing and/or occupies a great deal of
screen estate. Putting one of
I'm trying to draw an image downloaded from the web but keep getting
the error Cannot cast from Bitmap to byte[]. Here's the code
snippet:
BufferedInputStream bis = new
BufferedInputStream(somethingdownloaded);
DataInputStream dis = new DataInputStream(bis);
Bitmap image;
Use BitmapFactory.decodeStream().
Got it, many 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
I'm having the same problem and found the same solution but it's very,
very annoying.
It seems like some file has a date somewhere in the future or it's
just a big bug in Eclipse.
Anyone found a easier/faster way to solve this?
--
You received this message because you are subscribed to the
65 matches
Mail list logo