Re: [android-developers] Mapview can not be resolved to a type
Check ur android properties of your project...it should be set to Google api not 2.2 etc On 23 Jun 2011 23:43, juhi paunikar juhi.pauni...@gmail.com wrote: Hi, i tried the project which is given belows link: http://developer.android.com/resources/tutorials/views/hello-mapview.html i am getting error as given below: Mapview can not be resolved to a type. Can anybody give me suggestion to solve this 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 android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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 options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Fragments won't display in port orientation
Aren't you also supposed to specify the orientation of the fragment as well ...so the xml definition is fine but i think u should look at the fragment definition as well. On 17 Apr 2011 09:42, Brill Pappin bpap...@sixgreen.com wrote: I'm very confused on why my fragments refuse to draw in portrait mode and draw fine in landscape mode. I'm build a screen with two fragments. in landscape they are side-by-side and in portrait they are supposed to stack one above the other. however now matter what I seem to try, the portrait mode refuses to draw the fragments. I can also not use any layout except LinearLayout and even then if I add the LinearLayout android:orientation=vertical the fragments refuse to draw. I'd actually prefer to use the RelativeLayout in this case, but i does not display anything at all. To illustrate what i'm doing: This works... ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/android; android:orientation=horizontal android:layout_width=match_parent android:layout_height=match_parent fragment android:name=sixgreen.pots.ReceiptFragment android:id= @+id/saleReceiptFragment android:layout_weight=1 android:layout_width=0dp android:layout_height= match_parent / fragment android:name=sixgreen.pots.SaleControlFragment android:id= @+id/saleControlFragment android:layout_weight=1 android:layout_width=0dp android:layout_height= match_parent / /LinearLayout ... and this *does not* work... ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/android; android:orientation=vertical android:layout_width=match_parent android:layout_height=match_parent fragment android:name=sixgreen.pots.ReceiptFragment android:id= @+id/saleReceiptFragment android:layout_weight=1 android:layout_width=0dp android:layout_height= match_parent / fragment android:name=sixgreen.pots.SaleControlFragment android:id= @+id/saleControlFragment android:layout_weight=1 android:layout_width=0dp android:layout_height= match_parent / /LinearLayout (yes, they are in different resource dirs; layout-land and layout-port respectively.) I've been hacking away at this for a while now, trying all sorts or permutations and layouts with no luck. Does anyone have any suggestions on what i might try, or even how to debug this, that i may not have tried already? At 4:30 am, it's time to give up and get some sleep :) - Brill Pappin -- 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 options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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 options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Database shared by Activity and Service. What's the best approach?
Would a content provider work? On 14 Apr 2011 04:56, bogde bogde...@gmail.com wrote: I'm new here and new to Android development too, so I want to apologize for my ignorance. I'm working on an application that is supposed to gather some data from an external device continuously, display the data on a chart in real-time and also store data so it's accessible at a later time as a table or as a chart. The application needs to store the data all the time, even if it's not active on the screen. Currently I have a service that starts on boot and deals with receiving the data and storing it inside a sqlite database. The service opens the database and keeps it open all the time, until it's killed. This part seems to work pretty well so far. Now, I would like to have an activity that retrieves the last 60 values from the database and plots them on a chart. I'm currently using Android Plot. I need to have a thread or something that constantly checks for database changes and redraws the chart on the screen if needed. My question is, what would be the best way to accomplish this? How to share the database between the service that runs all the time and an activity? I searched and answers to somewhat similar questions are all over the web. However, most people talk about how to share the database between two or more activities or between an activity and a service that is started temporarily. 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 For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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 options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] static variable set to null
your code force closing is preventable by a simple null check.. if(yourvariable != null){ do something}else{do something else or do nothing and display an error message}. The question about whether youwant to share global variable between activities is something you should really ask yourself... pass stuff to other activities using intents or bundle and do null checks. that way you can find out which activities are settting ur data to null and fix it.. On 12 April 2011 08:11, Christophe christophe.lebesner...@gmail.com wrote: hello everybody, I use a static variable to share data across all the activities of my apps. The problems is that sometimes this variable is set to null, which cause the others activities to crash (nullPointersException) ... does somebody have an idea of what could set the static variables to null ? regards, Christophe -- 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 options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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 options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Background service stay alive
Most likely ur music will be in a separate process, that can run in its own service and communicate VIA an aidl interface On 9 Apr 2011 10:10, Eason dragonea...@gmail.com wrote: Hi all, I am trying to make several apps that can listen to system states all the time and give responses when there is any event happens. For example, a battery state widget, but my widget doesnt work after a certain period of time. I found that the problem is, the background service is not functioning after some time. So how can i solve that?? Say, for the battery widget, is that wrong to create a background service and listen to the battery state (battery level, plugged to USB/ AC)? if else then what should i do to keep track with the battery status? Another app im working on is a music player, i created a background service to allow user listen to music in background (even if the application is closed), it is also a better way for me to manage the life cycle of the media player in the app), but the service is gone after some time and it annoys me. Please help =[ -- 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 options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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 options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Background service stay alive
For the battery state use a broadcast receiveru shouldnt need need a service for that On 9 Apr 2011 10:10, Eason dragonea...@gmail.com wrote: Hi all, I am trying to make several apps that can listen to system states all the time and give responses when there is any event happens. For example, a battery state widget, but my widget doesnt work after a certain period of time. I found that the problem is, the background service is not functioning after some time. So how can i solve that?? Say, for the battery widget, is that wrong to create a background service and listen to the battery state (battery level, plugged to USB/ AC)? if else then what should i do to keep track with the battery status? Another app im working on is a music player, i created a background service to allow user listen to music in background (even if the application is closed), it is also a better way for me to manage the life cycle of the media player in the app), but the service is gone after some time and it annoys me. Please help =[ -- 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 options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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 options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Thread and ProgressDialog
new PersonnelLookUpTask();// start task..choose where u want to start it..oncreate or button click..ur choice. Input|Progress(u can ignore this parameter)|Output private class YourLookUpTask extends AsyncTaskString,Void ,ArrayListPersonnelObject{ @Override protected ArrayListPersonnelObject doInBackground(String... params) { //put the stuff ur run executes here } @Override protected void onCancelled() { // TODO Auto-generated method stub dialog.dismiss(); super.onCancelled(); } @Override protected void onPostExecute(ArrayListPersonnelObject result) { Progressdialog.dismiss(); } @Override protected void onPreExecute() { super.onPreExecute(); //ProgessDialog.show(); } } hope htis helps On 6 April 2011 05:45, SD315 sailer...@gmail.com wrote: Hello, i'm trying to do some work in a thread while showing a progress dialog until the work is done in the most simple possible way, so far i got this: // this is the current activity final ProgressDialog prgDialog = ProgressDialog.show(this, , Working..., true, false); new Thread() { public void run() { Util.DoSomeWork(); // a static method prgDialog.dismiss(); }}.start(); at least it work fine in the emulator, but i'm concerned about it's correctness, specifically about calling prgDialog.dismiss(); (note that the variable prgDialog is created in the main thread), is this correct? bye -- 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 options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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 options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Problem with ListAdapters and Cursors
I would use a hash map ...key value Map yourMap = new HashMap(String,ListString); populate your adapter from the list after identifying which key u are interested in On 8 April 2011 12:35, Duskox dus...@gmail.com wrote: Hello people, so I am trying to build a somewhat simple app where I am working with an array of objects where is of those objects had also an array of other objects. I have made this array a public variable and placed it in a class that extends Application. ( I found that on the net as the best way to have a public variable) So now that I have an Array of Objects, I need to display a list of names of those objects. Object has variables: mName, mArray (of objects), mLength and I need to display in my ListView a list of mNames. First problem I have is that I am not really into these cursors and adapters and second, I am not sure what is the best way to pass this global array variable. I know passing a global variable sounds weird but since I am initializing this variable in one class (class of the main View), and I am switching to another View where I want to show the contents of this array I am a bit stuck should I send this variable or somehow fetch a reference to it through this or whichever way. I must say I am a noob at this :-/ Thanks for any help or a pointer what to read. Tnx! D. -- 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 options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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 options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: ListView + Activity change
ListView l1 l1.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView? arg0, View v,int arg2, long arg3) { xxxYourObject Type selectedObject = YourObjectList.get(arg2);/ Intent intent = new Intent(v.getContext(), YourActivity.class); intent.putExtras(YourObject.toBundle());//if you have implemented to pass multiple variables to the next activity startActivity(intent); } }); } On 8 April 2011 13:33, skera szrnka.pe...@gmail.com wrote: I think I'll use Checkbox instead of Spinner. :) Thanks for your help! :) -- 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 options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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 options, visit this group at http://groups.google.com/group/android-developers?hl=en