General :: NFC - Presenting Static UID
Apr 27, 2012
Not sure if this is the right section but I have a quick question regarding NFC in android 4.0.4. I wondered if it was at all possible, either with an app or with some hacking to present a standard UID from the NFC, rather than generating a random code each time.
I am looking at using my handset on a door access system which traditionally reads the UID from a Mifare 2k card. If I could get it to present the same number each time I am sure it would work.
View 3 Replies
Sep 30, 2010
I'm having my first stumbling steps with android and are trying to modify an existing notepad example from Android dev. I have a database with an existing column named CREATED_DATE (of the note) but the data for that column is presented as System.currentTimeMillis(). This is all good and probably in line with conventions since it's created by the developers.
But my problem is that I want to present the date in a ListView using the format "30 sep". My problem, how do I convert the data to that format before presenting it in the ListView? Right now I'm using this kind of adapter:
CODE:...........
Now, I've figured out how to convert currentTimeMillis() to todays date but how can I convert the data coming from the cursor before I toss it into the adapter?
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
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
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
Feb 23, 2012
i got a problem with cm7 after installing it. when i stop playing mp3s, the first thing i hear is static. i dont know why. i noticed that DSP manager is installed which is an equalizer. i had it both enabled and disabled. either way the music is still staticy. is there a way to get rid of this static?
View 5 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
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
Jan 15, 2013
I've got the Screencast Video Recorder app on my Nexus 7 but when I finish recording anything, the only result I get is a video, of accurate length, full of a pale static image. None of what I've recorded can be seen at all.
When I had this app installed on my Samsung Galaxy S2 it worked perfectly. Now I have it on my N7 and it doesn't work so I'm thinking that it could be a tablet compatibility type issue, even though I'm able to install and open the app fine.
As is shown in my sig, my Nexus 7 is stock rooted, so it's not as if a custom ROM is causing the problem.
View 2 Replies
View Related
Jan 4, 2010
Is there a way to get the current Context instance by using a static method? I'm looking for that way because i hate saving the context instance each time it changes.
View 1 Replies
View Related
Sep 11, 2009
I was working on Freescale iMX31 board, I ported android and it was working fine , but when it came to integration of WiFi & Bluetooth, android forum recommended me to do static compilation for porting over android !
Can I know why some drivers have to be statically compiled before it is ported over android? It was not the case with other drivers which when integrated with android, they worked perfectly well like serial port, usb etc..
View 2 Replies
View Related
Jul 29, 2009
I use a single static class in my code that defines a static field which I'm reusing between Activity onStop/onStart invocations. Here's a scenario:
User clicks on "Authorize" button (static data is initialized) Activity is stopped and web browser is called
Browser executes callback and Activity is restored (static data is reused)
At least one of my users reports the failure at step 3 which I cannot reproduce but which looks like reset of static data.
View 1 Replies
View Related
Sep 30, 2010
I am creating an Android application which will have some embedded music inside of it ( ~ 80 MB ). I was planning on putting it in the res/raw folder.
Since android stores that all in it's internal memory, is this way too large? What are my options? I have come up with the following:
Copy resources out of internal storage and onto the SD card when application first starts. Afterwards remove from internal storage (is this possible?)
Download music from the web when the application first starts.
I would really prefer not to have to go with option 2 since I want the app to be entirely offline and the static music is not going to change (except between releases).
View 2 Replies
View Related
Oct 6, 2010
This seems to happen mostly when I'm talking to one person, but every now and then I'll hear static on the line when I start to talk. Sometimes when I sniff it happens, or if we talk over each other. It doesn't happen on other calls, so is it the other phone perhaps?
View 22 Replies
View Related
Jul 8, 2010
All of a sudden my speaker (the one you put to your ear) sounds really static-y. Not signal static, it's very clear that it's the speaker itself or at least something around it vibrating. It kind of sounds a speaker that has been damaged (ripped, or got wet or something even though it has not been wet).
Anyway, I plan on taking it into the sprint store today and having them check it out. Anyone one else with this problem?
View 28 Replies
View Related
Jun 3, 2009
As a first step toward a speech recognition project, we wrote a simple voice recording application based on the information in this thread:
http://groups.google.com/group/android-developers/browse_thread/threa...
It is working; however, the audio is extremely poor too static for our needs. As a comparison, we did a similar audio file captured with audacity on a PC and it was much better. Has anyone been able to record high quality audio with the android dev phone? According to the documentation of MediaRecorder, there is only one audio encoder "AMR (Narrowband) audio codec" and three output formats--3gpp, mpeg, and raw AMR:
http://developer.android.com/reference/android/media/MediaRecorder.html
According to wikipedia, AMR encoding is only 8hz. Is there a better option available perhaps a lower-level API compared to MediaRecorder? We are testing on Windows XP, with a Logitec USB microphone, eclipse ganymede, and we are using all the defaults for an android 1.5 app (no emulator command-line options. We defined the SD card in AVD manager).
View 2 Replies
View Related
Jun 4, 2010
I cant get the FM radio to work at all when I plug in headphones and turn it on all I hear is static no matter what station I goto. It would be real nice to get it working so I can use it while I'm walking. If I don't find a solution eventually I am going to take it into sprint and see if its defective and get and exchange for another Evo.
View 24 Replies
View Related
Mar 7, 2010
When starting a new Activity, I want to pass a complex object and do so by using this approach:
MyActivity.COMPLEX_OBJ = myComplexObj; // which is definitely NOT NULL! Intent intent = new Intent(); intent.setClass(this, MyActivity.class); startActivity(intent);
and then in MyActivity:
@Override public void onCreate(Bundle bundle) { if (COMPLEX_OBJ == null) { // report to Flurry ... } ...
}
View 17 Replies
View Related
Nov 27, 2010
so everyonce in a while at the beginning of a phone call i get this crackling static sound till i hang up and retry the phone call then its fine didnt know what the cause of this could be?
View 1 Replies
View Related
Apr 1, 2009
I have noticed in my application(s) that after a call to Activity.finish() that the static variables that I declared in my classes still hold the values that they were changed to during the activity's life cycle. Upon the re-launch of the activity, the program does not re-instantiate the variables as declared or set them to the default java behavior. Is there something that I can do to cause this to happen, other than re-setting every static variable in my application?
View 3 Replies
View Related
Nov 17, 2010
Static Layout for whole app that must be in all Activity
View 12 Replies
View Related
Sep 8, 2010
Why is the use of static final variables encouraged to declare constants over just final variables? The use of static sounds logical when there will be many instances of a class but is this argument correct when used for a Android activity. In fact, since the Class instance will be around even after the activity finishes and is eventually garbage collected, it seems like all these constants will still be in memory until the class loader is around. Also, does the compiler inline non-static final variables(ints and String) just like it does for static final variables?
View 2 Replies
View Related
Feb 15, 2010
I'm trying to handle exceptions at a global level. My understanding is that the only way to do this is with an UncaughtExceptionHandler. However, this reduces one to the primitive java file and network i/o packages. I'd like to be able to broadcast an intent or bind to a service. Is there some way to interact with the android packages to retrieve a context in a static manner? I could probably do some hack workaround with a thread local, weak-referenced context set at the time of the exception handler, but I'd rather avoid that nastiness.
View 4 Replies
View Related
Dec 23, 2009
Does anyone get soft static on their Hero? i can't tell if it is certain people i talk to or just all the time.
View 1 Replies
View Related
Jun 12, 2010
I have a ListView with several columns and I need a header row at the very top that labels each of these columns that *does not* scroll with the rest of the ListView. I am using addHeaderView right now, but I've ran into 2 problems:
1) The header scrolls. I need it outside of scrolling so that it's always "floating" on top.
2) Each column in the header isn't lining up with the columns in the listview. I can make the header columns and data columns all line up perfectly if they're all in one big TableLayout, but how would I get the header to be outside of the scrollview yet also stay uniform and inline with the data columns?
View 8 Replies
View Related
Mar 19, 2010
In android, are using static variables a recommended practice?
E.g, implementing a Singleton pattern in Java, I usually do...
Also, when does this get cleaned up by the Android JVM?
View 6 Replies
View Related
Sep 30, 2010
I use in the getView()-Method of this example a static function to download the source of an ImageView. Later there will be threading included. However, I like to know in general how save the use of static function is in this case.
Because I experienced, that in some cases (when I scroll really fast) the Images get mixed up.code...
View 3 Replies
View Related
Aug 2, 2010
I need to revisit this again, because soon I am going to RRU and set my phone back to stock and call Verizon so they can send me a new one. My issue is that when I connect to a wifi network, Secured or not, G/B/N anything it connects gets an IP but I get no internet connectivity. When I set a static IP it works fine and I have no isssues. I know my stuff pretty well, but is there an app that will tell me my network info like DNS, Netmask and IP out there? I am trying to find out if for some reason its not getting a DNS entry. I have even go so far at my house to change the DHCP to my wireless router opposed to my Sonicwall thinking that might be the issue.
View 2 Replies
View Related