Android :: Condition Variable Usage
Apr 21, 2009
I'm trying to use a Condition Variable to control the execution sequence of two threads. I can create a Condition Variable in one thread and block on it. But I would like to be able to access it from another Thread and unblock it from that thread.. ? Blocked Thread i am planning to keep as GUI thread and it should update the messages which are sent by b/g thread on the screen during its block state and will be unblocked by b/g thread in the end by calling open(); method.
View 3 Replies
Sep 26, 2010
Is copying the reference to the object and not the value of the object. Meaning, when I modify pos.top or pos.bottom, the original object gets modified. I'm guessing I am missing a concept of pass object by reference vs value here which I thought I understood. What is the fix here? Is it a problem with how I defined my custom class?
View 2 Replies
View Related
Nov 3, 2010
these is how to give a string as argument String link ="http://www.adobe.com /devnet/acrobat/pdfs /pdf_open_ parameters.pdf"; webview.loadUrl(link);But how to give an "URL" variable to load its content to webview.
View 1 Replies
View Related
Aug 23, 2010
Is it possible to get the GPS Co-ordinates if the mobile is in off condition?
View 4 Replies
View Related
Aug 9, 2010
I'm just starting with android development and have written an application to show details about the battery status.
Now I wanted to put the whole thing into an widget - and here's the question:
Do I really need a update service in the background to listen for ACTION_BATTERY_CHANGED intents? My first thought was to put just a <action android:name="android.intent.action.ACTION_BATTERY_CHANGED" /> line into the <intet-filter> tag of the widget in the AndroidManifest.xml - but obviously it's not that simple.
If the UpdateService is the right way I'll do so - but I just wanted to make sure what the proper solution is.
View 3 Replies
View Related
Aug 18, 2010
I am new to Android and this is my first question here so please go easy on me.
Is it possible to check some condition inside onCreate() of an Activity and display an AlertDialog?
I am creating an AlertDialog anonymously in Oncreate() and calling show on that instance but the AlertDialog is never displayed.
View 1 Replies
View Related
Oct 30, 2009
I am very interested in finding out how is the finish on the phone. Does it look like a screen protector will be necessary? Will the sides or back scratch easily? (For example I hate how the chrome bezel on the iPhone scratches no matter what you do to protect it.) Does it appear that the car dock or multimedia dock will eventually scratch or cause some wear on the phone's finish? (So many times accessories and even cases made by the phone manufacturer actually causes damage to the phone's finish after repeated use.) I admit I am anal and always try to keep my phone in pristine condition. Once it has a blemish or a scratch, I seem to constantly dwell on that and it distracts from my enjoyment of the device. I probably need a shrink instead of a new phone.
View 7 Replies
View Related
Apr 6, 2012
I'm looking for an apply (if there's any) that allows me to show current weather condition in status bar. I know that fancy Widgets and similar apps allows me to show the current temperature but I'm looking for app that show current weather as image (for example cloud, sun etc).
View 2 Replies
View Related
Nov 18, 2009
Tethering still works great on an un-rooted Hero using the "Race Condition" technique. Happy this still works! I don't have a need for it, but it's nice to know it's there if I am in a fix.
View 2 Replies
View Related
Dec 1, 2009
I don't know if it's my phone or what but when I look up the Other Usage on my phone, it shows it "Running" more than 2/3 of the time.And on Network Usage, "Android System" and "Media" use a great deal of the phone as well.I think this might have to do with my "android.process.acore" crashing every once in a while when it's asleep. Based on everyone's feedback I might have to return the Moment for a third time.
View 1 Replies
View Related
Apr 6, 2010
I am trying to create an item list, diffrent for each i and j variable. My code is: I get an error in the line .setItems(items,: items cannot be resolved I think that the compiler thinks that the CharSequence[] items may not be initialised or something. How can I make this programme run?
View 6 Replies
View Related
Nov 15, 2010
I am working to set a countdown timer. I have successfully (borrowed) a number picker (spinner) and set up the dialog box for the user to set the time. This is in a class called timepickactivity and the variables are hour and mins (R.id.hour and R.id.mins). I want to call the set values (R.id.hour and R.id.mins) from the dialog (timepickeractivity) to the actual countdown class (countdown) but I can't figure out how to get the values.
View 4 Replies
View Related
Oct 18, 2010
Has anyone set the Classpath variable in Eclipse?If so, where is it?
View 4 Replies
View Related
Jul 29, 2010
I have some xml files, and I keep them in raw folder. Now, the problem is that I have to use them with variable name according to my application condition. But I don't know how to fetch them. The main thing is that I am not getting that how to give the path of my xml file in application.
For example:
My file application.xml is stored in the raw folder and I have to access it with a variable name.
String xmlName= application.xml;
How can I fetch my xml through xmlName variable?
View 2 Replies
View Related
Apr 21, 2010
I have this code:
hubSpinner.setOnItemSelectedListener(new OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> parentView,
View selectedItemView, int position, long id) {
final MediaPlayer mp2 = MediaPlayer.create(Textbox.this, R.raw.hero);
mp2.start(); } public void onNothingSelected(AdapterView<?> parentView) {
} } );
(The code basically runs when a new item is selected of a spinner and then plays a song, which later will be a variable based on what was picked, but I'm fine as it is for now). And I want to be able to use 'mp2' out of this public void, (I want a button which pauses it). How can I do this?
View 2 Replies
View Related
Dec 15, 2009
Anyone know of an audio player that will speed up the playback? It would be nice if it could keep the pitch the same but sped up is the goal. I used TCPMP on the Treo. This is great for listening to podcasts in a fraction of the time. Depending on the original audio, I can generally make everything out up to +25%.
View 4 Replies
View Related
Sep 7, 2010
I'd like to make a preference screen with a variable number of preferences, very much like the WiFi selector. A number of profiles should be clickable and possible to edit and in the bottom there should be an add profile button. Has anyone got any tips on how to accomplish this? All I've found is this: http://groups.google.com /group/android-developers/browse_thread/threa.
View 4 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
Sep 13, 2010
I am doing an app related to football. I have a list view that will have various rows representing teams. In my custom array adapter I want to write some code that will present an icon for the team represented by the row. I have a drawable resource for each team (for instance for Indianapolis, Ind.png). In my code I can't refer to "R.drawable. Ind" because the Ind part is dynamic. That value would be in an array, like TeamArray[position]. As I expected, I certainly can't use R.drawable.TeamArray[position] because it won't even compile, it expects a literal name from the drawable folder. Is there a way to do this?
View 8 Replies
View Related
Jun 25, 2010
Is there a way to have 1 onClick Lister for many buttons where I can toss a case statement to do things based on what buttons were clicked.
I know I can make 100 different listeners for 100 buttons but I have to think I can create some nifty variables to do it in less lines of code.
View 4 Replies
View Related
Jul 11, 2010
I want to setImageResource for an ImageButton programatically, based on a variable.
For eg: if size=5, I want to setImageResource to R.drawable.five if size=6, I want to setImageResource to R.drawable.six
Unfortunately, I have too many of these, so an if-else or switch gets tiring.
Is there a way to achieve something like: R.drawable.size?
View 2 Replies
View Related
Sep 17, 2010
For now I've used the classic export command to set an environment variable and tried to read this variable from my test with System.getenv() function, but it doesn't seem to work. how to set and read a system variable in an Android application?
View 3 Replies
View Related
Feb 6, 2010
I seriously need help with a quite strange problem. I created a client which communicates with a server. Therefore, I have three classes. An activity providing a nice dialog to configure some data, a background service which checks the connection status periodically and a server class which handles the socket connection. Originally, the background service owned a server connection object but because I could not manage to provide data from the activity to the service, I decided to create the server connection class as singleton. The user is now able to change data in the activity (IP, Port, Username, Password) which shall be transmitted to the server object, if the save button is pressed. The data is read correctly, the activity calls the setter of the server class and the logcat also says that this data is correctly applied to the variable that stores the data in the server class. However, if I try to start the socket connection still the old values are stored in my variables although they've been overwritten before. What I am doing wrong, or how can I fix this?
View 13 Replies
View Related
Jan 31, 2012
How is declare global variable in android...some link send me...am searched various post..but am not clear about dis concept...send me valuable link..
View 3 Replies
View Related
Feb 29, 2012
Today i installed nano on my android device. it works but i have to set the following variables manually in the terminal emulator:
Code:
export=TERMINFO=/system/etc/terminfo
and
Code:
export TERM=linux
is it possible to set this variables automatically when the phone is booting?
Android Version 2.3.4
View 1 Replies
View Related
Jul 24, 2010
I have a list view with several columns; things such as name, date, etc. I want to be able to click on the header TextView and sort the list by that field. When the list loads the variable works, and a list is queried and sorted by the field _id (no surprise other than it works), but when i click on the header TextView I get a force close:
Thread [<3> main] (Suspended (exception SQLiteException))
ViewRoot.handleMessage(Message) line: 1757
ViewRoot(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 123
ActivityThread.main(String[]) line: 4595
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 521
ZygoteInit$MethodAndArgsCaller.run() line: 860
ZygoteInit.main(String[]) line: 618
NativeStart.main(String[]) line: not available [native method]
The TextView gives no errors when not changing my orderby variable.
Setting Variable:
private View.OnClickListener NameSortbtnListener = new View.OnClickListener(){
public void onClick(View v){
sort = " KEY_JOURNAL_TITLE ";
fillData();
} };
Populating List:
private void fillData() {
Cursor notesCursor = mDbHelper.fetchAllJournals(sort);
startManagingCursor(notesCursor);
String[] from = new String[]{journalDbAdapter.KEY_JOURNAL_TITLE,
journalDbAdapter.KEY_LOCATION, journalDbAdapter.KEY_JDATE,
journalDbAdapter.KEY_STEPS};
int[] to = new int[]{R.id.text1, R.id.text2, R.id.text3, R.id.text4};
SimpleCursorAdapter notes =
new SimpleCursorAdapter(this, R.layout.notes_row, notesCursor,
from, to);
setListAdapter(notes);
}
Query (In DB Adapter):
public Cursor fetchAllJournals(String sort) {
return mDb.query(DATABASE_JOURNAL_TABLE, new String[] {KEY_JROWID,
KEY_JOURNAL_TITLE, KEY_JOURNAL_NOTES, KEY_JDATE, KEY_LOCATION,
KEY_STEPS},null , null, null, null, sort ,null);
}
View 2 Replies
View Related
Jul 10, 2010
How can i access an Adroid drawable by a variable?
View 1 Replies
View Related
Mar 14, 2010
I'm new to development on Android and thought maybe you could shed some light on my problem. I'm trying to code up a little object to take care of playing a list of songs at a constantly varying playback rate. I just spent a god chunk of time getting it going with SoundPool only to find out about the undocumented 1 mb file limit. Do you guys have any ideas? Should I be using AudioTrack? I was going to try that next. Any tips or code samples for doing this kind of thing? It's such a shame that neither JetPlayer nor MediaPlayer support rate changes.
View 2 Replies
View Related
Dec 1, 2009
I created an application with loging and an arraylist to fill a ListView.
If i am calling or i need to check my mail, sometimes i lost the context of my application (variables and the listview !)
It is a little complex to save arraylist in SharedPreferences and i am not an expert in SQLite.
Do you know a solution to keep persistent my data (variables and the arraylist) during the use of my application?
View 2 Replies
View Related
Apr 20, 2010
I'm a bit new to programming Android App's, however I have come across a problem, I can't find a way to make global variables -unlike other coding like php or VB.NET, are global variables possible? If not can someone find a way (and if possible implement the way into the code I will provide below) to get a value from the variable 'songtoplay' so I can use in another Public Void...
Here is the code:.............
Basically, it gets the value from the Spinner 'hubSpinner' and displays it in a Toast. I then want it to return a value for string variable 'songtoplay' -or find a way to make it global or useable in another Public Void, (Which is will a button, -loading the song to be played)
View 3 Replies
View Related