[android-developers] Re: Android, send me logs! - code library for detecting force-close and sending logs
Mike - I think Apple's approach may be good for Apple, and probably not that compatible with the openness of Android? Also, what's better of Apple's approach other than that users don't have to give their identity (email addresses etc) to individual developers? If you suggest it here, we could definitely consider to add it to the library if appropriate. "mssmison" - thanks for your interest and compliment. Please let me know if you have any issues with the code. On Feb 25, 4:38 pm, mssmison wrote: > I love this idea! > I'd like to build it into the source itself, that would be a life > saver.. lol -- 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
[android-developers] Re: Could I get available package from somewhere?
Which package are you looking for? On Feb 26, 11:17 am, wangsuya wrote: > Dear every one > > Because I could not get avaible package from "Android SDK and AVD > manager" of eclipse, could I get this avaible packages from somepalce? > hope help 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 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
[android-developers] Re: Piracy sucks, or does it?
Backdating the Phone would be major PITA , and surely screw up all the calendar and synchronization stuff. Is the app in question as expensive to mandate this PITA? -- 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
[android-developers] Re: A question about Android Compass sensitivity
On Feb 25, 11:33 am, Arindam Nath wrote: > Hello, > > I am thinking of developing an app on android to measure small > distance of up to .5 meters and the direction of motion. The problem > is this that i dont know wether i can rely on the inbuilt compass > reading to measure such a small change. I need help for if this method > does not work i am thinking of using the camera to detect motion using > motion detection algorithm. Hoping to get ur reply soon as my whole > internship project depends on this. Thank You. Accuracy of sensors is not a property of android, but of used hardware. Sensors used in HTC Hero sell for about $3 wholesale - I would not await much precision there. And compass, being magnetic, is sensitive to ambient magnetic fields ( resulting from electric installations around you) - so relative readings may be OK, but not absolute -- 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
[android-developers] what are 9-patch bad patches?
I've created some button .pngs in CS4 Fireworks and have loaded them into draw9patch. The shadow effects I'm using to create a 3D-ish look- and-feel cause the draw9patch tool to mark all the stretchable areas as 'bad'. What artifacts are created when 'bad patches' are stretched? How do I steer clear of graphics that won't stretch properly as 9- patch pngs? -- 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
[android-developers] Re: Dialog goes away on click of search button
Bolha, Thanks for responding. Dialog is created using onCreateDialog and I am invoking it by showDialog(int id) Below is the code. When my PurchaseActivity starts I do not want the dialog to go away until I get response from the server but clicking on the search button removes it. For now I have created a customer ProgressDialog class and eating the search button, which makes sure dialog doesnt go, but there will be other scenarios like incoming call which will remove the dialog public abstract class MyBaseActivity extends Activity { public static final int DIALOG_PROGRESS_SPINNER = 3; Handler handler = new Handler(); ProgressDialog progressDialog; protected Dialog onCreateDialog(int id) { switch (id) { case DIALOG_PROGRESS_SPINNER: progressDialog = new ProgressDialog(this); progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); progressDialog.setMessage(getString(R.string.loading)); progressDialog.setCancelable(false); return progressDialog; } return super.onCreateDialog(id); } } public class PurchaseActivity extends MyBaseActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.purchase_screen); //do other stuff handler.post(new Runnable() { @Override public void run() { showDialog(DIALOG_PROGRESS_SPINNER); //call asynch thread to do some server work which will call listener in the same activity to dismiss dialog } }); } } On Feb 26, 4:08 am, Bolha wrote: > Amit, > > How are you creating the dialog? Sometimes, when creating a dialog > outside the overriden method "onCreateDialog" (from Activity class), > the dialog can have strange behaviors (mainly because it sometimes the > dialog instance is lacking a reference to its parent). Can you post a > piece of your source code? > > Thanks > > Bolha > > On 25 fev, 16:53, A R wrote: > > > Hi, > > > I have an activity which starts with a progress bar and I do not want > > the progress bar to go away until the processing is done, I have set > > the dialog to be setCancelable(false) so now user cannot cancel it > > with back but there are several other situations which hides the > > dialog for eg pressing 'search'. > > > On clicking of 'search' button the search box and keyboard pops up, > > back button hides it and shows my activity which is always in the > > background but the dialog is gone. > > > I can disable the search button but ideally I would want dialog to > > come back when the activity comes in foreground again. Any ideas how > > to do it? > > > Regards, > > Amit. > > -- 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
[android-developers] Could I get available package from somewhere?
Dear every one Because I could not get avaible package from "Android SDK and AVD manager" of eclipse, could I get this avaible packages from somepalce? hope help 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 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
[android-developers] Simple Audio MediaController for Audio
Hi guys, I've been unable to successfully hookup a MediaController to an audio MediaPlayer. I've successfully created a MediaPlayer to play audio. And i've also programatically instantiated a MediaController. MediaPlayer mp = myclass.getMediaPlayer(); //My custom class that returns the current media player MediaController mc = new MediaController(this); mc.setAnchorView(button); mc.setEnabled(true); mc.show(2000); //does not crash if i comment this out I have 2 big problems: 1. The above code crashes unless I comment out the show. In which case the controller does not appear. I have debugged mp and mc and the button are all not null values, but I still get the following in logcat: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.android.test.activity.testActivity}: java.lang.NullPointerException at android.app.ActivityThread.performLaunchActivity(ActivityThread.java: 2496) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java: 2512) at android.app.ActivityThread.access$2200(ActivityThread.java:119) at android.app.ActivityThread$H.handleMessage(ActivityThread.java: 1863) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:123) at android.app.ActivityThread.main(ActivityThread.java:4363) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:521) at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:860) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.NullPointerException at android.widget.MediaController.disableUnsupportedButtons(MediaController.java: 258) at android.widget.MediaController.show(MediaController.java:288) at com.test.android.test.activity.testActivity.onCreate(testActivity.java: 105) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java: 1047) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java: 2459) ... 11 more 2. The other problem is that I cannot see a way to hookup the MediaController to Mediaplayer as setMediaPlayer does not take MediaPlayer as the paramater. A simple example of a MediaController working with mp3's would be all that I need! Thanks alot for your time. -- 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] Obtain unicode string for Roslien Language
Your question is puzzling me. First, I can't find any reference to standard Unicode character code for a "Roselian" alphabet on the internet. My best suggestion is you refer to the creator of the ttf file to find more information. On Thu, Feb 25, 2010 at 12:37 AM, Takami Labs wrote: > Hi, > > I have an assignment to be completed. > The assignment needs sms texting service facility in Roslien Font (for > each English alphabet we have a corresponding alphabet in Roslien, > something like Wingdings) for Android platform. > On going through the posts available on different forums in internet, > I observed that in order to send a different language text, I need to > send the sms as a unicode string. > The problem is, I have no clue on how to obtain the unicode string > for a completely new font , Roslien. > I have a " .ttf " file for the font which as such which contains the > alphabets in the language. > > Please help me , how do I obtain unicode string for the particular > font. > > Thanking You, > > Regards, > Srikant Aggarwal > Android Developer > > -- > 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
[android-developers] Alert Dialog to display across activities?
Does anyone know if it's possible to get a Dialog box to display between activities? I've looked and haven't been able to find a solution. -- 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
[android-developers] LOVERS SPECIAL
hi, we meet ,we talk,we exchange ideas,we grow together.this is an oppurtunity to tap into the best brains in the world, to share ideas,. we believe life is too short and too beautiful not to be enjoyed ..JUST WATCH AND ENJOY YOUR LIFE http:www.joshuanet.in making money is hardwork but there is a way to make much more money your hardwork. just watch&join it http://www.joshuanet.in BEST WISHES -- 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
FW: [android-developers] Re: FormatDateTime
All: So I realized my date/time is already formatted by time zone and re-adding the default time zone was subtracting the time zone offset again from the time! So, new code to replace the formatting function is below: Date date = df.parse(dateTime); if (sdk < 3) { finalDateTime = df.format(date); } else { finalDateTime = DateUtils.getRelativeDateTimeString(this, date.getTime(), dateMin, dateMax, dateFlags).toString(); } So, why is it called "reflection" anyways? Is it like "reflecting" on all those previous SDK versions and thinking about the special times we had w/ them? Thanks, Nick Owens VP, ThreeClix Office: (904) 429-7039 Mobile: (847) 565-9392 After Hours: (904) 540-5830 -Original Message- From: Nick Owens [mailto:nicow...@gmail.com] Sent: Thursday, February 25, 2010 5:38 PM To: 'android-developers@googlegroups.com' Subject: RE: [android-developers] Re: FormatDateTime Mark (et. al. interested parties): Thank you for the example on reflection. I got it working and thought it might be prudent to share my results w/ the world so the completed code is below. For the record, this date value (as a string) is being retrieved from a SQLite database and the function formatDateTime() is used in a custom adapter for display of the date for each record in a ListView. This compiles in Eclipse using Android 1.5. This allows me to set a minimum sdk version of 2, while still utilizing this really nifty date display function. public class ResourcesList extends ListActivity { ... int sdk = new Integer(Build.VERSION.SDK).intValue(); private static final long dateMin = 6; private static final long dateMax = (8640 * 2); private static final int dateFlags = 0; ... public String formatDateTime(String dateTime) { if (dateTime == null) { return "Never"; } else { String finalDateTime; DateFormat df = new SimpleDateFormat("-MM-dd HH:mm:ss"); try { Date date = df.parse(dateTime); if (sdk < 3) { finalDateTime = df.format(date); } else { long when = date.getTime(); finalDateTime = DateUtils.getRelativeDateTimeString(this, (when + TimeZone.getDefault().getOffset(when)), dateMin, dateMax, dateFlags).toString(); } } catch (Exception e) { finalDateTime = "Unknown"; } return finalDateTime; } } ... } Thanks, Nick Owens VP, ThreeClix Office: (904) 429-7039 Mobile: (847) 565-9392 After Hours: (904) 540-5830 -Original Message- From: android-developers@googlegroups.com [mailto:android-develop...@googlegroups.com] On Behalf Of Mark Murphy Sent: Thursday, February 25, 2010 4:23 PM To: android-developers@googlegroups.com Subject: Re: [android-developers] Re: FormatDateTime Nick Owens wrote: > On another note, is it possible to provide a conditional instruction for > formatting date/time based on the user's Android package: > > if (package > 1.1) { > > //cooler date time format > > } else { > > //regular date time format > > } Yes, either via reflection or via conditional class loading. > Let me guess? It is technically possible, but not in Eclipse since Eclipse > won't even let it compile w/ a function that doesn't compile. No, it should work fine. However, you need to compile for the higher version. > Or can I > build it for Android 1.2 but allow users of 1.1 to download it by specifying > a different min-SDK level than it is built for? Dunno. What's Android 1.2? :-) > If so, can I write a > conditional instruction based on the device's SDK level? Yes, either via reflection or via conditional class loading. This was discussed here: http://stackoverflow.com/questions/2312321/how-to-use-contacts-api-for-andro id-1-x-and-2-x-simultaneously and here: http://stackoverflow.com/questions/2044985/android-contactscontract-and-buil ding-across-multiple-sdk-versions Some
[android-developers] Re: Piracy sucks, or does it?
On Feb 25, 10:49 pm, Angel Cruz wrote: > Just wondering about the bomb idea: > What if the user changes the date back a week from the bomb deadline? Just to interject on this thought. It is possible (Granted extra code and you need to weigh up if it's worth it, or create a library) to track the changing of the date via intents. You then silently record the back-date and then bomb 30 days from that. Just a thought ;) Regards Anthoni -- 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
[android-developers] Re: What replaced activityCreator ?
I see now that it has been replaced by android create project as documented on this web page http://developer.android.com/guide/tutorials/hello-world.html On Feb 24, 11:21 pm, Brian wrote: > I have noticed several tutorials use the activityCreator script, for > doing various different types of builds for android. But i can not > find that script in the SDK it appears to have been deprecated sevaral > versions ago. > > So my question is, what has replaced activityCreator ? -- 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
[android-developers] Re: I want to use assist code on the Eclipse.
It's work. thanks a lot. Have got day Anithian, and Bob -- 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
[android-developers] Re: why I can't see google's nexus one from eclipse
> The drivers that come with the latest Android SDK download work well > for Vista 64bit and Windows 7 64bit (i used it on both). I don't know > about XP 64bit, though... I do! -- 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
[android-developers] Re: intercept sms
Thank you for your answer. Can I let my app have a high priority than default sms that I can receive the message before it? Or have any another ways to prevent sms receive short message? I only have a demand that prevent sms receive some short message which matches conditions I specify. On 24 Feb, 14:14, Kumar Bibek wrote: > You can of courseinterceptincomingsms. But you cannot disable the > notification. Also, you have to do your bit of work within a certain > time limit, else your process will be closed. > You can also not abort the broadcast. > > On Feb 24, 9:32 am, nigel wrote: > > > requirements: > > 1.Caninterceptshort messages by condition I specify(means that the > > system'ssmscan't receive any messages and don't send any > > notification to user). If the short message isn't match my condition > > that my app will notinterceptit and thesmscan receive the short > > message. > > > 2.When Iinterceptasmssuccessfully,I can handle this message such > > as store it to a custom table. > > > I implement the functionality above by ContentObserver class,but it > > not work well.Sometimes it can'tinterceptshort message in time.I > > think it's due to system delay.In this case,thesmsand my app will > > receive the short message and send notification at the same > > time.So,now I hope who can help me to solve this issue or give me some > > hints. > > > 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 android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Request for onScroll example?
I would love for one of you smart folks to show me a small example that increments/decrements a count on onScroll up and down and prints it out. I'm still unsure of the sequence of extends and implements and super and listener and what order they are declared/invoked/ instantiated. Thanks. It will really help me understand. -- 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
[android-developers] Re: bug reporting
A follow up. I'm close to a working prototype as I described a few weeks ago. The code looks like it was written by someone who's only been developing Android apps for two months (DH and MM would reach through the screen to strangle me) and the UI looks like it was designed by a developer, but hopefully it will prove useful as a starting point or at least a conversation starter. The prototype is currently bridging to JIRA and Issue Tracker. I should have some source on github late next week after I've read up on git, maven, and have my project build ducks all in a row. http://tinyurl.com/yeol4sh http://tinyurl.com/ybeqybd regards, Jess On Feb 2, 7:36 pm, laphroaig15 wrote: > It certainly wouldn't be closed. I'm not looking to implement yet > another issue management system or sell a hosted solution. There are > many folks who already do that. I'm thinking more of a user friendly, > common bridge to those systems. I'd mentioned JIRA because I have a > fondness for the Atlassian products (quality, weight, price point, > etc.), and I like independence. That would be one concrete SPI > implementation that I'd build out to support my own projects. Someone > who actually comprehends Google's auth methodology wrt Android could > implement, or help me implement, a similar plugin for Google Issue > Tracker. > > I appreciate the excellent input. I'll follow up when I have some > seed code to contribute. > > -Jess > > On Feb 1, 9:57 pm, theSmith wrote: > > > On Feb 1, 4:52 pm,laphroaig15 wrote: > > > > The alternatives you suggest seem to be summed up as, "implement the > > > equivalentbugreportingtool in your own app." That, of course, is > > > always an option. Everyone could implement their own variation. > > > However, it seems to go against the general Android theme of a > > > separation of concerns and the loose coupling of apps. It also > > > assumes that developers would take the effort to implement it. > > > > No issue management is absolutely necessary, as evidenced by many of > > > the existing apps in the marketplace. What I am after is whether an > > > open implementation holds value. Would it help developers and improve > > > the robustness of applications? Would it add value to the end users? > > > I have a strong SCM background, so my judgment is a little biased. > > > Absolutely I believe this would add value to any application that > > would use it. It could even be seen as a marketing point in the app's > > description "Uses ___ forBugReporting" Automated and simple > > errorreportingwould provide a great asset to the Android community, > > especially if it were open and easily implementable. That would be my > > primary concern with such a system. If you were to start working on > > this, I would suggest opening it up to the community, not right away > > though, wait till you have something of substantial value with a > > robust feature set. As for the actualreporting, how would you > > collect requests from several applications and multiple developers? > > Who has access to what? Do they need their own accounts? (I'm not > > familiar with JIRA) > > > -theSmith > > > > Broadcasting seems to be working. Maybe I'll try generating a deep > > > stack overflow to get a gauge on the upper bounds on the stacktrace. > > > It might be a big chunk of info, but hopefully the system won't be > > > generating a high volume of them. I'm reading up on content providers > > > at the moment. > > > > On Feb 1, 2:45 pm, theSmith wrote: > > > > > Certainly interesting but there are other solutions. > > > > > >> 1. It doesn't engage the user to acknowledge that a problem has > > > > >> occurred (mea culpa). > > > > > Not true, you can pop up a message box in the default handler and tell > > > > them an error occurred. > > > > > >>2. It doesn't elicit contextual information from the user. > > > > > Again in the message you can ask them if they want the error sent to > > > > your server. > > > > > >>3. It doesn't help to provide the user visibility into the state of > > > > >>issues for the application (bugs nor enhancements). > > > > > Depending on how your app identifies the error you can tell them what > > > > it is. Also providing a change log in your app could be valuable. > > > > > >>4. It requires that my application request internet permission > > > > > Well yes, most applications want this anyway (we are dealing with > > > > smart phones here). If you let the users know that it is > > > > forbugreportingin the description they should be fine with it. > > > > > If the user doesn't choose to install it then I see that as an issue > > > > because I won't know about the error, but yes then you are not > > > > dependent on the internet permission in your standalone app. > > > > > Broadcast events would work to make it usable with several apps but > > > > I'm not sure how much information you can stuff into a broadcast... > > > > For example I would at least want a full stack
Re: [android-developers] Re: Error with custom made popup marker
On Thu, Feb 25, 2010 at 6:13 PM, eyedol wrote: > Still throws that same exception. Which is what? What's the full stack trace? Have you tried using your debugger and stepping through the code in question to see what's null at that point? - TreKing - Chicago transit tracking app for Android-powered devices http://sites.google.com/site/rezmobileapps/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 more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Android, send me logs! - code library for detecting force-close and sending logs
I love this idea! I'd like to build it into the source itself, that would be a life saver.. lol -- 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
[android-developers] Re: making videogame - newbie need help =P
Yes, use a SurfaceView!!! At the beginning I also made the mistake using ImageViews. Use a SurfaceView!! Learn this: http://www.droidnova.com/playing-with-graphics-in-android-part-i,147.html Greetings, Martin On 26 Feb., 00:58, Jason Arora wrote: > I agree 100% with Robert. For a real-time video game, you want to stay > away from High-level GUI components. > > Kofa, it sounds like you are making good progress. Are you using a > SurfaceView to draw the world and cities onto yet? > > I recommend that you do not work on the Game Menu yet. In my opinion, > the menu is secondary and gameplay is the most important aspect of > developing games. Additionally, a menu can slow down the iterative > development-testing process (unless you programmatically skip the > menu, you will have to click through the menu EVERY time you test your > game - which will be often). > > On Feb 25, 9:11 am, Robert Green wrote: > > > > > Vlad and Kofa, > > > I have to say again that all of that high level stuff (layouts and > > imageviews) is totally inappropriate for a real-time game. Consider > > loading all graphics into bitmaps, running a logic thread and drawing > > to a SurfaceView. You will have far superior performance and can do > > anything you want (so you won't be limited by some missing feature in > > imageview). > > > On Feb 25, 5:51 am, Vladimir wrote: > > > > > ImageView[] var1 = new ImageView[4]; > > > > var1[0].SetId(100); > > > > Wouldn't work with any non-primitive type. You only get an array of > > > handles, need to initialize each object explicitly: > > > ... > > > var1[0] = new ImageView(...) > > > var1[0].setId(100); > > > ... > > > > With regards to the 1st question, you can create an instance of > > > RelativeLayout.LayoutParams and use methods such as addRule(...), then > > > specify it when you attach a view to its parent (addView(view, params) > > > if I remember correctly). I still recommend that you think again about > > > using XML for most of your layouts. As the UI gets more complicated, > > > your code will become a mess. XML layouts in Android are very > > > flexible, it takes a while to learn the tricks, but it's worth it. > > > You'll waste more time looking for workarounds if you choose to ignore > > > XML. > > > > On Feb 24, 10:09 pm, Kofa wrote: > > > > > First of all, sorry for the delay to reply...=P > > > > I have just read your message... i have started already and I have > > > > developed much I think =) > > > > I will tell you what I have, I will focus on the "engine"(GUI): > > > > a main menu with buttons, one with START GAME goes to another > > > > activity, there another button to start the game itself, the "engine": > > > > a new activity is called, it loads almost everything from the 2 > > > > layouts from code, not XML, i think it's more flexible. > > > > FIRST LAYOUT: a imageview with a huge picture on it it has a - > > > > onTouchEvent- that makes the scroll works... > > > > loads too some imageviews(citys) in the same layout as the map, so > > > > those images move with the scroll. > > > > The other layout, the main layout, has a imageview and a > > > > button.and here comes the 2 problems that appeared =P: > > > > -How can I arrange views in a RelativeLayout, but on code, not XML. > > > > -and I can't think out how to create an array of ImageViews. > > > > > I tried something like this but didn't work, for example to set an ID: > > > > > ImageView[] var1 = new ImageView[4]; > > > > > var1[0].SetId(100); > > > > > AND SORRY FOR MY ENGLISH =P -- 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
[android-developers] Re: Error with custom made popup marker
Still throws that same exception. On Feb 25, 6:34 pm, TreKing wrote: > On Thu, Feb 25, 2010 at 11:27 AM, eyedol wrote: > > The issue is, I haven't extended the Activity class. > > My class extends another class. > > Well, I'm assuming you're using MapActivity at some point since you > mentioned popup markers. So you have that Activity. Find some way to pass a > reference to that activity to your click listener (perhaps by passing it to > your class that has the click listener). > > --- > -- > TreKing - Chicago transit tracking app for Android-powered > deviceshttp://sites.google.com/site/rezmobileapps/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 more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] HTML5 applicationCache.update()
the HTML5 applicationCache in the 2.x browser is working well except for one problem: when you force a cache update in JavaScript (window.applicationCache.update()) then it doesn't go out to the web to check the manifest it just throws the "checking" and then the "noupdate" events. I imagine that eventually it actually checks the manifest online, but the update() is supposed to force it. any ideas on how to force an update or how old the manifest needs to be before it checks the web again? -- 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
[android-developers] Re: making videogame - newbie need help =P
I agree 100% with Robert. For a real-time video game, you want to stay away from High-level GUI components. Kofa, it sounds like you are making good progress. Are you using a SurfaceView to draw the world and cities onto yet? I recommend that you do not work on the Game Menu yet. In my opinion, the menu is secondary and gameplay is the most important aspect of developing games. Additionally, a menu can slow down the iterative development-testing process (unless you programmatically skip the menu, you will have to click through the menu EVERY time you test your game - which will be often). On Feb 25, 9:11 am, Robert Green wrote: > Vlad and Kofa, > > I have to say again that all of that high level stuff (layouts and > imageviews) is totally inappropriate for a real-time game. Consider > loading all graphics into bitmaps, running a logic thread and drawing > to a SurfaceView. You will have far superior performance and can do > anything you want (so you won't be limited by some missing feature in > imageview). > > On Feb 25, 5:51 am, Vladimir wrote: > > > > ImageView[] var1 = new ImageView[4]; > > > var1[0].SetId(100); > > > Wouldn't work with any non-primitive type. You only get an array of > > handles, need to initialize each object explicitly: > > ... > > var1[0] = new ImageView(...) > > var1[0].setId(100); > > ... > > > With regards to the 1st question, you can create an instance of > > RelativeLayout.LayoutParams and use methods such as addRule(...), then > > specify it when you attach a view to its parent (addView(view, params) > > if I remember correctly). I still recommend that you think again about > > using XML for most of your layouts. As the UI gets more complicated, > > your code will become a mess. XML layouts in Android are very > > flexible, it takes a while to learn the tricks, but it's worth it. > > You'll waste more time looking for workarounds if you choose to ignore > > XML. > > > On Feb 24, 10:09 pm, Kofa wrote: > > > > First of all, sorry for the delay to reply...=P > > > I have just read your message... i have started already and I have > > > developed much I think =) > > > I will tell you what I have, I will focus on the "engine"(GUI): > > > a main menu with buttons, one with START GAME goes to another > > > activity, there another button to start the game itself, the "engine": > > > a new activity is called, it loads almost everything from the 2 > > > layouts from code, not XML, i think it's more flexible. > > > FIRST LAYOUT: a imageview with a huge picture on it it has a - > > > onTouchEvent- that makes the scroll works... > > > loads too some imageviews(citys) in the same layout as the map, so > > > those images move with the scroll. > > > The other layout, the main layout, has a imageview and a > > > button.and here comes the 2 problems that appeared =P: > > > -How can I arrange views in a RelativeLayout, but on code, not XML. > > > -and I can't think out how to create an array of ImageViews. > > > > I tried something like this but didn't work, for example to set an ID: > > > > ImageView[] var1 = new ImageView[4]; > > > > var1[0].SetId(100); > > > > AND SORRY FOR MY ENGLISH =P > > -- 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
[android-developers] Re: Crash in glDrawElements() using VBOs just after glBufferData()
Viktor, Would you be willing to show a bit of your DynamicBuffer code so I can see what it's doing? It's hard for me to help when there's a black box in the middle. On Feb 25, 1:41 pm, Viktor Linder wrote: > To clarify, in the original example, no buffer is allocated. The call > to "DynamicBuffer.allocate()" simply moves a position in a previously > allocated buffer which is filled each frame - ie. an "arena > allocator". DynamicBuffer.deallocate_last(size) simply moves the > position back without destroying any memory. > > So it is not a gc issue. Also, while the buffer might get filled with > "junk" it will still be valid floats of some sort, since the array is > only written to from java. > > Best regards, > Viktor Linder > > On 25 Feb, 20:08, Robert Green wrote: > > > > > Actually, let me clear something technical up. I just realized that > > the OpenGL native side is using GetPrimitiveArrayCritical and not > > GetDirectBufferAddress. I'm not sure why they decided to take that > > route but I'm sure there was a good reason for it. The fact of the > > matter is that while GPAC doesn't guarantee the actual array address > > (it has the option to make a copy), it's most likely that it won't > > make a copy and will instead hand over the actual array address. This > > of course depends on the VM's implementation. The could have easily > > implemented it to always use the actual address. Someone from that > > camp would have to comment because I'm not going to dig through > > Dalvik's source :) > > > Read more about it > > here:http://java.sun.com/j2se/1.3/docs/guide/jni/jni-12.html#GetPrimitiveA... > > > That being said - all of what I talked about still stands. It's just > > a different JNI function to get to it. > > > On Feb 25, 12:39 pm, Robert Green wrote: > > > > Let me explain something. Using directly allocated NIO buffers is a > > > DIRECT LINK between Java and native. The pointer you get from (void > > > *)GetDirectBufferAddress points to the exact memory that the Java > > > buffer is using. The memory is not managed in Java on the heap like > > > everything else. This is one of the few cases where you can write to > > > natively accessible code that does not need to be copied to work on > > > like an array does. > > > > It's not a copy. It's the original buffer data that the native side > > > sees. That memory will be freed when the Buffer's java object is GCed > > > (from no more references.) It's safe to use that address so long as > > > you're still holding on to a reference to the Buffer (in Java, not > > > native. That native pointer is only as good as the java > > > counterpart). In the context of OpenGL, the memory is needed during > > > the GL bufferdata or GL array call and most likely during the draw > > > call (As that normally needs to read from system memory, particularly > > > with arrays) but I don't know if it needs it all the way to the end of > > > the flush. One would have to ask why you'd be allocating/deallocating > > > memory in a real time simulation, though :) Preallocation throughout > > > the sim would be the ideal solution and that wouldn't have issues with > > > invalidating memory before it's done being used. > > > > Like Bob said, don't be creating new buffers all the time. In a > > > dynamic system (where you don't know how many triangles you'll be > > > drawing until visibility checks are done), make one the biggest buffer > > > it ever needs to be and use however much of it you need to use for > > > that draw. Most systems are relatively static, though, so all you > > > need to do is preallocate for each unique 3d object and use transforms > > > to do the dirty work. > > > > I have a dynamic system for animations so I end up recalcing vertex > > > positions, but that's a fixed size buffer so I never need to > > > reallocate. I just process it in native code and it really works > > > great. > > > > On Feb 25, 11:30 am, Bob Kerns wrote: > > > > > This would be a bug in the JNI code, which is responsible for > > > > protecting from the GC any and all memory which it is using. Only it > > > > can do so, because only it knows when it is done. > > > > > That's unlikely, though. The the JNI API makes it impossible to get > > > > your JNI code to get its hands on the data without protecting it from > > > > the GC -- and even then, you may only get a copy, if the system feels > > > > like doing that instead. Bugs ARE still possible -- you can free it an > > > > then hang onto the data you no longer have rights to. > > > > > But really, the only impact of holding onto a buffer on the Java side, > > > > only to discard it next frame, is to make the GC work harder. If you > > > > were to REUSE that buffer, however, you'd avoiding extra GC work. > > > > > On Feb 25, 12:45 am, Twisted Ware wrote: > > > > > > Robert has a very good point, but I also think you can expect the GL > > > > > implementation to allow the buffers to get garbage collected b
[android-developers] Re: AudioTrack.getPlaybackHeadPosi tion() is buggy????
thanks, though therein i didnt find anything about getPlaybackHeadPosition() i just cannot believe that a simple function like getPlaybackHeadPosition() can go wrong. anyone has getPlaybackHeadPosition() work with pause()? On Feb 25, 12:38 am, blindfold wrote: > See the earlier > threadhttp://groups.google.com/group/android-developers/browse_frm/thread/5... > > I did not get useful results from trying to get the current playing > position and gave up on it. I do not know if Android 2.1 is any better > here. > > On Feb 25, 1:12 am, HeHe wrote: > > > folks, > > > does anybody use AudioTrack.getPlaybackHeadPosition()? > > i found that, if i call AudioTrack.pause() in the middle of playing > > audio frames, at end of playback getPlaybackHeadPosition() always > > returns hundreds of frames less than the number of frames fed into > > the > > AudioTrack object . > > > did anybody also run into the same issue? > > > if you did, how did you work around this unexpected behavior? > > > thank u~ -- 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
[android-developers] Re: Gridview loads in reverse on onConfigurationChanged
Hi, Streets Of Boston. I haven't thought about that, maybe because my GridView shows very few elements (like 10 or 20). Although seeing the getView method passing or not an instantiated view, I didn't realize that it was caching just the visible views. But how can we fix the sorting problem without doing a manual views caching? I've seen that the position parameters is informed in order, but I have no clue why the View instance doens't correspond to the correct position. Oh, just to make it clear, I'm programming on SDK version 2.1 but running on a 1.5 device. Thanks for the help Bolha On 24 fev, 17:40, Streets Of Boston wrote: > Thanks! > > But I think you will get serious performance issues on GridViews and > ListViews with many items. In your fix, you cache the View for each > possible item. This defeats the purpose of the 'convertView' parameter > which has a non-null value when the GridView re-uses a cached View. > The amount of Views cached by the GridView is no more than the amount > of (partially) visible items on the screen > (=ListView.getChildCount()), not the number of possible items > (=BaseAdapter.getCount()), which can be much larger. > > If you BaseApapter can have many items (more items than can be viewed > simultaneously on the screen), you'll likely to hit some serious > performance/memory/resource issues. > > On Feb 24, 1:12 pm,Bolha wrote: > > > > > Hello, guys. > > > I've had the same problem and solved it by saving the created views in > > an array inside the adapter. Check the chunks of code below: > > > public class ImageButtonCanalAdapter extends BaseAdapter { > > private Context contexto; > > private List list > > private View savedViews[]; > > > [...] > > > public View getView(int position, View convertView, ViewGroup > > parent) > > { > > if (convertView == null) { > > this.viewsBotoes[position] = new MyView > > (this.contexto); > > } > > > return this.viewsBotoes[position]; > > } > > > } > > > I hope it helps. > > > Best regards. > > >Bolha > > > On 20 jan, 00:35, Streets Of Boston wrote: > > > > The animation is not necessary to make it happen. It just makes it > > > really easy to actually see the issue :-) > > > > On Jan 19, 6:06 pm, Mike M wrote: > > > > > yeah, > > > > I get the same on Droid 2.0, Although I get it without having > > > > animation applied to the gridview... > > > > > I wish there was a uniform / sequential way that getView() was > > > > called... > > > > > On Jan 18, 5:29 pm, Streets Of Boston wrote: > > > > > > Hi Roman, > > > > > > It does happen. :-) > > > > > > I can reproduce it almost every time like this: > > > > > - Just create an activity with a Grid View with quite a few images (or > > > > > grid-items) and attach a grid-layout-animator to the grid-view. > > > > > Configure the grid-view-animator in such a way that you see how the > > > > > grid-view-items are laid-out. E.g. columns first, rows later. > > > > > - Create an (empty) sub-activity that can be launched from the one > > > > > having the grid-view. > > > > > > - Start your grid-view's activiy in portrait orientation. > > > > > - Start your sub-activity. > > > > > - Rotate your phone into landscape orientation. > > > > > - Press back to finish the sub-activity. > > > > > The grid-view's activity is shown again and... > > > > > > ... 9 out of 10 times, i see the grid-view being built up in reverse > > > > > mode (i'm running on 2.1, Nexus One). > > > > > > In my app, the 'getView()' method does not rely on the order in which > > > > > the 'getView()' is called at all. > > > > > > On Jan 18, 2:15 am, Romain Guy wrote: > > > > > > > I have never noticed such an issue. The only way I can think of that > > > > > > would cause this to happen would be if your adapter relies on the > > > > > > order of the getView() calls. Note there is absolutely no guarantee > > > > > > about the order in which getView() will be called (the position > > > > > > argument will not necessarily be sequential, incrementing or > > > > > > decrementing.) > > > > > > > On Sun, Jan 17, 2010 at 8:57 PM, Mike M > > > > > > wrote: > > > > > > > Streets of Boston, > > > > > > > > Thanks for the reply. I do have an animation on my GridView, but > > > > > > > I > > > > > > > took it off and still notice the problem. > > > > > > > > Any ideas? > > > > > > > > Thanks > > > > > > > > On Jan 17, 1:23 pm, Streets Of Boston > > > > > > > wrote: > > > > > > >> I've seen this too in my app. > > > > > > > >> If you add a layout-animation, that animates the grid-view > > > > > > >> children > > > > > > >> (i.e. the grid-items), you can clearly see this reverse order. > > > > > > > >> On Jan 17, 4:03 am, Mike M wrote: > > > > > > > >> > Hey everyone, > > > > > > > >> > I have a gridview of images that I load from the internet. > > > > > > >> > When the > > > > > > >> > phone rotates (or some o
[android-developers] Re: Dialog goes away on click of search button
Amit, How are you creating the dialog? Sometimes, when creating a dialog outside the overriden method "onCreateDialog" (from Activity class), the dialog can have strange behaviors (mainly because it sometimes the dialog instance is lacking a reference to its parent). Can you post a piece of your source code? Thanks Bolha On 25 fev, 16:53, A R wrote: > Hi, > > I have an activity which starts with a progress bar and I do not want > the progress bar to go away until the processing is done, I have set > the dialog to be setCancelable(false) so now user cannot cancel it > with back but there are several other situations which hides the > dialog for eg pressing 'search'. > > On clicking of 'search' button the search box and keyboard pops up, > back button hides it and shows my activity which is always in the > background but the dialog is gone. > > I can disable the search button but ideally I would want dialog to > come back when the activity comes in foreground again. Any ideas how > to do it? > > Regards, > Amit. -- 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: Piracy sucks, or does it?
Just wondering about the bomb idea: What if the user changes the date back a week from the bomb deadline? On Thu, Feb 25, 2010 at 2:41 PM, SoftwareForMe.com SoftwareForMe.com < softwareforme@gmail.com> wrote: > Hello, > > It's a double-edged sword, isn't it? > > Personally, we are happy that so many are interested in what we build. I > mean, we are geeks and take pleasure in the tools and in others getting use > out of them. > > However, we also lament the loss of revenue that is be caused by piracy. > > I personally agree that when there are hacked copies around, many people > will have the app who would never have paid in the first place. But I don't > think the number comes close to 100%. Sure, hackers will show the app to > their friends, but then they'll give them a copy, and somebody will upload > it to the torrent and file-share sites, and many more will download it. > > It would be best for developers if Google had a solid solution, but I don't > think it would be best for Android. The hack-ability of the platform surely > fuels some of the excitement people have around it (ease of rooting phones, > custom ROMs, etc.). > > We are near to releasing our solution. It is license-key based, and will > give any user a reasonable trial period before it stops functioning. > > @Yahel: that's great. I hadn't thought about the bomb idea. :-) > > > On Thu, Feb 25, 2010 at 2:00 AM, Hekki wrote: > >> Hi, >> >> I've been through the same questions for a desktop app that i've >> written 4 years ago. >> >> I believe that it's a good thing, a badge of honor as you put it :) >> >> The truth is, people who know how to hack, where to find the crack, >> and actually get your app this way when the price is so low, will just >> never, ever, in a million years spare the pennies >> They are not customers, they are not potential customers, they're just >> power-users that proves themselves this way. >> >> I came to the conclusion though that they are a great communication >> vector. They show your app to their friends and multiply the number of >> people who are aware you even exists. >> Among those people, some, less tech-savvy will simply buy your app. >> People that would have never even heard of your app in the first >> place. >> >> So you are not really loosing sales because they are non buyers >> anyway, and you get popularity :D >> >> A little simplistic but I could actually verify it with my app, I >> switched it to a give what you want(even nothing) model and saw a >> surge in both download and purchase :D >> >> Yahel >> Ps : One way some developper fight back, is by putting a modified >> version of their app on those sites themselves : Put a time-bomb : in >> 30 days -> "This version is pirated, your phone number was just sent >> via the internet to the police expect their arrival in a few >> minutes."). But don't actually get any private information from them, >> you'd be in trouble and they really are not worth it. >> >> -- >> 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 > -- 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: Piracy sucks, or does it?
Hello, It's a double-edged sword, isn't it? Personally, we are happy that so many are interested in what we build. I mean, we are geeks and take pleasure in the tools and in others getting use out of them. However, we also lament the loss of revenue that is be caused by piracy. I personally agree that when there are hacked copies around, many people will have the app who would never have paid in the first place. But I don't think the number comes close to 100%. Sure, hackers will show the app to their friends, but then they'll give them a copy, and somebody will upload it to the torrent and file-share sites, and many more will download it. It would be best for developers if Google had a solid solution, but I don't think it would be best for Android. The hack-ability of the platform surely fuels some of the excitement people have around it (ease of rooting phones, custom ROMs, etc.). We are near to releasing our solution. It is license-key based, and will give any user a reasonable trial period before it stops functioning. @Yahel: that's great. I hadn't thought about the bomb idea. :-) On Thu, Feb 25, 2010 at 2:00 AM, Hekki wrote: > Hi, > > I've been through the same questions for a desktop app that i've > written 4 years ago. > > I believe that it's a good thing, a badge of honor as you put it :) > > The truth is, people who know how to hack, where to find the crack, > and actually get your app this way when the price is so low, will just > never, ever, in a million years spare the pennies > They are not customers, they are not potential customers, they're just > power-users that proves themselves this way. > > I came to the conclusion though that they are a great communication > vector. They show your app to their friends and multiply the number of > people who are aware you even exists. > Among those people, some, less tech-savvy will simply buy your app. > People that would have never even heard of your app in the first > place. > > So you are not really loosing sales because they are non buyers > anyway, and you get popularity :D > > A little simplistic but I could actually verify it with my app, I > switched it to a give what you want(even nothing) model and saw a > surge in both download and purchase :D > > Yahel > Ps : One way some developper fight back, is by putting a modified > version of their app on those sites themselves : Put a time-bomb : in > 30 days -> "This version is pirated, your phone number was just sent > via the internet to the police expect their arrival in a few > minutes."). But don't actually get any private information from them, > you'd be in trouble and they really are not worth it. > > -- > 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: FormatDateTime
Mark (et. al. interested parties): Thank you for the example on reflection. I got it working and thought it might be prudent to share my results w/ the world so the completed code is below. For the record, this date value (as a string) is being retrieved from a SQLite database and the function formatDateTime() is used in a custom adapter for display of the date for each record in a ListView. This compiles in Eclipse using Android 1.5. This allows me to set a minimum sdk version of 2, while still utilizing this really nifty date display function. public class ResourcesList extends ListActivity { ... int sdk = new Integer(Build.VERSION.SDK).intValue(); private static final long dateMin = 6; private static final long dateMax = (8640 * 2); private static final int dateFlags = 0; ... public String formatDateTime(String dateTime) { if (dateTime == null) { return "Never"; } else { String finalDateTime; DateFormat df = new SimpleDateFormat("-MM-dd HH:mm:ss"); try { Date date = df.parse(dateTime); if (sdk < 3) { finalDateTime = df.format(date); } else { long when = date.getTime(); finalDateTime = DateUtils.getRelativeDateTimeString(this, (when + TimeZone.getDefault().getOffset(when)), dateMin, dateMax, dateFlags).toString(); } } catch (Exception e) { finalDateTime = "Unknown"; } return finalDateTime; } } ... } Thanks, Nick Owens VP, ThreeClix Office: (904) 429-7039 Mobile: (847) 565-9392 After Hours: (904) 540-5830 -Original Message- From: android-developers@googlegroups.com [mailto:android-develop...@googlegroups.com] On Behalf Of Mark Murphy Sent: Thursday, February 25, 2010 4:23 PM To: android-developers@googlegroups.com Subject: Re: [android-developers] Re: FormatDateTime Nick Owens wrote: > On another note, is it possible to provide a conditional instruction for > formatting date/time based on the user's Android package: > > if (package > 1.1) { > > //cooler date time format > > } else { > > //regular date time format > > } Yes, either via reflection or via conditional class loading. > Let me guess? It is technically possible, but not in Eclipse since Eclipse > won't even let it compile w/ a function that doesn't compile. No, it should work fine. However, you need to compile for the higher version. > Or can I > build it for Android 1.2 but allow users of 1.1 to download it by specifying > a different min-SDK level than it is built for? Dunno. What's Android 1.2? :-) > If so, can I write a > conditional instruction based on the device's SDK level? Yes, either via reflection or via conditional class loading. This was discussed here: http://stackoverflow.com/questions/2312321/how-to-use-contacts-api-for-andro id-1-x-and-2-x-simultaneously and here: http://stackoverflow.com/questions/2044985/android-contactscontract-and-buil ding-across-multiple-sdk-versions Some sample projects are here: http://github.com/commonsguy/cw-advandroid/tree/master/Contacts/Pick/ http://github.com/commonsguy/cw-advandroid/tree/master/Contacts/Spinners/ First one uses reflection, second one uses conditional class loading. Here are two more samples: http://github.com/commonsguy/cw-android/tree/master/APIVersions/ -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, One Low Price! -- 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 unsubsc
[android-developers] Re: Free Version of App
If you want to handle the case where the app has been uninstalled and reinstallled, I think your best bet is to store activation data off- device via the network. A fairly secure way of doing this is to create a Certificate Request to your server, including your device ID in the DN, and send back a signed X509 certificate with a suitable expiration date. A side benefit is that this certificate can be used to secure bidirectional communications between your server and the phone. If you include a nonce in your protocol, you're secure against man-in-the-middle and replay attacks. You're never really secure against someone getting their hands on the phone, rooting it, disabling signature checks somehow, and changing the behavior of your app. Don't store nuclear secrets on your phone, please. On Feb 25, 11:58 am, Streets Of Boston wrote: > How do you make a time limited trial version, where limiting the time > is fairly fool-proof? How do you know how long the user has your app > installed (including the possibility that the app has been uninstalled > one or more times...)? > > Thanks! > On Feb 25, 2:34 am, String wrote: > > > > > On Feb 25, 4:00 am, Carmen Delessio wrote: > > > > It seems like it should be possible to have 2 apps signed with same > > > certificate. > > > See the info below. If your paid app exposed functionality to your free > > > app > > > you would get the free/paid goal. > > > The free app would check whether paid app was installed, if it was it > > > would > > > be used. If not an upgrade message would be displayed. > > > This is exactly what I do with one of my apps, TerraTime. I call the > > paid app the "license", and it has essentially no functionality of its > > own; it just needs to be present for the full functionality of the > > free app to be unlocked. I have a slightly different marketing > > strategy - my free app has the full feature set, but is just time- > > limited to a trial period. It's that time limit which the license > > unlocks. But the same approach should work for a freemium model like > > yours. > > > The major advantage to this is a single code base. From this > > perspective, it works well. > > > There are a number of small drawbacks that I've found, however. > > Primarily, it causes some confusion for the user... The free app is > > named "TerraTime Trial", but it needs to stay installed when the user > > upgrades. I mostly get around this with clear instructions in all the > > relevant places. This may be less applicable with your strategy; just > > make sure you don't name the free version "Lite" or some such. And > > make VERY clear in the app description that it's a freemium model, or > > you'll get complaints. > > > Overall, it'd be better if the Market supported in-app purchases (like > > certain other App Stores do). But there are so many other, more > > serious problems with the market that this feature is probably - > > hopefully - pretty far down the priority list. > > > A completely different possibility might be to organize your code into > > a single JAR file which you can then include in both application > > packages. While this would let you maintain only a single version of > > your Java source, it wouldn't help you with other code (manifests, > > resources, etc). Also, I've personally never got it to work, but I > > think that's more to do with unfamiliarity with Eclipse & Java outside > > of the usual Android development track. > > > String -- 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
[android-developers] Re: Free Version of App
The reason I'm leaning toward using a provider is because it simplifies dealing with different versions of the "from" application. Not perfectly, of course, and there's other ways to accomplish the same thing. Since these are essentially the same app, a little intimate knowledge of the inner workings and version history isn't such a bad thing. Actually, come to think of it, it has to be there anyway for upgrades! OK, you've convinced me. I'll copy the data over directly, and then I'll upgrade it. But using a provider is also a step toward a shared service model. Which is another thing the platform doesn't support well. Anything that forces users to install two things to buy one app is UnGood in my book. A workaround is to include the service in every app, and negotiate which app actually supplies it at runtime. But that's costly -- and a gaping security hole if you don't control all the relevant apps. While Google could do all this on install and save us a lot of grief, I think the model I'd like best would be that the platform stays like it is -- but that the unique ID in the marketplace is augmented, to be package+appAlternative, where you can have some reasonable small number of appAlternatives. So you wouldn't be able to switch from free to paid, say -- but you'd be able to have two apps with the same package but different appAlternative's in the manifest. These would be regarded by the marketplace as different apps, but would replace each other on download as they do now. On Feb 25, 10:39 am, jarkman wrote: > Bob - you should be able to make Pro version look into the Lite's > preferences at upgrade time, so you can copy in the settings without > using a provider. Incidentally, if you do use a provider it needs to > have a different name in the Lite & Pro versions - that's one of the > things our Ant script changes in the manifest. > > Take a look at Context.createPackageContext(), > here:http://groups.google.com/group/android-developers/browse_thread/threa... > -- 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] Android Database
Julian wrote: > I am trying to create an application that reads information from a > database on a separate server(not the android phone). Does anyone > have any information on how to create a database connector class? Write a Web service that connects to the database and runs on some server, then access the Web service from the phone. I recommend REST-style APIs, since Android does not have built-in support for SOAP or XML-RPC. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, One Low Price! -- 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: database update
Dan wrote: > thanks, so the onCreate gets called when the database has not been > created and the onupgrade gets called when the database has been > created, but the app is being upgraded? Yes on the first. More accurately for the second, onUpgrade() will be called when the schema revision (parameter in the SQLiteOpenHelper constructor) changes. > Do these methods get called > due to some global variable that gets reset upon a fresh or upgraded > install of the app? No, they get called when you ask your SQLiteOpenHelper subclass to getWriteableDatabase(), for example. The determination of whether an upgrade is needed is based on some metadata tucked away in some corner of the database. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, One Low Price! -- 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: FormatDateTime
Nick Owens wrote: > On another note, is it possible to provide a conditional instruction for > formatting date/time based on the user's Android package: > > if (package > 1.1) { > > //cooler date time format > > } else { > > //regular date time format > > } Yes, either via reflection or via conditional class loading. > Let me guess? It is technically possible, but not in Eclipse since Eclipse > won't even let it compile w/ a function that doesn't compile. No, it should work fine. However, you need to compile for the higher version. > Or can I > build it for Android 1.2 but allow users of 1.1 to download it by specifying > a different min-SDK level than it is built for? Dunno. What's Android 1.2? :-) > If so, can I write a > conditional instruction based on the device's SDK level? Yes, either via reflection or via conditional class loading. This was discussed here: http://stackoverflow.com/questions/2312321/how-to-use-contacts-api-for-android-1-x-and-2-x-simultaneously and here: http://stackoverflow.com/questions/2044985/android-contactscontract-and-building-across-multiple-sdk-versions Some sample projects are here: http://github.com/commonsguy/cw-advandroid/tree/master/Contacts/Pick/ http://github.com/commonsguy/cw-advandroid/tree/master/Contacts/Spinners/ First one uses reflection, second one uses conditional class loading. Here are two more samples: http://github.com/commonsguy/cw-android/tree/master/APIVersions/ -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, One Low Price! -- 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
[android-developers] Re: WiFi roaming and handoff
I assume your dev phones are running wpa_supplicant? If so, try the website and mailinglist of wpa_supplicant as well. http://hostap.epitest.fi/wpa_supplicant/ Good luck, Aäron On 25 feb, 18:26, BenYL wrote: > We are setting up a WiFi VoIP network in the office, but are having > trouble getting smooth roaming with Android phones (dev 2). They seems > to wait until the signal is very weak before negotiating a hand-off. > The iPod Touch handles this process much more smoothly. Can we tweak > roaming performance with calls to the Android OS? > > Ben -- 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: FormatDateTime
Bob: You're probably right b/c I've been building for Android 1.1. In an effort to make a decision about this feature, I did some searching for statistics on installed API levels but couldn't find them. On another note, is it possible to provide a conditional instruction for formatting date/time based on the user's Android package: if (package > 1.1) { //cooler date time format } else { //regular date time format } Let me guess? It is technically possible, but not in Eclipse since Eclipse won't even let it compile w/ a function that doesn't compile. Or can I build it for Android 1.2 but allow users of 1.1 to download it by specifying a different min-SDK level than it is built for? If so, can I write a conditional instruction based on the device's SDK level? Thanks, Nick Owens VP, ThreeClix Office: (904) 429-7039 Mobile: (847) 565-9392 After Hours: (904) 540-5830 -Original Message- From: android-developers@googlegroups.com [mailto:android-develop...@googlegroups.com] On Behalf Of Bob Kerns Sent: Wednesday, February 24, 2010 4:51 PM To: Android Developers Subject: [android-developers] Re: FormatDateTime I really doubt that Eclipse is wrong here. First, a couple quick-and- basic steps. If you hold the mouse over each variable, it will tell you the type. Finally, if you click on the 'this' the code, and type control-T, you'll get a pop-up with showing the class hierarchy. The second from the type should read 'Context -- android.content' Now, finally: On the left where it shows the Package Explorer, click right on your project name (at the top level of the hierarchy). Choose Properties, and then choose Android in the property pane that comes up, to see the Android-related properties. It will give you a table of Android target names. My guess: You have selected Android 1.1 (API Level 2). The method in question, according to the nice Javadoc, was introduced in API level 3. Then Eclipse should let you build your code. Eclipse is telling you that the method isn't available in that version of the SDK. It compiles against that specific version of android.jar, based on that checkbox. So what does it mean to select a different version? It means your code will compile, but will only work on devices newer than Android 1.1. In the androidManifest.xml file, there are flags indicating what the minimum and intended SDK versions are. If you indicate it should work on API 2, they'll be able to install it, but get a NoSuchMethodError at runtime. There are very few devices running Android 1.1, but you'll have to decide what you want to do about that. Statistics are available. On Feb 24, 7:28 am, Mark Murphy wrote: > Nick Owens wrote: > > The error in the screenshot (emailed separately), shows: > > > "The method getRelativeDateTimeString(ResourcesList, long, long, long, int) > > is undefined for the type" > > > The declaration of my Activity is: > > > Public class ResourcesList extends ListActivity > > > I'm missing something stupid, right? > > Well, I'm not an Eclipse user. What you have should be fine, and I don't > know why it is coming up with that complaint. > > My standard hammer for nails like this is Project > Force Clean, to see > if that clears matters up. > > But, I've taught enough people who use Eclipse to see that Eclipse is > more frequently wrong about what's in the SDK than are the SDK docs. So, > if you get errors like this, check the docs first. > > And, this is one of the umpteen reasons why I don't use Eclipse. > > (saying that in part to see if Eric Cloninger is watching this thread, > to perhaps goad him into providing other solutions for dealing with > Eclipse tossing up errors on what, on the surface, looks like perfectly > good code) > > -- > Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy > > _Beginning Android_ from Apress Now Available! -- 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
[android-developers] Re: database update
thanks, so the onCreate gets called when the database has not been created and the onupgrade gets called when the database has been created, but the app is being upgraded? Do these methods get called due to some global variable that gets reset upon a fresh or upgraded install of the app? On Feb 25, 9:44 am, Mark Murphy wrote: > Dan wrote: > > I've got a question about updating an app after release. If I have a > > database that contains 10 columns and I add a feature that requires an > > 11th column after the app has been released, where would I put the sql > > code to add the new column so that when they install the app it keeps > > their current data, but adds that 11th column? > > In onUpgrade() of your SQLiteOpenHelper subclass. > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://twitter.com/commonsguy > > Warescription: Three Android Books, Plus Updates, One Low Price! -- 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
[android-developers] Android Database
I am trying to create an application that reads information from a database on a separate server(not the android phone). Does anyone have any information on how to create a database connector class? -- 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] Android, send me logs! - code library for detecting force-close and sending logs
On 02/25/2010 12:10 PM, focuser wrote: Hi fellow Android developers, How many times have you asked users to send you the logcat result to track down a nasty force-close? How many users have actually replied? It's not that users are lazy or busy. Having to run the "logcat" command or download an external log collector app just means too much trouble for them. It should be much simpler. It should be just one tap. In fact I'm surprised (or being ignorant) that an easier error reporting mechanism has not existed yet in the Android API, especially for the infamous force-close. That is why I coded and open-sourced "Android, send me logs!", a small code library that makes it easy to detect force-close and send logs from within your own apps. You can program it to report errors with just one tap, and also include your own tracing information. Please check it out at http://code.google.com/p/android-send-me-logs/. It's still in very early stage, and I would appreciate your critism, suggestions, comments, or even code contributions. Apple's approach is even better, IMO. Crashes are uploaded back to Apple, and developers can see them on their portal. This showed up a little while ago, and it is *very* useful. Mike -- 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
[android-developers] Re: How can I get the seconds since 1.1.1970 as a long in Android?
Woow, thank you :-) Greetings, Martin On 25 Feb., 21:00, Streets Of Boston wrote: > System.currentTimeMillis() gets you the number of milliseconds sinc > 1/1/1970 00:00:00.000 UTC. > > On Feb 25, 1:21 pm, Martin wrote: > > > > > Hi! > > > There are so many Date-classes (GregorianCalendar, Calendar, TimeZone, > > Date,.), I lost track. > > > How can I get the seconds now since 1.1.1970 as "long" in Android? > > > Greetings, Martin -- 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
[android-developers] Android, send me logs! - code library for detecting force-close and sending logs
Hi fellow Android developers, How many times have you asked users to send you the logcat result to track down a nasty force-close? How many users have actually replied? It's not that users are lazy or busy. Having to run the "logcat" command or download an external log collector app just means too much trouble for them. It should be much simpler. It should be just one tap. In fact I'm surprised (or being ignorant) that an easier error reporting mechanism has not existed yet in the Android API, especially for the infamous force-close. That is why I coded and open-sourced "Android, send me logs!", a small code library that makes it easy to detect force-close and send logs from within your own apps. You can program it to report errors with just one tap, and also include your own tracing information. Please check it out at http://code.google.com/p/android-send-me-logs/. It's still in very early stage, and I would appreciate your critism, suggestions, comments, or even code contributions. Linton Ye -- 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
[android-developers] Re: How can I get the seconds since 1.1.1970 as a long in Android?
System.currentTimeMillis() gets you the number of milliseconds sinc 1/1/1970 00:00:00.000 UTC. On Feb 25, 1:21 pm, Martin wrote: > Hi! > > There are so many Date-classes (GregorianCalendar, Calendar, TimeZone, > Date,.), I lost track. > > How can I get the seconds now since 1.1.1970 as "long" in Android? > > Greetings, Martin -- 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
[android-developers] Re: Free Version of App
How do you make a time limited trial version, where limiting the time is fairly fool-proof? How do you know how long the user has your app installed (including the possibility that the app has been uninstalled one or more times...)? Thanks! On Feb 25, 2:34 am, String wrote: > On Feb 25, 4:00 am, Carmen Delessio wrote: > > > It seems like it should be possible to have 2 apps signed with same > > certificate. > > See the info below. If your paid app exposed functionality to your free app > > you would get the free/paid goal. > > The free app would check whether paid app was installed, if it was it would > > be used. If not an upgrade message would be displayed. > > This is exactly what I do with one of my apps, TerraTime. I call the > paid app the "license", and it has essentially no functionality of its > own; it just needs to be present for the full functionality of the > free app to be unlocked. I have a slightly different marketing > strategy - my free app has the full feature set, but is just time- > limited to a trial period. It's that time limit which the license > unlocks. But the same approach should work for a freemium model like > yours. > > The major advantage to this is a single code base. From this > perspective, it works well. > > There are a number of small drawbacks that I've found, however. > Primarily, it causes some confusion for the user... The free app is > named "TerraTime Trial", but it needs to stay installed when the user > upgrades. I mostly get around this with clear instructions in all the > relevant places. This may be less applicable with your strategy; just > make sure you don't name the free version "Lite" or some such. And > make VERY clear in the app description that it's a freemium model, or > you'll get complaints. > > Overall, it'd be better if the Market supported in-app purchases (like > certain other App Stores do). But there are so many other, more > serious problems with the market that this feature is probably - > hopefully - pretty far down the priority list. > > A completely different possibility might be to organize your code into > a single JAR file which you can then include in both application > packages. While this would let you maintain only a single version of > your Java source, it wouldn't help you with other code (manifests, > resources, etc). Also, I've personally never got it to work, but I > think that's more to do with unfamiliarity with Eclipse & Java outside > of the usual Android development track. > > String -- 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
[android-developers] WiFi Driver error?
Hello to everybody, I'm testing an app that handles automatically a connection to WiFi using WiFi Manager on a Motorola Milestone (Android OS 2.0). I happens to me a lot of times to see this error: ERROR: - wpa_driver_tista_send - error sending Wext private IOCTL to STA driver (ioctl_cmd = 8000306, res = -1, errno = 95). Also, is there anyway to detect if the WiFiManager is scanning networks in order to not start a new scanning? May be this problem appears because on startScan is launched before anotherone ends. Thanks Ezequiel -- 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
[android-developers] Dialog goes away on click of search button
Hi, I have an activity which starts with a progress bar and I do not want the progress bar to go away until the processing is done, I have set the dialog to be setCancelable(false) so now user cannot cancel it with back but there are several other situations which hides the dialog for eg pressing 'search'. On clicking of 'search' button the search box and keyboard pops up, back button hides it and shows my activity which is always in the background but the dialog is gone. I can disable the search button but ideally I would want dialog to come back when the activity comes in foreground again. Any ideas how to do it? Regards, Amit. -- 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
[android-developers] Re: Crash in glDrawElements() using VBOs just after glBufferData()
To clarify, in the original example, no buffer is allocated. The call to "DynamicBuffer.allocate()" simply moves a position in a previously allocated buffer which is filled each frame - ie. an "arena allocator". DynamicBuffer.deallocate_last(size) simply moves the position back without destroying any memory. So it is not a gc issue. Also, while the buffer might get filled with "junk" it will still be valid floats of some sort, since the array is only written to from java. Best regards, Viktor Linder On 25 Feb, 20:08, Robert Green wrote: > Actually, let me clear something technical up. I just realized that > the OpenGL native side is using GetPrimitiveArrayCritical and not > GetDirectBufferAddress. I'm not sure why they decided to take that > route but I'm sure there was a good reason for it. The fact of the > matter is that while GPAC doesn't guarantee the actual array address > (it has the option to make a copy), it's most likely that it won't > make a copy and will instead hand over the actual array address. This > of course depends on the VM's implementation. The could have easily > implemented it to always use the actual address. Someone from that > camp would have to comment because I'm not going to dig through > Dalvik's source :) > > Read more about it > here:http://java.sun.com/j2se/1.3/docs/guide/jni/jni-12.html#GetPrimitiveA... > > That being said - all of what I talked about still stands. It's just > a different JNI function to get to it. > > On Feb 25, 12:39 pm, Robert Green wrote: > > > Let me explain something. Using directly allocated NIO buffers is a > > DIRECT LINK between Java and native. The pointer you get from (void > > *)GetDirectBufferAddress points to the exact memory that the Java > > buffer is using. The memory is not managed in Java on the heap like > > everything else. This is one of the few cases where you can write to > > natively accessible code that does not need to be copied to work on > > like an array does. > > > It's not a copy. It's the original buffer data that the native side > > sees. That memory will be freed when the Buffer's java object is GCed > > (from no more references.) It's safe to use that address so long as > > you're still holding on to a reference to the Buffer (in Java, not > > native. That native pointer is only as good as the java > > counterpart). In the context of OpenGL, the memory is needed during > > the GL bufferdata or GL array call and most likely during the draw > > call (As that normally needs to read from system memory, particularly > > with arrays) but I don't know if it needs it all the way to the end of > > the flush. One would have to ask why you'd be allocating/deallocating > > memory in a real time simulation, though :) Preallocation throughout > > the sim would be the ideal solution and that wouldn't have issues with > > invalidating memory before it's done being used. > > > Like Bob said, don't be creating new buffers all the time. In a > > dynamic system (where you don't know how many triangles you'll be > > drawing until visibility checks are done), make one the biggest buffer > > it ever needs to be and use however much of it you need to use for > > that draw. Most systems are relatively static, though, so all you > > need to do is preallocate for each unique 3d object and use transforms > > to do the dirty work. > > > I have a dynamic system for animations so I end up recalcing vertex > > positions, but that's a fixed size buffer so I never need to > > reallocate. I just process it in native code and it really works > > great. > > > On Feb 25, 11:30 am, Bob Kerns wrote: > > > > This would be a bug in the JNI code, which is responsible for > > > protecting from the GC any and all memory which it is using. Only it > > > can do so, because only it knows when it is done. > > > > That's unlikely, though. The the JNI API makes it impossible to get > > > your JNI code to get its hands on the data without protecting it from > > > the GC -- and even then, you may only get a copy, if the system feels > > > like doing that instead. Bugs ARE still possible -- you can free it an > > > then hang onto the data you no longer have rights to. > > > > But really, the only impact of holding onto a buffer on the Java side, > > > only to discard it next frame, is to make the GC work harder. If you > > > were to REUSE that buffer, however, you'd avoiding extra GC work. > > > > On Feb 25, 12:45 am, Twisted Ware wrote: > > > > > Robert has a very good point, but I also think you can expect the GL > > > > implementation to allow the buffers to get garbage collected before > > > > they have been used. > > > > > You allocate the buffer in a scope and then pass that buffer pointer > > > > into the GL system - and then toss the memory away. Unless you flush > > > > the GL queue, there is no guarantee the graphics system has done > > > > anything with the data you've passed. The point of the direct buffers > > > > is to prevent c
[android-developers] Re: Free Version of App
Bob - you should be able to make Pro version look into the Lite's preferences at upgrade time, so you can copy in the settings without using a provider. Incidentally, if you do use a provider it needs to have a different name in the Lite & Pro versions - that's one of the things our Ant script changes in the manifest. Take a look at Context.createPackageContext(), here: http://groups.google.com/group/android-developers/browse_thread/thread/9d95bdd4a1bf81f0/9926f03b990d31f7?lnk=gst&q=jarkman#9926f03b990d31f7 Richard On Feb 25, 5:05 pm, Bob Kerns wrote: > While the downloadable license approach sounds good on the face of it, > there are just too many loose ends for my tastes as it stands. We > already have a very limited channel for communicating with our > customers, and I don't want to waste those characters > > What I've done is create a master build script, which takes a project > name, tags it in Subversion, cleans and switches a build working copy > (or does a checkout if needed). > > I then do two exports from that working copy. I run an XSLT script on > the AndroidManifest.xml to handle the differences there, including > changing the package, removing the debuggable='true' flag, removing > ADMOB ID's, etc. Any differences, I handle programmatically. I don't > actually change the code packages, just the references in the manifest > and the manifest's package name. > > Any excess code I'm tentatively planning to remove via Proguard, but I > haven't gotten that far yet. > > In effect, I have three versions -- DEV, FREE, and PRO. DEV is > internal-only. > > I also maintain a change log page I show the users the first time they > run after they update. I'm thinking of generating this page content > from a filtered view of the Subversion log, but for now I'm manually > updating it. It hides any changes they've already seen, based on a > record in the Shared Settings. > > Which is where this all breaks down -- these settings aren't shared > between the different versions. > > Here's my plan for dealing with that: > > 1) Create a content provider for the settings for my app. > > 2) When launching the PRO version the first time, if it detects the > FREE versions, it will suck in the existing settings from the FREE > version. > > 3) When launching the FREE version, if it detects the PRO version, it > will not launch its service, and will take the user to an explanatory > page, with a link to the application management page in the system > settings. > > 3a) I plan to listen for PACKAGE_ADDED, and transfer the settings > there. That looks to me to be the most reliable place. > > 3b) I suppose I should monitor PACKAGE_REMOVED, and if the PRO version > is uninstalled, re-enable the FREE version. I should only need these > in the FREE version, so once a user upgrades there would be no need to > launch the app on each install/uninstall. > > 4) The DEV version will have a couple extra menu items to invoke these > operations manually for testing. > > (For what it's worth, I notice that com.android.voicedialler monitors > PACKAGE_ADDED and PACKAGE_RECEIVED, as do a few others with no other > obvious reason. I wonder if some of them are doing a similar trick?) > > This looks to me to be about the best I can do. Does anybody see any > problems I've missed? Have a better/simpler idea? > > It's really too bad the platform doesn't provide a way for one app to > supersede another, when signed with the same key. This could be > handled much more cleanly at install time. > > On Feb 24, 11:34 pm, String wrote: > > > On Feb 25, 4:00 am, Carmen Delessio wrote: > > > > It seems like it should be possible to have 2 apps signed with same > > > certificate. > > > See the info below. If your paid app exposed functionality to your free > > > app > > > you would get the free/paid goal. > > > The free app would check whether paid app was installed, if it was it > > > would > > > be used. If not an upgrade message would be displayed. > > > This is exactly what I do with one of my apps, TerraTime. I call the > > paid app the "license", and it has essentially no functionality of its > > own; it just needs to be present for the full functionality of the > > free app to be unlocked. I have a slightly different marketing > > strategy - my free app has the full feature set, but is just time- > > limited to a trial period. It's that time limit which the license > > unlocks. But the same approach should work for a freemium model like > > yours. > > > The major advantage to this is a single code base. From this > > perspective, it works well. > > > There are a number of small drawbacks that I've found, however. > > Primarily, it causes some confusion for the user... The free app is > > named "TerraTime Trial", but it needs to stay installed when the user > > upgrades. I mostly get around this with clear instructions in all the > > relevant places. This may be less applicable with your strategy; just > > make sure you don't name the free
[android-developers] Re: Crash in glDrawElements() using VBOs just after glBufferData()
Let me explain something. Using directly allocated NIO buffers is a DIRECT LINK between Java and native. The pointer you get from (void *)GetDirectBufferAddress points to the exact memory that the Java buffer is using. The memory is not managed in Java on the heap like everything else. This is one of the few cases where you can write to natively accessible code that does not need to be copied to work on like an array does. It's not a copy. It's the original buffer data that the native side sees. That memory will be freed when the Buffer's java object is GCed (from no more references.) It's safe to use that address so long as you're still holding on to a reference to the Buffer (in Java, not native. That native pointer is only as good as the java counterpart). In the context of OpenGL, the memory is needed during the GL bufferdata or GL array call and most likely during the draw call (As that normally needs to read from system memory, particularly with arrays) but I don't know if it needs it all the way to the end of the flush. One would have to ask why you'd be allocating/deallocating memory in a real time simulation, though :) Preallocation throughout the sim would be the ideal solution and that wouldn't have issues with invalidating memory before it's done being used. Like Bob said, don't be creating new buffers all the time. In a dynamic system (where you don't know how many triangles you'll be drawing until visibility checks are done), make one the biggest buffer it ever needs to be and use however much of it you need to use for that draw. Most systems are relatively static, though, so all you need to do is preallocate for each unique 3d object and use transforms to do the dirty work. I have a dynamic system for animations so I end up recalcing vertex positions, but that's a fixed size buffer so I never need to reallocate. I just process it in native code and it really works great. On Feb 25, 11:30 am, Bob Kerns wrote: > This would be a bug in the JNI code, which is responsible for > protecting from the GC any and all memory which it is using. Only it > can do so, because only it knows when it is done. > > That's unlikely, though. The the JNI API makes it impossible to get > your JNI code to get its hands on the data without protecting it from > the GC -- and even then, you may only get a copy, if the system feels > like doing that instead. Bugs ARE still possible -- you can free it an > then hang onto the data you no longer have rights to. > > But really, the only impact of holding onto a buffer on the Java side, > only to discard it next frame, is to make the GC work harder. If you > were to REUSE that buffer, however, you'd avoiding extra GC work. > > On Feb 25, 12:45 am, Twisted Ware wrote: > > > > > Robert has a very good point, but I also think you can expect the GL > > implementation to allow the buffers to get garbage collected before > > they have been used. > > > You allocate the buffer in a scope and then pass that buffer pointer > > into the GL system - and then toss the memory away. Unless you flush > > the GL queue, there is no guarantee the graphics system has done > > anything with the data you've passed. The point of the direct buffers > > is to prevent copying data around all the time during these calls, so > > the GL system could be using the memory directly much later than you > > expect. You should probably not deallocate the buffer until the next > > frame comes around, when you know the system is done with the data. > > > On Feb 24, 2:50 pm, Robert Green wrote: > > > > The OpenGL wrappers take the data pointer passed in by those sorts of > > > methods using native GetDirectBufferAddress of the corresponding type > > > (int or float) and pass that pointer into the native gl method. That > > > only works correctly if it's a direct buffer. > > > > I just checked android_opengl_GLES10.cpp and GLES11.cpp and found that > > > glTexImage2D and glBufferData use the same getPointer() method to get > > > to the data. That means that behavior should be the same. > > > Ultimately, the data comes from: > > > > *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass, > > > getBaseArrayID, buffer); > > > offset = _env->CallStaticIntMethod(nioAccessClass, > > > getBaseArrayOffsetID, buffer); > > > data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) > > > 0); > > > return (void *) ((char *) data + offset); > > > > then the gl method is called, then the pointer is released. > > > > Always use direct buffers when working with any aspect of OpenGL on > > > Android. > > > > On Feb 24, 4:01 am, Clankrieger wrote: > > > > > As what I am aware of, VBOs do not need direct buffers (and indirect > > > > buffers might be handled faster), but this is just a detail. I also > > > > tried GL_FIXED but it did not make much difference for me. I assume > > > > that it gives performance gains only if you have a) static data that > > > > is c
[android-developers] Is this properly using a runnable?
I am basing an audioplayer off an old tutorial, and I am seeing some major lag in my UI, which is making me think that the threading is not being handled properly. It is structured as such: public void startStreaming() throws IOException { final String mediaUrl = currentTrackData.get("play_url").toString(); Runnable r = new Runnable() { public void run() { try { downloadAudioIncrement(mediaUrl); } catch (IOException e) { Log.e(getClass().getName(), "Unable to initialize the MediaPlayer for fileUrl=" + mediaUrl, e); return; } } }; new Thread(r).start(); } public void downloadAudioIncrement(String mediaUrl) throws IOException { //do audio downloading and buffering in here in here //there is not threading logic in here at all } I've ommitted the specific downloading code for brevity. Does calling a function from a runnable mean that the logic will be run off the main UI thread? I can provide more specifics if need be. 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
[android-developers] How can I get the seconds since 1.1.1970 as a long in Android?
Hi! There are so many Date-classes (GregorianCalendar, Calendar, TimeZone, Date,.), I lost track. How can I get the seconds now since 1.1.1970 as "long" in Android? Greetings, Martin -- 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
[android-developers] Re: Crash in glDrawElements() using VBOs just after glBufferData()
Actually, let me clear something technical up. I just realized that the OpenGL native side is using GetPrimitiveArrayCritical and not GetDirectBufferAddress. I'm not sure why they decided to take that route but I'm sure there was a good reason for it. The fact of the matter is that while GPAC doesn't guarantee the actual array address (it has the option to make a copy), it's most likely that it won't make a copy and will instead hand over the actual array address. This of course depends on the VM's implementation. The could have easily implemented it to always use the actual address. Someone from that camp would have to comment because I'm not going to dig through Dalvik's source :) Read more about it here: http://java.sun.com/j2se/1.3/docs/guide/jni/jni-12.html#GetPrimitiveArrayCritical That being said - all of what I talked about still stands. It's just a different JNI function to get to it. On Feb 25, 12:39 pm, Robert Green wrote: > Let me explain something. Using directly allocated NIO buffers is a > DIRECT LINK between Java and native. The pointer you get from (void > *)GetDirectBufferAddress points to the exact memory that the Java > buffer is using. The memory is not managed in Java on the heap like > everything else. This is one of the few cases where you can write to > natively accessible code that does not need to be copied to work on > like an array does. > > It's not a copy. It's the original buffer data that the native side > sees. That memory will be freed when the Buffer's java object is GCed > (from no more references.) It's safe to use that address so long as > you're still holding on to a reference to the Buffer (in Java, not > native. That native pointer is only as good as the java > counterpart). In the context of OpenGL, the memory is needed during > the GL bufferdata or GL array call and most likely during the draw > call (As that normally needs to read from system memory, particularly > with arrays) but I don't know if it needs it all the way to the end of > the flush. One would have to ask why you'd be allocating/deallocating > memory in a real time simulation, though :) Preallocation throughout > the sim would be the ideal solution and that wouldn't have issues with > invalidating memory before it's done being used. > > Like Bob said, don't be creating new buffers all the time. In a > dynamic system (where you don't know how many triangles you'll be > drawing until visibility checks are done), make one the biggest buffer > it ever needs to be and use however much of it you need to use for > that draw. Most systems are relatively static, though, so all you > need to do is preallocate for each unique 3d object and use transforms > to do the dirty work. > > I have a dynamic system for animations so I end up recalcing vertex > positions, but that's a fixed size buffer so I never need to > reallocate. I just process it in native code and it really works > great. > > On Feb 25, 11:30 am, Bob Kerns wrote: > > > > > This would be a bug in the JNI code, which is responsible for > > protecting from the GC any and all memory which it is using. Only it > > can do so, because only it knows when it is done. > > > That's unlikely, though. The the JNI API makes it impossible to get > > your JNI code to get its hands on the data without protecting it from > > the GC -- and even then, you may only get a copy, if the system feels > > like doing that instead. Bugs ARE still possible -- you can free it an > > then hang onto the data you no longer have rights to. > > > But really, the only impact of holding onto a buffer on the Java side, > > only to discard it next frame, is to make the GC work harder. If you > > were to REUSE that buffer, however, you'd avoiding extra GC work. > > > On Feb 25, 12:45 am, Twisted Ware wrote: > > > > Robert has a very good point, but I also think you can expect the GL > > > implementation to allow the buffers to get garbage collected before > > > they have been used. > > > > You allocate the buffer in a scope and then pass that buffer pointer > > > into the GL system - and then toss the memory away. Unless you flush > > > the GL queue, there is no guarantee the graphics system has done > > > anything with the data you've passed. The point of the direct buffers > > > is to prevent copying data around all the time during these calls, so > > > the GL system could be using the memory directly much later than you > > > expect. You should probably not deallocate the buffer until the next > > > frame comes around, when you know the system is done with the data. > > > > On Feb 24, 2:50 pm, Robert Green wrote: > > > > > The OpenGL wrappers take the data pointer passed in by those sorts of > > > > methods using native GetDirectBufferAddress of the corresponding type > > > > (int or float) and pass that pointer into the native gl method. That > > > > only works correctly if it's a direct buffer. > > > > > I just checked android_opengl_GLES10.cpp and GL
Re: [android-developers] Re: Error with custom made popup marker
On Thu, Feb 25, 2010 at 11:27 AM, eyedol wrote: > The issue is, I haven't extended the Activity class. > My class extends another class. > Well, I'm assuming you're using MapActivity at some point since you mentioned popup markers. So you have that Activity. Find some way to pass a reference to that activity to your click listener (perhaps by passing it to your class that has the click listener). - TreKing - Chicago transit tracking app for Android-powered devices http://sites.google.com/site/rezmobileapps/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 more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: PlayDriver
Ok... I have found that my emulator runs Android 1.6 and my device runs Android 1.5. It seems that MediaPlayer on 1.5 cannot read audio stream whose size is increasing. On 25 fév, 17:56, Keufran wrote: > Hi Pierre, > > Maybe we are facing the same problem. > To me, it is due to the fact that you are tring to play a video or an > audio stream whose lentgh is inscreasing. > Is it the case? > > Weirdly, although I got this error in the logs, the emulator plays my > stream correctly. > However it does not work on my phone... > > On 23 fév, 11:54, Pierre Henry wrote: > > > Hi, > > > I'm playing with 'MediaPlayer' class and 'm encoutering a curious > > message in debug win: > > __ > > 02-23 11:34:06.288: ERROR/PlayerDriver(51): Invalid percentage value > > 82597 > > __ > > > The message is scrolling with increasing value of the percentage > > value. > > > The pid 51 is the /system/bin/mediaserver process. > > > Any idea? -- 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
[android-developers] vm out-of-memory problem
hello everyone, i'm writing a game. i want to use a large bitmap to cache the game map, because the map doesn't change during the game play. the game map is tile based, but i want to draw it at the beginning of the game, so i can easy scroll the map. problem is, the bitmap can be very large, for example 1512*1512 in size. and i have the vm out-of-memory problem. i'm wondering if there is a way to adjust the memory size of the vm. and if it is safe to do so, cause i have no idea the memory size of a common android phone. otherwise i will think of some other way, like only draw a portion of the map. but will that be slow? is loading file on android the same as loading from memory? -- 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] Disable Home Key?
On Thu, Feb 25, 2010 at 1:39 AM, DroidBy wrote: I am doing a security Lock system for my project. I am interested to > know how to disable the HOME key or handle it at framework layer, in > order to prevent user to by pass the security lock by presing HOME. I > know that I am not able to do it at android application layer, so > thinking to get some tips in handling it in framework layer. Have you taken a look at the existing projects out there? MyLock seems to achieve this using a lock mediator, to intercept a forbidden action and react to it: http://www.google.com/codesearch/p?hl=en#zvQ8rp58BUs/trunk/myLock/src/i4nc4mp/myLock/LiteLockMediator.java&q=home%20key%20package:http://mylockforandroid%5C.googlecode%5C.com&sa=N&cd=1&ct=rc Can't say I've tried anything like this before though. -- 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
[android-developers] Re: ArrayAdapter use or misuse of the Adapter pattern
Agreed On Feb 25, 8:54 pm, TreKing wrote: > On Wed, Feb 24, 2010 at 10:28 PM, Conny wrote: > > In a generalist sense adapter pattern is a bridge between 2 classes > > that have some common functionality, but the interfaces are not > > reusable between them. Ideally the need for adapter arises when we > > have two classes that are not developed keeping in mind interaction > > between them. > > Right, and in this case, Android provides ArrayAdapter (and it's related > classes) that allow you to convert a generic list of user-defined objects > into a list of View objects, so the name seems appropriate. > > Strategy pattern, is more of a future reuse pattern, and that is the > > > intent its in android framework, reuse and extensibility. > > Well, all patterns are designed for "future reuse". Strategy, specifically, > defines a way to abstract out functionality or algorithms into components > that can be added, removed, or swapped in and out at runtime. > > - > TreKing - Chicago transit tracking app for Android-powered > deviceshttp://sites.google.com/site/rezmobileapps/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 more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Transmitting audio from the application to the uplink....is it possible?
Anyone? -- 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
[android-developers] Re: Transmitting audio from the application to the uplink....is it possible?
anyone? On Feb 23, 1:52 pm, Nosaj Ronnoc wrote: > I've been searching the API for a way to send a sound over the > audiouplinkduring a phone conversation. From what I see, there is no way > to do this. Am I missing something? -- 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] xulrunner
nestogledam wrote: > Is it possible to install xulrunner application on android? That would be a question for the Mozilla project, since xulrunner is their technology, not Android's. Android's native browser is based on WebKit, not Mozilla's Gecko, though I understand they are working porting their mobile browser to Android. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, One Low Price! -- 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 update
Alter http://www.techonthenet.com/sql/tables/alter_table.php Kevin On Feb 25, 2010 11:40 AM, "Dan" wrote: I've got a question about updating an app after release. If I have a database that contains 10 columns and I add a feature that requires an 11th column after the app has been released, where would I put the sql code to add the new column so that when they install the app it keeps their current data, but adds that 11th column? Is that even possible or would I need to create another table that references the first with a foreign key? -- 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
[android-developers] subscribe
subscribe -- Emilio Alvarez Rebollo Director Tècnic Pukka's Webs Design Alfons XII, 75 932012070 -- 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
[android-developers] Calendar in Android 1.6 doesn't work
Hello, I downloaded the source code of Android1.6 and try to compile. Then the Calendar is displayed in the phone but I can not launch it. Does anyone know why and how to fix? Thanks in advance, Nga -- 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
[android-developers] What replaced activityCreator ?
I have noticed several tutorials use the activityCreator script, for doing various different types of builds for android. But i can not find that script in the SDK it appears to have been deprecated sevaral versions ago. So my question is, what has replaced activityCreator ? -- 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
[android-developers] Chronometer as a persistent sto pwatch. ¿How to set starting time? ¿What is Chronometer “Base”?
Hi everyone! I do have one service running in the background. Whenever it starts I store in memory the starting time in milliseconds: startingTime = new Date().getTime(); I want to display a chronometer that starts counting when the service starts and never stops until the user presses a "Stop" button. I want to allow the user to leave the activity rendering the chronometer, do some stuff (browse webpages, use twitdroid, whatever) and then return. But the idea is that when the user returns I dont want the chronometer to go to 0:00 again. Insted I want it to show the exact time that has passed ever since the service has started. I can calculate elapsedTime every time the user return to the chronometer activity in the onStart method: elapsedTime = new Date().getTime() - startingTime; The thing is that i dont know how to tell the chronometer to start counting from that time and not from zero. I have seen the api example but I have not been able to get this behaviour. I think I have to do something with the setBase method, butsetting elapsedTime as the chronometer base does not work. Can someon explain what exactly "base" means or how to accomplish this? thanks a lot! 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
[android-developers] SweepGradient and Banding
Hello, I'm writing an android app to that among other things lets a user choose a color using a color wheel that is drawn using a SweepGradient shader. The shader is set up as follows: mColors = new int[] { Color.RED, Color.MAGENTA, Color.BLUE, Color.CYAN, Color.GREEN, Color.YELLOW, Color.RED }; Shader s = new SweepGradient(0, 0, mColors, null); I assign that shader to a Paint object which I then use inside of a onDraw callback in a custom view to an oval using the paint/shader object. Here's the problem... If I use that view inside of a Dialog and display the Dialog the oval displays great, all colors in the gradient seamlessly blend together. However, if I use that same view on its own the same SweepGradient looks banded especially between green->red, magenta->blue, blue- >cyan. This almost looks like some kind of dithering issue, but changing dither makes no difference. I'm at a loss as to what to try, I'm hoping someone has some clues on this. Oh and BTW, this same behavior happens in the emulator or running on my Motorola Droid. 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
[android-developers] Rotated map view - how to get the touches back to where they belong?
I am using the MapsDemo example for a mapping application where I rotate the map in direction of travel. This works well even without the canvas smoothing in the example. However, I haven't yet managed to adjust the dispatchTouchEvent code to counter the map rotation effect for the user touches (right now when the map is rotated 90 degrees a user's horizontal sweep will move the map vertically etc). The sample code only offers the teaser: public boolean dispatchTouchEvent(MotionEvent ev) { // TODO: rotate events too return super.dispatchTouchEvent(ev); } Any guidance would be appreciated. And while I am at it - Is it still possible to position the zoom controls separately, so that they do NOT rotate when the map rotates? I read that the getZoomControls() is deprecated. (Why ?) -- 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
[android-developers] Closing a particular tab in the Tabhost
Hi, Is there any way of closing a particular tab in the tabhost, there is a method to close all the tabs but there is nothing for closing a single tab. Any suggestions how to do this?. (I am running different instances of the same activity in each tab.) Thanks Jyothi Swaroop Dantu -- 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
[android-developers] Disable Home Key?
Hi, I am doing a security Lock system for my project. I am interested to know how to disable the HOME key or handle it at framework layer, in order to prevent user to by pass the security lock by presing HOME. I know that I am not able to do it at android application layer, so thinking to get some tips in handling it in framework layer. 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
[android-developers] Disabling browser intent
Hi, Web-page seen on browser with orange bars (due to intents), looks odd to me. Hence, I am looking at some css property which can suppress or hide intent. Is this really possible? Thanks, CS -- 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
[android-developers] Corrupted SQLite database
Hi, We develop since severals monthes a professional application that allows us to graphicaly design and generate an android application to collect data. This application allows to synchronize data between the android application and a remote server. The data are stored localy on a SQLite database. We used the SQLite android API to manipulate it. We experience a problem which is not reproducible on demand, sometime we got an SQLiteDatabaseCorruptException, and so android destroys this database and creates a new one which of course is empty. This error appears randomly in the code when we are dealing with the database. As sample the last one was : SQLiteStatement stat = db.compileStatement(); <- No error long date = 0; try { date = stat.simpleQueryForLong(); } catch (Exception e) { date = 0; } stat.close(); Cursor c = db.query(..); <- No error if(c.getCount()>0){ <- SQLiteDatabaseCorruptException thrown on the getCount() } _ 02-25 03:45:25.091 D/OpenSSLSessionImpl(22200): Freeing OpenSSL session 02-25 03:45:25.991 E/Database(22200): Removing corrupt database: /data/ data/fr.medes.medoo.android/databases/medoo 02-25 03:45:26.031 E/ fr.medes.medoo.android.synchronization.OptimizedSynchronizationService(22200): error during synchronization 02-25 03:45:26.031 E/ fr.medes.medoo.android.synchronization.OptimizedSynchronizationService(22200): android.database.sqlite.SQLiteDatabaseCorruptException: database disk image is malformed 02-25 03:45:26.031 E/ fr.medes.medoo.android.synchronization.OptimizedSynchronizationService(22200): at android.database.sqlite.SQLiteQuery.native_fill_window(Native Method) 02-25 03:45:26.031 E/ fr.medes.medoo.android.synchronization.OptimizedSynchronizationService(22200): at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java: 75) 02-25 03:45:26.031 E/ fr.medes.medoo.android.synchronization.OptimizedSynchronizationService(22200): at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java: 288) 02-25 03:45:26.031 E/ fr.medes.medoo.android.synchronization.OptimizedSynchronizationService(22200): at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java: 269) 02-25 03:45:26.031 E/ fr.medes.medoo.android.synchronization.OptimizedSynchronizationService(22200): at fr.medes.medoo.android.synchronization.OptimizedSynchronizationService.getDataToSynchronize(OptimizedSynchronizationService.java: 474) 02-25 03:45:26.031 E/ fr.medes.medoo.android.synchronization.OptimizedSynchronizationService(22200): at fr.medes.medoo.android.synchronization.OptimizedSynchronizationService.run(OptimizedSynchronizationService.java: 244) 02-25 03:45:26.031 E/ fr.medes.medoo.android.synchronization.OptimizedSynchronizationService(22200): at java.lang.Thread.run(Thread.java:1060) __ This code is part of the synchronization service and it has been executed correctly hundreds time before in the same process without problem. This code is embedded in a service and there is only one thread accessing the database at this time. Did somebody experience this kind of error ? Any help would be appreciate. 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
[android-developers] xulrunner
Is it possible to install xulrunner application on android? -- 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
[android-developers] Re: How to access the phone contacts in latest version of android 2.1
I'm also looking for a way to access the phone numbers in 2.1 version but the package "Contacts.People" that was used in older versions is deprecated. I'll let you know if i find anything thanks and regards, raja On Feb 23, 12:46 am, venkat ranjit wrote: > i think both are same in android 1.5 and android 2.1 , i am sending a sample > code that will helps u ok. > > Ragards, > Ranjit > > On Tue, Feb 23, 2010 at 11:44 AM, Manoj wrote: > > Hi guys, > > I need some help on the issue "How to access the phone > > contacts in latest version of android 2.1". I need need the code > > example for for accessing name and number of the contacts > > > Thanks in advance > > Manoj C > > > -- > > 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 > > > > AndroidHelper.java > 47KViewDownload -- 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
[android-developers] Re: Pause Within a loop
Exit the loop, remembering your index. Arrange to restart it at the appropriate time -- an Alarm, or a message posted by whatever code you were waiting to be done. You don't ever want to actually pause or sleep in the main thread. Your entire App will appear to freeze. On Feb 25, 12:33 am, CMF wrote: > I have a loop which draw a bitmap > for(int i=0;i<10;i++){ > //here I draw a bitmap which will move to right a little bit in > each loop > //I want a pause here so that an animation can be made > > > > } -- 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
[android-developers] Why does addHeaderView make a ListActivity forgetful of its position ?
We have an app with a ListActivity and an edit view. Tap on an item in the ListActivity, see the edit view of that item, hit the Back key, see the list view. All very ordinary stuff. But, in this app, the ListActivity does not retain its postion during that sequence. After hitting Back, the list is always scrolled to the very top. Experimenting on the Notepad sample reveals that adding a header view to the list causes the same problem there. With the header view, the list is always scrolled to the top after hitting Back on the note editor. Without the header view, the list retains its scroll position. Is that behaviour by design, or a consequence of something we are doing wrong ? I can't find any way to turn it off, but it doesn't seem to be obviously desirable. Thanks, Richard Oh - here's the amended Notepad OnCreate: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setDefaultKeyMode(DEFAULT_KEYS_SHORTCUT); // If no data was given in the intent (because we were started // as a MAIN activity), then use our default content provider. Intent intent = getIntent(); if (intent.getData() == null) { intent.setData(Notes.CONTENT_URI); } // Inform the list we provide context menus for items getListView().setOnCreateContextMenuListener(this); // Perform a managed query. The Activity will handle closing and requerying the cursor // when needed. Cursor cursor = managedQuery(getIntent().getData(), PROJECTION, null, null, Notes.DEFAULT_SORT_ORDER); // >>> // These two lines stop the list restoring its position correctly View newNoteView = LayoutInflater.from(this).inflate(R.layout.noteslist_item, null); getListView().addHeaderView( newNoteView ); // // Used to map notes entries from the database to views SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.noteslist_item, cursor, new String[] { Notes.TITLE }, new int[] { android.R.id.text1 }); setListAdapter(adapter); } -- 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
[android-developers] Re: Crash in glDrawElements() using VBOs just after glBufferData()
This would be a bug in the JNI code, which is responsible for protecting from the GC any and all memory which it is using. Only it can do so, because only it knows when it is done. That's unlikely, though. The the JNI API makes it impossible to get your JNI code to get its hands on the data without protecting it from the GC -- and even then, you may only get a copy, if the system feels like doing that instead. Bugs ARE still possible -- you can free it an then hang onto the data you no longer have rights to. But really, the only impact of holding onto a buffer on the Java side, only to discard it next frame, is to make the GC work harder. If you were to REUSE that buffer, however, you'd avoiding extra GC work. On Feb 25, 12:45 am, Twisted Ware wrote: > Robert has a very good point, but I also think you can expect the GL > implementation to allow the buffers to get garbage collected before > they have been used. > > You allocate the buffer in a scope and then pass that buffer pointer > into the GL system - and then toss the memory away. Unless you flush > the GL queue, there is no guarantee the graphics system has done > anything with the data you've passed. The point of the direct buffers > is to prevent copying data around all the time during these calls, so > the GL system could be using the memory directly much later than you > expect. You should probably not deallocate the buffer until the next > frame comes around, when you know the system is done with the data. > > On Feb 24, 2:50 pm, Robert Green wrote: > > > > > The OpenGL wrappers take the data pointer passed in by those sorts of > > methods using native GetDirectBufferAddress of the corresponding type > > (int or float) and pass that pointer into the native gl method. That > > only works correctly if it's a direct buffer. > > > I just checked android_opengl_GLES10.cpp and GLES11.cpp and found that > > glTexImage2D and glBufferData use the same getPointer() method to get > > to the data. That means that behavior should be the same. > > Ultimately, the data comes from: > > > *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass, > > getBaseArrayID, buffer); > > offset = _env->CallStaticIntMethod(nioAccessClass, > > getBaseArrayOffsetID, buffer); > > data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) > > 0); > > return (void *) ((char *) data + offset); > > > then the gl method is called, then the pointer is released. > > > Always use direct buffers when working with any aspect of OpenGL on > > Android. > > > On Feb 24, 4:01 am, Clankrieger wrote: > > > > As what I am aware of, VBOs do not need direct buffers (and indirect > > > buffers might be handled faster), but this is just a detail. I also > > > tried GL_FIXED but it did not make much difference for me. I assume > > > that it gives performance gains only if you have a) static data that > > > is converted to fixed format once and then re-rendered or b) do all > > > calculations with fixed number precision (which is making things a lot > > > more complicated and less readable when you need to update data). So I > > > switched back to Float because I hat to convert most values to fixed > > > before uploading them in GL calls. > > > > I wonder if your offsets are correct? Is _pos_size_bytes the correct > > > offset? For safety, I would stick to non-interleaved arrays for > > > testing. Also I'm not sure when to array-copying in the bufferdata > > > call takes place - have you tried a glFlush call or a buffer rebind > > > (bind VBO to 0 and the ID again) after all the buffering? Somebody > > > with knowledge about the native part of of this buffering could help > > > you better with this, I guess. > > > > T. > > > > On Feb 16, 8:43 pm, Viktor Linder wrote: > > > > > As you say, the most likely explanation is that I have a bad pointer > > > > being used somewhere. The thing is I have gone over this code a bunch > > > > of times and tried lots of different checks and I just can't find > > > > what's wrong. > > > > Do you have any pointers on ways to debug the crash in the GL library? > > > > > I forgot to mention: I bind the array buffer to 0 after the call to > > > > glDrawElements(), so any future draw calls that are not using VBOs > > > > will not break. Also, I am not using VBOs for all draw calls. > > > > > You keep a different VBO for each channel; is using a single VBO for > > > > several channels not allowed? > > > > > If its possible to use a single buffer that would reduce the needed > > > > calls to glBindBuffer() and allowed interleaved data which would > > > > improve cache locality. > > > > > Curious; did using GL_FIXED give a large performance gain? > > > > > Thanks for your help. > > > > > /Viktor > > > > On 16 Feb, 21:25, Robert Green wrote: > > > > > > You're probably pointing something to some bad memory location > > > > > somewhere. I know you didn't post all of your real code so I can't > > > > > really say for sure
Re: [android-developers] Re: How to do animation when click on a bitmap
In your case you are extending view however if you use built in views or even your view which holds just the image. then u can setanimation and startanimation TranslateAnimation animation = new TranslateAnimation( Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, -0.3f, Animation.RELATIVE_TO_PARENT, -0.15f ); animation.setDuration(2000); animation.setFillAfter(true); // animation.setZAdjustment(Animation.ZORDER_BOTTOM); //i2.setAnimation(animation); i2.startAnimation(animation); here i2 is an imageview Google it u will find lots of animation examples. Hope this helps On Thu, Feb 25, 2010 at 11:17 AM, CMF wrote: > Hi, do you have an explicit example? I don't know what are the > relationships between the BitmapAnimation View , the main class and > the Drawable class.. > > On Feb 25, 1:09 pm, Nithin wrote: > > Create a class "BitmapDrawable" which extends Drawable and pass the > > bitmap to the contructor. Then in draw() , draw the bitmap. Create the > > object of the "BitmapDrawable" class and add the object to the > > AnimationDrawable using addFrame()and set the duration in > > milliseconds(how much time you need to display the drawable). Then > > create a thread and call animationDrawable.start() > > > > Hope this helps... > > > > Nithin > > > > On Feb 25, 9:34 am,CMF wrote: > > > > > I have bitmap displayed on the top of the screen when the app is > > > started up. > > > When clicking on the bitmap, the image should move to the bottom of > > > the screen. > > > > > I have read the AnimateDrawables from ApiDemos, but the animation is > > > done on a Drawable Object. If it can use on bitmap, it will be great! > > > > > Here is my code > > > > > public class HelloAndroid extends Activity { > > >/** Called when the activity is first created. */ > > >@Override > > >public void onCreate(Bundle savedInstanceState) { > > >super.onCreate(savedInstanceState); > > >BitmapAnimation tv = new BitmapAnimation(this); > > >setContentView(tv); > > >} > > > > > } > > > > > public class BitmapAnimation extends View{ > > > private Bitmap myBitmap; > > > public BitmapAnimation(Context context) { > > > super(context); > > > BitmapFactory.Options opts = new > > > BitmapFactory.Options(); > > > opts.inScaled = false; > > > myBitmap = > > > BitmapFactory.decodeResource(getResources(), > > > R.drawable.icon, opts); > > > } > > > protected void onDraw(Canvas canvas) { > > > super.onDraw(canvas); > > > canvas.drawBitmap(myBitmap, 0, 0 ,new Paint()); > > > public boolean onTouchEvent(MotionEvent event){ > > > if(event.getX() < myBitmap.getWidth() && event.getY() < > > > myBitmap.getHeight()) > > > { > > > //do animation here > > > } > > > return true; > > > } > > > } > > -- > 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
[android-developers] Re: Error with custom made popup marker
TreKing, thanks. The issue is, I haven't extended the Activity class. My class extends another class. On Feb 25, 3:02 pm, TreKing wrote: > On Thu, Feb 25, 2010 at 2:08 AM, eyedol wrote: > > I created a new object of > > the Activity class and used that to call the various methods that > > needs to start the activity > > Don't do this, use your existing activity. > > On Thu, Feb 25, 2010 at 3:59 AM, Vishwanath Kamath Pethri < > > vishwanathkam...@gmail.com> wrote: > > try using > > > activity.*this*.startActivityForResult(intent,VIEW_INCIDENT); > > activity.*this*.setResult( activity.RESULT_OK ); > > That is not going to work. > > --- > -- > TreKing - Chicago transit tracking app for Android-powered > deviceshttp://sites.google.com/site/rezmobileapps/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 more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] WiFi roaming and handoff
We are setting up a WiFi VoIP network in the office, but are having trouble getting smooth roaming with Android phones (dev 2). They seems to wait until the signal is very weak before negotiating a hand-off. The iPod Touch handles this process much more smoothly. Can we tweak roaming performance with calls to the Android OS? Ben -- 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
[android-developers] Re: Send key event using native methods or low level classes -- possible solutions ??
That's absolutely right, but in my case I was looking for performing onClick event because I didn't had access to save() method, that was initially the only solution . Thank you all for you advices I really appreciate it. Best regards. On 25 fév, 18:05, Robert Green wrote: > Let me just say that as someone with a lot of UI development > experience (in Android, SWT and Swing anyways), if you're looking to > programmatically push controls, your design is most likely wrong. > > I have developed maybe 50-100 screens of GUIs and have never needed > that functionality. Consider this - you have a button that has some > anonymous inner class action handler. Normal, right? > > So here's my save button code: > > Button saveButton = (Button) findViewById(R.id.save_button); > saveButton.setOnClickListener(new OnClickListener() { > public void onClick(View v) { > dataMgr.setUserName(userNumber, > nameEdit.getText().toString().trim()); > finish(); > } > }); > > Let's say we wanted the app to programmatically "press" that button. > How do I do it? Answer: That right there is a fundamentally wrong way > to look at it. We don't need to "press" it, we need to refactor it. > > Consider adding this private method: > private void save() { > dataMgr.setUserName(userNumber, > nameEdit.getText().toString().trim()); > finish(); > > } > > Now change the button to: > > Button saveButton = (Button) findViewById(R.id.save_button); > saveButton.setOnClickListener(new OnClickListener() { > public void onClick(View v) { > save(); > } > }); > > And when we want to "press" the button, instead, we just call save(). > > That can be applied to every situation in some form or another. You > should never have to fake input from the user and if you have critical > code that can only be called via a user input, your design is flawed > but you can usually fix it by moving that code out into private > methods. > > On Feb 25, 6:39 am, skink wrote: > > > > > On Feb 25, 1:23 pm, Houcem Berrayana > > wrote: > > > > Aah! so that's may be the reason. I am actually using a custom > > > build but we just modified some low level libraries. Any way thank you > > > very much for your help. > > > > On 25 fév, 12:23, skink wrote: > > > > > On Feb 25, 11:41 am, Houcem Berrayana > > > > wrote: > > > > > > I got always the same problem :( > > > > > I'll try to join my code. It's rises the exception when I click on the > > > > > button. > > > > > it runs just fine. > > > > > you probably have custom android build based on 1.5 and apparently > > > > something is broken, am i right? > > > > > pskink > > > see what's wrong in PhoneWindow.jawa line 553 > > > pskink -- 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
[android-developers] Re: How to do animation when click on a bitmap
Hi, do you have an explicit example? I don't know what are the relationships between the BitmapAnimation View , the main class and the Drawable class.. On Feb 25, 1:09 pm, Nithin wrote: > Create a class "BitmapDrawable" which extends Drawable and pass the > bitmap to the contructor. Then in draw() , draw the bitmap. Create the > object of the "BitmapDrawable" class and add the object to the > AnimationDrawable using addFrame()and set the duration in > milliseconds(how much time you need to display the drawable). Then > create a thread and call animationDrawable.start() > > Hope this helps... > > Nithin > > On Feb 25, 9:34 am,CMF wrote: > > > I have bitmap displayed on the top of the screen when the app is > > started up. > > When clicking on the bitmap, the image should move to the bottom of > > the screen. > > > I have read the AnimateDrawables from ApiDemos, but the animation is > > done on a Drawable Object. If it can use on bitmap, it will be great! > > > Here is my code > > > public class HelloAndroid extends Activity { > > /** Called when the activity is first created. */ > > �...@override > > public void onCreate(Bundle savedInstanceState) { > > super.onCreate(savedInstanceState); > > BitmapAnimation tv = new BitmapAnimation(this); > > setContentView(tv); > > } > > > } > > > public class BitmapAnimation extends View{ > > private Bitmap myBitmap; > > public BitmapAnimation(Context context) { > > super(context); > > BitmapFactory.Options opts = new > > BitmapFactory.Options(); > > opts.inScaled = false; > > myBitmap = > > BitmapFactory.decodeResource(getResources(), > > R.drawable.icon, opts); > > } > > protected void onDraw(Canvas canvas) { > > super.onDraw(canvas); > > canvas.drawBitmap(myBitmap, 0, 0 ,new Paint()); > > public boolean onTouchEvent(MotionEvent event){ > > if(event.getX() < myBitmap.getWidth() && event.getY() < > > myBitmap.getHeight()) > > { > > //do animation here > > } > > return true; > > } > > } -- 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
[android-developers] Re: making videogame - newbie need help =P
Vlad and Kofa, I have to say again that all of that high level stuff (layouts and imageviews) is totally inappropriate for a real-time game. Consider loading all graphics into bitmaps, running a logic thread and drawing to a SurfaceView. You will have far superior performance and can do anything you want (so you won't be limited by some missing feature in imageview). On Feb 25, 5:51 am, Vladimir wrote: > > ImageView[] var1 = new ImageView[4]; > > var1[0].SetId(100); > > Wouldn't work with any non-primitive type. You only get an array of > handles, need to initialize each object explicitly: > ... > var1[0] = new ImageView(...) > var1[0].setId(100); > ... > > With regards to the 1st question, you can create an instance of > RelativeLayout.LayoutParams and use methods such as addRule(...), then > specify it when you attach a view to its parent (addView(view, params) > if I remember correctly). I still recommend that you think again about > using XML for most of your layouts. As the UI gets more complicated, > your code will become a mess. XML layouts in Android are very > flexible, it takes a while to learn the tricks, but it's worth it. > You'll waste more time looking for workarounds if you choose to ignore > XML. > > On Feb 24, 10:09 pm, Kofa wrote: > > > > > First of all, sorry for the delay to reply...=P > > I have just read your message... i have started already and I have > > developed much I think =) > > I will tell you what I have, I will focus on the "engine"(GUI): > > a main menu with buttons, one with START GAME goes to another > > activity, there another button to start the game itself, the "engine": > > a new activity is called, it loads almost everything from the 2 > > layouts from code, not XML, i think it's more flexible. > > FIRST LAYOUT: a imageview with a huge picture on it it has a - > > onTouchEvent- that makes the scroll works... > > loads too some imageviews(citys) in the same layout as the map, so > > those images move with the scroll. > > The other layout, the main layout, has a imageview and a > > button.and here comes the 2 problems that appeared =P: > > -How can I arrange views in a RelativeLayout, but on code, not XML. > > -and I can't think out how to create an array of ImageViews. > > > I tried something like this but didn't work, for example to set an ID: > > > ImageView[] var1 = new ImageView[4]; > > > var1[0].SetId(100); > > > AND SORRY FOR MY ENGLISH =P -- 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
[android-developers] Re: why I can't see google's nexus one from eclipse
The drivers that come with the latest Android SDK download work well for Vista 64bit and Windows 7 64bit (i used it on both). I don't know about XP 64bit, though... On Feb 16, 9:51 pm, Bob Kerns wrote: > You might try running a VMWare Virtual Machine, with a 32-bit XP, and > doing it from there. > > That's what I had to do to talk to my LiveScribe pen until they got > their 64-bit drivers together. (I don't know if they ever work for > XP-64, it's just not that common on a desktop, but Vista 64 and now > Windows 7 64 are the norm now on new hardware). > > On Feb 16, 11:52 am, DonFrench wrote: > > > > > Unless you are on XP-64, in which case it appears that there is no > > way. Someone correct me if they know different.- Hide quoted text - > > - Show quoted text - -- 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
[android-developers] Re: Send key event using native methods or low level classes -- possible solutions ??
Let me just say that as someone with a lot of UI development experience (in Android, SWT and Swing anyways), if you're looking to programmatically push controls, your design is most likely wrong. I have developed maybe 50-100 screens of GUIs and have never needed that functionality. Consider this - you have a button that has some anonymous inner class action handler. Normal, right? So here's my save button code: Button saveButton = (Button) findViewById(R.id.save_button); saveButton.setOnClickListener(new OnClickListener() { public void onClick(View v) { dataMgr.setUserName(userNumber, nameEdit.getText().toString().trim()); finish(); } }); Let's say we wanted the app to programmatically "press" that button. How do I do it? Answer: That right there is a fundamentally wrong way to look at it. We don't need to "press" it, we need to refactor it. Consider adding this private method: private void save() { dataMgr.setUserName(userNumber, nameEdit.getText().toString().trim()); finish(); } Now change the button to: Button saveButton = (Button) findViewById(R.id.save_button); saveButton.setOnClickListener(new OnClickListener() { public void onClick(View v) { save(); } }); And when we want to "press" the button, instead, we just call save(). That can be applied to every situation in some form or another. You should never have to fake input from the user and if you have critical code that can only be called via a user input, your design is flawed but you can usually fix it by moving that code out into private methods. On Feb 25, 6:39 am, skink wrote: > On Feb 25, 1:23 pm, Houcem Berrayana > wrote: > > > > > > > Aah! so that's may be the reason. I am actually using a custom > > build but we just modified some low level libraries. Any way thank you > > very much for your help. > > > On 25 fév, 12:23, skink wrote: > > > > On Feb 25, 11:41 am, Houcem Berrayana > > > wrote: > > > > > I got always the same problem :( > > > > I'll try to join my code. It's rises the exception when I click on the > > > > button. > > > > it runs just fine. > > > > you probably have custom android build based on 1.5 and apparently > > > something is broken, am i right? > > > > pskink > > see what's wrong in PhoneWindow.jawa line 553 > > pskink -- 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
[android-developers] Re: Free Version of App
While the downloadable license approach sounds good on the face of it, there are just too many loose ends for my tastes as it stands. We already have a very limited channel for communicating with our customers, and I don't want to waste those characters What I've done is create a master build script, which takes a project name, tags it in Subversion, cleans and switches a build working copy (or does a checkout if needed). I then do two exports from that working copy. I run an XSLT script on the AndroidManifest.xml to handle the differences there, including changing the package, removing the debuggable='true' flag, removing ADMOB ID's, etc. Any differences, I handle programmatically. I don't actually change the code packages, just the references in the manifest and the manifest's package name. Any excess code I'm tentatively planning to remove via Proguard, but I haven't gotten that far yet. In effect, I have three versions -- DEV, FREE, and PRO. DEV is internal-only. I also maintain a change log page I show the users the first time they run after they update. I'm thinking of generating this page content from a filtered view of the Subversion log, but for now I'm manually updating it. It hides any changes they've already seen, based on a record in the Shared Settings. Which is where this all breaks down -- these settings aren't shared between the different versions. Here's my plan for dealing with that: 1) Create a content provider for the settings for my app. 2) When launching the PRO version the first time, if it detects the FREE versions, it will suck in the existing settings from the FREE version. 3) When launching the FREE version, if it detects the PRO version, it will not launch its service, and will take the user to an explanatory page, with a link to the application management page in the system settings. 3a) I plan to listen for PACKAGE_ADDED, and transfer the settings there. That looks to me to be the most reliable place. 3b) I suppose I should monitor PACKAGE_REMOVED, and if the PRO version is uninstalled, re-enable the FREE version. I should only need these in the FREE version, so once a user upgrades there would be no need to launch the app on each install/uninstall. 4) The DEV version will have a couple extra menu items to invoke these operations manually for testing. (For what it's worth, I notice that com.android.voicedialler monitors PACKAGE_ADDED and PACKAGE_RECEIVED, as do a few others with no other obvious reason. I wonder if some of them are doing a similar trick?) This looks to me to be about the best I can do. Does anybody see any problems I've missed? Have a better/simpler idea? It's really too bad the platform doesn't provide a way for one app to supersede another, when signed with the same key. This could be handled much more cleanly at install time. On Feb 24, 11:34 pm, String wrote: > On Feb 25, 4:00 am, Carmen Delessio wrote: > > > It seems like it should be possible to have 2 apps signed with same > > certificate. > > See the info below. If your paid app exposed functionality to your free app > > you would get the free/paid goal. > > The free app would check whether paid app was installed, if it was it would > > be used. If not an upgrade message would be displayed. > > This is exactly what I do with one of my apps, TerraTime. I call the > paid app the "license", and it has essentially no functionality of its > own; it just needs to be present for the full functionality of the > free app to be unlocked. I have a slightly different marketing > strategy - my free app has the full feature set, but is just time- > limited to a trial period. It's that time limit which the license > unlocks. But the same approach should work for a freemium model like > yours. > > The major advantage to this is a single code base. From this > perspective, it works well. > > There are a number of small drawbacks that I've found, however. > Primarily, it causes some confusion for the user... The free app is > named "TerraTime Trial", but it needs to stay installed when the user > upgrades. I mostly get around this with clear instructions in all the > relevant places. This may be less applicable with your strategy; just > make sure you don't name the free version "Lite" or some such. And > make VERY clear in the app description that it's a freemium model, or > you'll get complaints. > > Overall, it'd be better if the Market supported in-app purchases (like > certain other App Stores do). But there are so many other, more > serious problems with the market that this feature is probably - > hopefully - pretty far down the priority list. > > A completely different possibility might be to organize your code into > a single JAR file which you can then include in both application > packages. While this would let you maintain only a single version of > your Java source, it wouldn't help you with other code (manifests, > resources, etc). Also, I've personally never got it to work, but I >
[android-developers] Re: Out of Memory resuming application
It could be anything. You have to post some code-samples that you think code be suspicious. Check your (static) caches, if you have them. On Feb 25, 6:49 am, REvolver wrote: > None? -- 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
[android-developers] Re: Free Version of App
We're now doing Lite and Pro builds from a single codebase, using an Ant script to convert the project from Lite to Pro and vice-versa. It seems to work fairly smoothly once the script-wrangling is done. More detail is in this thread: http://groups.google.com/group/android-developers/browse_thread/thread/270cbc77091e5bfd/857245e6964e5090?lnk=gst&q=jarkman#857245e6964e5090 Doing it this way has one convenient feature, which is that you can have a few source and/or layout files which are different for the two versions. It saves the shoehorning required to implement all your behaviour changes via a runtime test. Richard On Feb 24, 7:49 pm, "Nick Owens" wrote: > Experts (and of course Mark M): > > Here I go into the world of Android App deployment, and I have a question > about deployment strategy. > > I know I will have a "lite" version and a full version. In fact, I just > finished the full version and will start removing some core functionality > and putting in some minor restrictions into the so-called "lite" version. > The restrictions are simple things like a limited number of records which > can be created, for example. > > I have several options. I could of course: > > 1.) Create an entirely new project, copy the code base, and remove (comment > in/out) some of the features or restrictions into the lite version. > > 2.) I could two copies of the code base, which are identical in every way > but a setting in a configuration XML file, which turns on/off certain > functionality. > > However, the two scenarios above both suck from a code management > perspective. I would prefer and am asking to see if it's possible or even > been thought of: > > Upload my application to the market as two versions of the EXACT same > codebase (configurations and all). When installed on the phone, the market > would add an extra tag describing the version number or name of the > downloaded app version. Then I could program that into the app, not from a > configuration file which would mean I need two separate projects. > > Some flag I could access, for example: > > If (System.Apps.MyAppName.VersionTag.equals("Free-1.0")) { > > // restrict usage of this feature since free app > > } else { > > // allow usage of this feature for full version > > } > > Thanks, > Nick Owens > VP, ThreeClix > Office: (904) 429-7039 > Mobile: (847) 565-9392 > After Hours: (904) 540-5830 -- 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 update
Dan wrote: > I've got a question about updating an app after release. If I have a > database that contains 10 columns and I add a feature that requires an > 11th column after the app has been released, where would I put the sql > code to add the new column so that when they install the app it keeps > their current data, but adds that 11th column? In onUpgrade() of your SQLiteOpenHelper subclass. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, One Low Price! -- 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
[android-developers] database update
I've got a question about updating an app after release. If I have a database that contains 10 columns and I add a feature that requires an 11th column after the app has been released, where would I put the sql code to add the new column so that when they install the app it keeps their current data, but adds that 11th column? Is that even possible or would I need to create another table that references the first with a foreign key? -- 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
[android-developers] Re: Using Handler
I have the solution :) I use the same handler (set as static variable), so i don't lose the reference. Then I have made myHandler that extends Handler where i have a reference to the active activity, so when i rotate screen active_activity == null in onStop() and when start the onCreate() a update the reference in the Handler active_activity = this it works! :D On 25 Feb, 13:37, skink wrote: > On Feb 25, 1:03 pm, Paolo wrote: > > > > > > > Do nothing. > > my background thread has a reference to the (first) handler. when it > > finishes it sends a message on this handler. > > > If I rotate the screen before the thread has sent the message, i think > > that my activity is able to catch the message because I read this from > > the Documentation: > > > "A Handler allows you to send and process Message and Runnable objects > > associated with a thread's MessageQueue. Each Handler instance is > > associated with a single thread and that thread's message queue. When > > you create a new Handler, it is bound to the thread / message queue of > > the thread that is creating it -- from that point on, it will deliver > > messages and runnables to that message queue and execute them as they > > come out of the message queue." > > > is it correct my idea? > > > On 25 Feb, 12:46, skink wrote: > > > > Paolo wrote: > > > > Hi, > > > > > In my main activity (ListActivity) i start a thread in background to > > > > do some work and always in the activity i use a Handler to receive a > > > > message, containing in the filed obj one vector with many objects, > > > > from the thread when it finishes its work. Obviously i have overridden > > > > the methods handleMessage(Message m). > > > > It seems to work fine if I don't rotate the screen. > > > > > I would like to know what happen to the handler if i rotate the screen > > > > (like in the G1 using keybord). I know the the activity is destroyed > > > > with onDestroy and created again with onCreate(). and my handler? what > > > > happen to my handler? > > > > handler is just handler (new one is created), the real question is > > > what you do with your thread if you rotate the screen > > > > pskink > > if you do nothing with your thread i think that you should use in that > thread new handler, old one is associated with old activity > > pskink -- 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: ArrayAdapter use or misuse of the Adapter pattern
On Wed, Feb 24, 2010 at 10:28 PM, Conny wrote: > In a generalist sense adapter pattern is a bridge between 2 classes > that have some common functionality, but the interfaces are not > reusable between them. Ideally the need for adapter arises when we > have two classes that are not developed keeping in mind interaction > between them. > Right, and in this case, Android provides ArrayAdapter (and it's related classes) that allow you to convert a generic list of user-defined objects into a list of View objects, so the name seems appropriate. Strategy pattern, is more of a future reuse pattern, and that is the > intent its in android framework, reuse and extensibility. > Well, all patterns are designed for "future reuse". Strategy, specifically, defines a way to abstract out functionality or algorithms into components that can be added, removed, or swapped in and out at runtime. - TreKing - Chicago transit tracking app for Android-powered devices http://sites.google.com/site/rezmobileapps/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 more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Error with custom made popup marker
On Thu, Feb 25, 2010 at 2:08 AM, eyedol wrote: > I created a new object of > the Activity class and used that to call the various methods that > needs to start the activity > Don't do this, use your existing activity. On Thu, Feb 25, 2010 at 3:59 AM, Vishwanath Kamath Pethri < vishwanathkam...@gmail.com> wrote: > try using > > activity.*this*.startActivityForResult(intent,VIEW_INCIDENT); > activity.*this*.setResult( activity.RESULT_OK ); > > That is not going to work. - TreKing - Chicago transit tracking app for Android-powered devices http://sites.google.com/site/rezmobileapps/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 more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Writing a custom layout by deriving AbsListView?
HI All, I'm trying to write and custom layout by deriving from AbsListView (like gridView and ListView). But there are a few abstract methods (like fillGap(boolean)) in AbsListView with "default" visibility. So I can't derive this class in my package (application) Is it intensional limitation? if so, what are the problems in deriving from AbsListView? // Thote -- 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
[android-developers] Create AlertDialog from Runnable()
Hi there, I have an action from a button click that performs a lengthy web based fetch, so I have implemented it as a Runnable that is called from a Handler in my Activity class. However, in certain situations I need to be able to present the user with an alert dialog, which from the docs seems to require a Context object on it's constructor. This was not visible from the inner class, so I created a new class that implements Runnable that I pass the context to in it's constructor as follows: import android.app.AlertDialog; import android.content.Context; public class ActivityRunnable implements Runnable { public Context mContext; public AlertDialog mAlert; public ActivityRunnable(Context ctx) { mContext = ctx; } @Override public void run() { // TODO Auto-generated method stub } } However, in my code that instantiates this class, and implements run(), I try and run the following code: mAlert = AlertDialog.Builder(mContext).create(); However, I get an error from Eclipse saying that the method Builder(Context) is undefined for the type AlertDialog - has anyone else encountered this problem, or know of a better solution to my problem? regards, frak -- 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
[android-developers] named pipe in native code?
HI Dear, i am trying to create a named pipe in my native code which i will access in my java code here is my sample code to create piple which doesn't work --- #include #include #include #include #include #include /* This is a trivial JNI example where we use a native method * to return a new VM String. See the corresponding Java source * file located at: * * apps/samples/hello-jni/project/src/com/example/HelloJni/ HelloJni.java */ jstring Java_com_example_hellojni_HelloJni_stringFromJNI( JNIEnv* env, jobject thiz ) { // mkfifo(const char* path, mode_t mode); mkfifo("test_fifo", S_IRUSR ); return (*env)->NewStringUTF(env, "Hello JNI !"); } i have configured cygwin make with my eclipse and when it compiles this program it gives me error at mkfifo as it doesn't know s_IRUSR could anybody help me to figure out what is the problem and how can i solve it -- 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
[android-developers] Re: Petition: Google, please improve the Android Market.
@OP > 5. Multiple versions of an app Didn't notice it first time. Aren't we already able to target our apps to specific API levels? Did that once, seemed to work. @Ken H > This is very frustrating to me too, but I think this is a stupid/lazy > user issue, not Google's fault. Google can't change the users, but they can change the Market app :) At some point I put a big "Report Bug" button on my app's "welcome" screen, and the number of emails from users increased tenfold. For me it was the best design decision ever. And Google can do so much more to help us improve our apps... On Feb 21, 3:43 pm, Rob Irondad wrote: > Hi fellow developers. > I've come up with this text for apetition(warning: long): > > http://docs.google.com/View?id=dd9hmc43_0c9zh58gd > > You're all welcome to review it and send your comments before I > publish it to somepetitionwebsite. > You can email me directly (rob.iron...@gmail.com). > > -- > Rob -- 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
[android-developers] Re: Rotation with ListActivity
yes! this is the solution! Thanks a lot! the problem was the reference to the activity in my handler. It pointed to the old activity so i lost all the modifications to the layout. On 10 Feb, 23:23, Christoph Renner wrote: > You might look at the following > discussion:http://groups.google.com/group/android-developers/browse_thread/threa... > > > > On Wed, Feb 10, 2010 at 10:38 PM, Noodles wrote: > > You're right... I have forgotten to save the handler's reference. > > Yes, it's strange that it works if i rotate twice the screen... :( > > > I tried this modify, but it doesn't work yet. > > > @Override > > public Object onRetainNonConfigurationInstance() { > > Log.d("DEBUG", "onRetainNonConfigurationInstance() saving > > listaGP"); > > Vector vect = new Vector(); > > vect.add(listaGP); //save list > > vect.add(onDownloadFinished); //save handler > > return vect; > > } > > > In this way would I have to be able to save the references of both? > > > On 10 Feb, 20:53, Christoph Renner wrote: > >> Your reference to the Handler and the ArrayList in ConnectTask no > >> longer point to the fields of the Activity if it is destroyed and > >> recreated. This meens that the the thread cannot update the view > >> properly. I have no idea why it works for you when change the screen > >> rotation twice. > > >> On Wed, Feb 10, 2010 at 11:26 AM, Noodles wrote: > >> > Hi Chrigi! Thanks for your answer. > > >> > My thread has a reference to the ListView. > >> > But I'm not sure that this is the reason, maybe it could be... but If > >> > you are right why, when i rotate display for the second times, do i > >> > see the list with data? If i lost the reference to the thread's > >> > listview, i would lose also then. or not? > > >> > I show you a part of my code, maybe it can be usefull to understand > >> > better my problem. > > >> > public class HelloMotoGp extends ListActivity { > > >> > /* > >> > * VARIABILI > >> > */ > >> > protected ArrayList listaGP = new ArrayList(); // > >> > creo la lista che conterrà i GP letti da XML > >> > private ProgressDialog dialog=null; > >> > protected Handler onDownloadFinished; > >> > ConnectTask downloadTk; > >> > Thread thread; > > >> > /** Called when the activity is first created. */ > >> > �...@override > >> > public void onCreate(Bundle savedInstanceState) { > >> > super.onCreate(savedInstanceState); > >> > Log.d("DEBUG", "on Create()"); > >> > boolean restoreFlag = restore(); > >> > if(!restoreFlag){ > >> > manageDialog(); > >> > downloadData(); > >> > } > > >> > } > > >> > �...@override > >> > public void onStop(){ > >> > super.onStop(); > >> > Log.d("DEBUG", "onStop()"); > >> > if(dialog!=null && dialog.isShowing()){ > >> > dialog.dismiss(); > >> > Log.d("DEBUG", "dialog dismiss onStop()"); > >> > } > > >> > } > > >> > private void downloadData(){ > > >> > Log.d("DEBUG", "onDownload()"); > >> > //creo il thread associato al task Connect > >> > downloadTk=new ConnectTask(url,listaGP, onDownloadFinished); > >> > thread=new Thread(downloadTk); > >> > thread.start(); > >> > Log.d("DEBUG", "thread started"); > > >> > } > > >> > private void populateList(){ > >> > setListAdapter(new myAdapter(this, listaGP)); //my custom adapter > >> > Log.d("DEBUG", "populateList()"); > >> > } > > >> > �...@override > >> > protected void onListItemClick(ListView l, View v, int position, > >> > long id) { > >> > super.onListItemClick(l, v, position, id); > >> > Intent i = new Intent(this, GaraView.class); > >> > i.putExtra(GaraView.ITEM_LINK, > >> > listaGP.get(position).getDescription()); > >> > startActivity(i); > >> > } > > >> > �...@override > >> > public Object onRetainNonConfigurationInstance() { > >> > Log.d("DEBUG", "onRetainNonConfigurationInstance() saving > >> > listaGP"); > >> > Vector vect = new Vector(); > >> > vect.add(listaGP); > >> > return vect; > >> > } > > >> > private boolean restore() { > >> > Vector obj = > >> > (Vector)getLastNonConfigurationInstance(); > >> > if(obj!=null){ > >> > listaGP = (ArrayList) obj.elementAt(0); > >> > //mostro la lista a video se è vuota > >> > if(!listaGP.isEmpty()){ > >> > Log.d("DEBUG", "ListaGP full"); > >> > setContentView(R.layout.main); > >> > populateList(); > >> > return true; > >> > }else{ > >> > Log.d("DEBUG", "ListaGP, empty"); > >> > //mostro la finestra di download in corso > >> > return true; >
[android-developers] Re: Petition: Google, please improve the Android Market.
Thanks for your replies everybody. I'll try to incorporate all the feedback I received before publishing the document to the place where we can sign it. I hope we can agree on a final version soon - let's say, by this week- end. If so I'll publish it Sunday then. -- Rob -- 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