Android :: BroadcastReceiver For Data SMS - Static Works - Dynamic Does Not
Mar 29, 2009
I have created a broadcast receiver statically by specifying it within the Manifest, and I have also created the "same" broadcast receiver in code and have registered it with the application context. The static way works very well, but the dynamic way does not receive the expected broadcast. It could be that I am not creating the intent filter correctly, or that I need to register it with some other context somewhere. Please see the code examples to see what I am doing. This is related to receiving data SMS, it works very well on a device using a broadcast receiver defined in the Manifest. The correct permissions are set for both examples.
The following is from the Manifest, and the resulting receiver gets the expected broadcasts:
CODE:.....
The following is the code example that doesn't work (it does work with an intent like "android.provider.Telephony.SMS_RECEIVED" but not for data sms):
CODE:.....
The question is - why does this broadcast receiver get notified of the incoming data messages? It seems some other resource is notified when the Manifest version of the receiver is created...
View 4 Replies
May 22, 2012
I need compiling a lib (ODE) for android - problem is it uses automake and I can't seem to find any decent documentation/how to cross compile a static/dynamic lib for android.
BTW, I'm using ubuntu 12.04 as a dev environment (latest up-to-datest SDK and NDKs are installed) and I have no problem with making the wrapper library - just need to get the static (or dynamic) lib built.
View 4 Replies
View Related
Oct 29, 2010
I am using this following code which creates a ListView with text and an icon but the problem that I have which the following I want the array to be dynamic instead of static so my list gets created dynamically not statistically. My ultimate goal is to retrieve specific strings from my Db and to display it then on the Listview where every string would be in each row.
View 1 Replies
View Related
Mar 18, 2013
I have Eclipse Juno and I'm working on an app with that.
The main activity will have a scrollable menu that takes you to all the other activities.
So the general structure/outline right now:[HIGH]Relative Layout ImageView (header logo type thing) ListView (the actual scrollable menu)[/HIGH]Here's the problem though... I can't find any simple list tutorials. I can easily make a single line list work but I need to make a two line list and one that is static, not dynamic and no examples are out there for that. It's like if you want to make a 2 line list, you can only learn how to do it in the most code-heavy ridiculous way possible.
Essentially what I am looking for with the list is this: Item one: Centred, bold, non selectable title (Resources)
- Item two-??: two line list items, click-able to a new activity, title of the section on first line, description on the second line.
- Item ??: Centred, bold, non selectable title (Tools)
- Item ??-??: two line list items, click-able to a new activity, title of the section on first line, description on the second line.
Nothing dynamic that is ever going to change, no super complex wonkey calculations, just to simply have the data set in stone (preferably via XML) and to call it into the list.
I experimented with some of the other list views and no matter what I did, I could get, via editing the resources and NOT using Java, more that one item on a single line but it wouldn't format it properly according to the layout I guess because I haven't got the ID correct or whatever I don't know.
I mean, all the examples I've seen for a 2 line list are extraordinarily over-coded and just bloated. I mean I have a website I am still working on in C#/ASP.net that has far more complex things in it with half the code that I've seen for the examples of the two line lists.
I tried on my own to figure it out (I am decent with C# and vaguely familiar with Java, self taught, and programming for some other systems like Python, again all self-taught), but like ALL coding references, they're organised by the actual code you implement (that you don't know) instead of by what you want it to do (so you have to search the whole code base to find something that you don't know what it's called but know what it does). >:C
View 10 Replies
View Related
Jan 8, 2010
Any idea why reading bytes from AudioRecord would cause an error while reading shorts would not? The sound comes through great with short but I get only static with bytes.
Working code with short[]:
CODE:.......................
View 6 Replies
View Related
Feb 15, 2009
Is there already functionality similar to the push registry or wireless messaging API in J2ME implemented in Android? Or at least plans to do so?I have been looking at this issue for a while, because in a corporate environment it is essential to be able to push information out, or trigger actions via SMS or other connections.I have successfully sent an SMS between emulator instances, and successfully received an SMS by using a BroadcastReceiver on another emulator instance. I have also been able to use SmsManager. sendDataMessage to send a data message to a port on another emulator instance, but in this case the BroadcastReceiver is never triggered. This seems to be the closest the API's get to what I'm looking for.
View 3 Replies
View Related
Apr 11, 2010
I've got an Android application which needs to be woken up sporadically throughout the day.To do this, I'm using the AlarmManager to set up a PendingIntent and have this trigger a BroadcastReceiver. This BroadcastReceiver then starts an Activity to bring the UI to the foreground.All of the above seems to work, in that the Activity launches itself correctly; but I'd like the BroadcastReceiver to notify the Activity that it was started by the alarm (as opposed to being started by the user). To do this I'm trying, from the onReceive() method of the BroadcastReceiver to set a variable in the extras bundle of the intent,Can anyone tell me what's different about passing a bundle from a BroadcastReceiver to an Activity, as opposed to passing the bundle from an Activity to a BroadcastReceiver?
View 2 Replies
View Related
Nov 17, 2010
I want to display contact information in a custom layout. My app lets the user select a contact, then I retrieve key pieces of info on that contact (phone #'s, email addy's, etc). I want to display them to the user so they look grouped logically. Sort of like a series of tables, so phone numbers, then email addys, then organization, etc.
I have a table format that I've been using in a different part of the app where I know the exact number of rows I'm adding and I have defined styles for the rows already. I want to reuse those styles for this data, but android sdk won't allow for you to set the style attribute programmatically.
I could create the tables in code and set all the attributes the same as in my defined styles, but it seems like a lot of extra coding.
View 1 Replies
View Related
Jul 28, 2010
I am currently developing a simple info app on various uni campuses. I want the app to operate predominantly in an offline state thus I want to store all my information locally. The data within the app will not be subject to any change thus I was wondering what the best (practice) method was to store such data? Basically should I be storing the info in a SQLite db, java file or xml?
View 3 Replies
View Related
Oct 29, 2010
In my apps preferences screen, i want to pop up a dialog that shows a list of checkbox items that are dynamically generated.
How does one do that and also, how does one get the checked values? I have made custom dialogs in the past, but for some reason my brain wont function today ..
View 2 Replies
View Related
Jun 8, 2010
If I have a bunch of data that is never going to change (eg. an English language dictionary or the rgb values of a couple hundred color names), how do I use an SQLite database to store it? I know a database is faster than loading everything into memory when the app starts, but how do I make the database either the first time the app runs or "before" the apps ever runs?
View 2 Replies
View Related
Nov 24, 2009
I am writing a program where I have to access some static data, and now I am looking for the best method of how to include them into the project.Reading in the data by parsing an XML is *slow* (even using the SAX parser). 2. Reading the data by parsing a CSV file is faster than loading an XML, but again is too slow. 3. Putting the data into a Java file directly (e.g. by defining an array) fails because Dalvik says it is too large. 4. Reading in the data using serialization is slow. The funny thing here is: It takes a bit longer than loading the XML file. 5. Reading in the data from a SQLite database is the fastest method until now. But a bad workaround is needed: A SQLite DB can not yet be read directly from the resources, but instead has to be copied to the cache or to the SD card - even for read-only access. Right now I am using method 5, but I would really like to use a more simplified and faster solution.
What I found out: Unserialization in Java is *fast* (reading a HashMap with 5000 integers and strings in 79ms on my PC), while the same action on my G1 takes over 13500ms. I know that I can not compare a PC to a mobile device. But still, there seems to be a big difference here. I think that the JRE directly copies the serialized data to RAM, while Dalvik seems to read every object step by step. Is this going to change in the future? And, most interestingly: what do you do to access lots of static information?
View 12 Replies
View Related
Jun 1, 2010
I am facing the following problem: I have a big list of street names(~2000 entries), which is stored as a variable. I have an AutoCompleteTextView which should complete the names. The process takes really long time(approx. 2 - 3 seconds) to complete the suggestion. Is there any way to speed this up? I am pasting my code, if this is necessary:The getStreetsData() method simply returns the static list of the names.
View 2 Replies
View Related
May 2, 2010
I've started working on some Android applications and have a question regarding how people normally deal with situations where you have a static data set and have an application where that data is needed in memory as one of the standard java collections or as an array.
In my current specific issue i have a spreadsheet with some pre-calculated data. It consists of ~100 rows and 3 columns. 1 Column is a string, 1 column is a float, 1 column is an integer. I need access to this data as an array in java.
It seems like i could:
1) Encode in XML - This would be cpu intensive to decode in my experience.
2) build into SQLite database - seems like a lot of overhead for static access to data i only need array style access to in ram.
3) Build into binary blob and read in. (never done this in java, i miss void *)
4) Build a python script to take the CSV version of my data and spit out a java function that adds the values to my desired structure with hard coded values.
5) Store a string array via androids resource mechanism and compute the other 2 columns on application load. In my case the computation would require a lot of calls to Math.log, Math.pow and Math.floor which i'd rather not have to do for load time and battery usage reasons.
I mostly work in low power embedded applications in C and as such #4 is what i'm used to doing in these situations.
It just seems like it should be far easier to gain access to static data structures in java/android.
Perhaps I'm just being too battery usage conscious and in my single case i imagine the answer is that it doesn't matter much, but if every application took that stance it could begin to matter.
View 3 Replies
View Related
Feb 12, 2010
I want to refresh an Android ListView after adding/deleting dynamic data.
Can any one tell me how to achieve this?
View 2 Replies
View Related
Mar 11, 2012
I'm trying to make a simple order system. So the user selects a burger type from a spinner, then the user can enter in the quantity and then there is some math taking place in the background which sets a text view at the bottom with the total price. I'm not sure what method I'm meant to use so that it is updated dynamically when the user changes the text view quantity.
If i just say that all burgers are 2.50, i need some sort of method saying, if/when data is entered into the edit text , take that data and then times it by 2.50 and set it in the total text view below. I'm just unsure on the method part of it so it's dynamic and will change when the edit text quantity is altered.
Code:
package placeorder.com;
import java.util.Random;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
[code]...
View 2 Replies
View Related
Mar 30, 2010
i want to display a msg to the user (msg box or Toast) when exception happend in a static SQLite Database class that i use. the problem is that i cant call a non static method in a static class , how can i handle this. this is the class
private static SQLiteDatabase getDatabase(Context aContext) {
and i want to add something like this in the class when exception happen but context generates the problem of reference to non static in static class.
Context context = getApplicationContext();
CharSequence text = "Hello toast!";
int duration = Toast.LENGTH_SHORT;
Toast toast = Toast.makeText(context, text, duration);
toast.show();
View 1 Replies
View Related
Feb 7, 2010
I'm having some issues with the old "Cannot make a static reference to a non-static method" error in my Android program. I am creating a sand falling game (similar to the Powder Game) and I created a class called Control to create a Control Bar at the bottom of the screen with a slider for brush size (that works fine) and a button to pop up a Dialog to allow users to pick the selected element. However, when I call DemoActivity.showDialog(2) from my code, it gives the static reference to non-static error (DemoActivity is the main activity of my application). I also tried changing it to just Activity.showDialog(2), but I got exactly the same error!
Here's my code:
CODE:................
I fixed it by adding the following to my Control.java code:
CODE:..........
And then calling control.setActivity(this); from my onResume section of DemoActivity.java!
View 2 Replies
View Related
May 26, 2010
I am modifying the source code here: http://thinkandroid.wordpress.com/2009/12/30/getting-response-body-of-httpresponse/
I get this error:
code:.............
This error is line 13 on the second box.
View 5 Replies
View Related
Jun 20, 2010
Let me start out by saying that I feel like there should be a very simple way to do this, and it's entirely possible I'm missing something very simple. But all the examples I find for transition animations (push left out, push right in, etc.) deal with moving from one view to another. What about an application that only has one view, but dynamically changes the data feeding that view? The best common example of this is the base calendar app. It has identical views, but when you swipe forward or backward the date of the view transitions with a swipe animation. How do I reproduce this? Surely I don't have to inflate ViewFlippers for the same view? And if so, what is the best way to go about this?
View 2 Replies
View Related
Oct 27, 2010
In my application, I am going to create a few listviews that are dependent on the listview before it. For example,Then, depending on user choice, will go next screen, let's say, it contains a submenu of each type of school,that may be different or may be the same to other states.What I want to know, is how to populate these different lists dynamically as the user goes on? I don't know what the best of doing this is, and I seem to be looking in the all the wrong places because I keep getting stuck. Once all the data is added into whatever structure is used, it will be static. I basically just need help as to how to code information into some sort of hashtable or anything of the sort that can be easily referenced, and later when the Application is updated, be able to add more schools/states/submenus etc.
View 1 Replies
View Related
Jul 31, 2009
I have some reference data in a text file (~5MB) that I want to use with might android application.The file is of the format:
1|a|This is line 1a
1|b|This is line 1b
2|a|This is line 2a
2|b|This is line 2b
2|c|This is line 2c
What I want to know is the most efficient way (less memory, fast, size etc.) to use this file within my application.
a.) Should I save the file as a raw resource and open and read the whole file whenever I need a certain line.
b.) Should I convert the file to XML and use XPath to query the file when ever I need to look up a value
<!--sample XML -->
<data>
<line number="1">
<entry name="a">This is line 1 a</entry>
</line>
</data>
c.) Should I just copy & paste the whole file as a static string array in the application and use that.
[EDIT] I will also need to search this file and jump to arbitrary keywords e.g. "line 1a".
View 4 Replies
View Related
Mar 9, 2009
I have been finding it convenient to extend Handler in many of my activities to handle messages specific to the activity. The handler sublass is an inner class of the activity and needs to access its state. I am wondering if there is any performance difference between making the handler subclass static and passing in the activity explicitly in its constructor or making the subclass an "instance class" and letting the vm worry about my accessing members of the containing activity.
The static approach:
CODE:.............................
View 4 Replies
View Related
May 6, 2010
I had heard Verizon was unable to allow voice and data usage at the same time. However, when I got my DI I was able to surf the web while talking on the phone. Then this morning Verizon pushes out some update and suddenly when im on the phone 3g disappears.from the top bar and I get an error message that I can't connect to the web. What happened and is there anyway.to reverse this?
View 5 Replies
View Related
Dec 1, 2009
My Orange UK Hero is unable to make/send calls or send/receive sms. It displays "No Service" on the lock screen but mobile data seems to work perfectly.
If I go to...
Settings->Wireless Controls->Mobile Network Settings->Network Operators->Search Networks
then select Orange, it says "Your SIM card does not allow a connection to this network"
If mobile data wasnt working then I would guess that its a SIM issue but I'm clearly connected to the network as im using their internet!
Just swapped SIM with a friends phone.
My SIM works in his phone and his SIM has the same issues in my phone.
Booting up, it was connected to the network for enough time for it to get a voicemail notification but showed "No Service" straight away.
Im guessing the best bet is to re-flash with the latest Hero Orange firmware. Any tips for backing up numbers/sms/cal etc?
View 3 Replies
View Related
Feb 2, 2014
When I had my iPhone, I can do iTunes backup to my Mac and when I have a new iPhone, I can do restore of the apps and data from the previous iPhone. It restore everything, including apps, the apps data, email configuration, etc.
For Android, there is "Backup My Data" under Settings --> Accounts. Does this do the same thing as the above?
For example, I tried to do this:
1). Check "Backup My Data"
2). Associate this with one of my Gmail account
3). Get a new Android phone and... I don't see "Restore" in the same Settings.
I DO see the settings to Backup My Data in the new Android phone, but I am afraid if I checked this, it will overwrite the data in Google's server
I am trying to figure out if Backup My Data can re-download all the apps installed in the older device, including the apps data. I don't care about email or contacts, since those are synced to my Gmail accounts.
View 4 Replies
View Related
Oct 2, 2010
I purchased a HTC Desire a few days ago and I think it's great. However, there is one thing that bothers me. I've been quite slow at joining the smartphone community, primarily due to all the reports/stories of high phonebills relating to internet usage. So, having got my hands on the phone its self - I thought I'd play with it for a while and stick to using my home wifi connection for downloading apps and playing with map applications etc.
The phone came pre-installed with Android 2.2 and therefore has this wireless hotspot app built in. So, to see how it worked, I enabled the feature and connected to the phone from my laptop.
My first surprise was that it worked. My laptop was connected to the phone and web pages were loading up on it. Realising that my phone was already set up to connect to my wireless router for internet access though, I figured that it was probably sharing that connection with my laptop. Well, at least that's what I was hoping...
At this point I unplugged my home modem/router and tried again. Fully expecting my laptop to complain about the lack of internet connectivity, I was quite shocked to find that web pages were loading up on my laptop and there's now a '3G' logo (with flashing up/down arrows) showing on the top status bar of the phone.
From what I've said here, my only conclusion is that my phone is transferring data over the mobile phone network, but considering that I don't have a data plan, how can this be? If I disable the hotspot feature (with my home router switched off), my phone cannot access the internet, but if I enable the wireless hotspot feature of the phone and connect to it - my laptop can.
My SIM card is from Tchibo Germany (o2 network).
View 9 Replies
View Related
Mar 20, 2010
I recently upgraded my Android app to support multiple resolutions. Previously, my Android.manifest file had a line:
To support multiple density and resolution devices, I changed this to:
CODE:............
I then added a couple of new directories, like drawable-hdpi-v4 and drawable-long-hdpi-v4 that includes the high-res versions of the graphics. That's about it.
Ever since releasing this update, there have been a decent number of users complaining about various problems:
the app icon doesn't appear (I did not create a high res version of the icon)
the home screen widget no longer works, even if they delete and re-add it (this code did not change with the update). I've had a user send me their error log, which shows:
CODE:................
There is one questionable section in my existing widget code that may be relevant:
CODE:..........
And perhaps most troublesome: the sqlite database is no longer accessible/writeable for some users so their data is no longer available. I did add the WRITE_EXTERNAL_STORAGE permission to the manifest. This is only happening to certain users and it tends to be HTC Eris users. In that error log I see things such as:
CODE:.........
It's as if the update has caused a new process and it can't access the old process's data, or something.
View 1 Replies
View Related
Sep 15, 2010
Why should a static method in java accept only final or non final variables within its method, but not static?
For example I have the following method:
CODE:.................
View 6 Replies
View Related
Jul 15, 2010
Grandfathered $5.99 T-Zones Data: Discuss All Related Questions Here ONLY
Someone confirmed it there. This would make this the only other Tmobile branded android phone to work with the cheap data plan other than the Behold 2.
For how long who knows, the behold 2 has been going on for years, but tmo, nor anyone really cared about that phone
View 34 Replies
View Related