Re: [android-developers] Re: LoaderCallbacks.onLoadFinished unnecessarily called twice when rotating
There's a fair discussion on StackOverflow here: http://stackoverflow.com/questions/11293441/android-loadercallbacks-onloadfinished-called-twice/22183247 I saw the behavior when re-loading a Fragment in a ViewPager, which may be very similar to rotation... Basically, I solved the problem by removing the loader when I was done with it: getLoaderManager().destroyLoader(LOADER_ID); On Monday, July 2, 2012 4:49:50 PM UTC-4, Malcolm Evershed wrote: Your issue sounds like it could be different than mine since I'm generally seeing onLoadFinished() called in initLoader(). You might want to do more web or StackOverflow searching or search the Android bug database -- I think somewhere I read about a problem where onLoadFinished() would not be called, but I think it only happens if you don't do the stuff that CursorLoader does. In other words, to solve your issue, you might have to copy a bunch of code from CursorLoader. As to my issue, I never reported it since there didn't seem to be any interest in it. I just worked around it in my app. Thanks. On Mon, Jul 2, 2012 at 5:17 AM, szakalinhoPL szaka...@gmail.comjavascript: wrote: Hi, I noticed same situation, I'm not an expert but it seems like a bug because behaviour of onLoadFinished is not normal according to documentation which says that onLoadFinished should be called in initLoader, but it never does. In very simple application it happens as well. Did you report it or find out an answer? On Wednesday, April 11, 2012 11:05:41 PM UTC+1, Malcolm Evershed wrote: *[My apologies if this is posted twice, it has been a few days and my original post didn't show up yet, so I'm attempting to post again]* I think I've found an issue where LoaderManager.LoaderCallbacksD. *onLoadFinished*() will be called unnecessarily twice when rotating the device. *Is this expected behavior or should I open a bug?* This can easily be reproduced by running *ApiDemos *- *App *- *Loader *- *Cursor *(which corresponds to the *LoaderCursor.java* example) and rotating the device. 1) Here's the first location where onLoadFinished() is called: LoaderCursor$CursorLoaderListFragment.onLoadFinished(Loader, Cursor) line: 159 LoaderCursor$CursorLoaderListFragment.onLoadFinished(Loader, Object) line: 1 LoaderManagerImpl$LoaderInfo.callOnLoadFinished(Loader, Object) line: 438 *LoaderManagerImpl$LoaderInfo.reportStart() line: 318 * LoaderManagerImpl.doReportStart() line: 778 LoaderCursor$CursorLoaderListFragment(Fragment).performStart() line: 1534 FragmentManagerImpl.moveToState(Fragment, int, int, int) line: 862 FragmentManagerImpl.moveToState(int, int, int, boolean) line: 1032 FragmentManagerImpl.moveToState(int, boolean) line: 1014 FragmentManagerImpl.dispatchStart() line: 1771 *LoaderCursor(Activity).performStart()* line: 4481 ActivityThread.performLaunchActivity(ActivityThread$ActivityClientRecord, Intent) line: 1929 ActivityThread.handleLaunchActivity(ActivityThread$ActivityClientRecord, Intent) line: 1981 ActivityThread.handleRelaunchActivity(ActivityThread$ActivityClientRecord) line: 3351 ActivityThread.access$700(ActivityThread, ActivityThread$ActivityClientRecord) line: 123 ActivityThread$H.handleMessage(Message) line: 1151 ActivityThread$H(Handler).dispatchMessage(Message) line: 99 Looper.loop() line: 137 ActivityThread.main(String[]) line: 4424 Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method] Method.invoke(Object, Object...) line: 511 ZygoteInit$MethodAndArgsCaller.run() line: 784 ZygoteInit.main(String[]) line: 551 NativeStart.main(String[]) line: not available [native method] Basically, as the Activity is starting up, *Activity.performStart*() calls mFragments.dispatchStart() which eventually calls Fragment.performStart(), which then calls mLoaderManager.doReportStart(). Ultimately, *LoaderManagerImpl$LoaderInfo.reportStart*() checks if the loader has been started and whether *mReportNextStart *is set (it was set when Fragment.performDestroyView() was called on the old fragment) and then it'll call onLoadFinished(). 2) Here's the second location where onLoadFinished() is called during the same rotation: LoaderCursor$CursorLoaderListFragment.onLoadFinished(Loader, Cursor) line: 159 LoaderCursor$CursorLoaderListFragment.onLoadFinished(Loader, Object) line: 1 LoaderManagerImpl$LoaderInfo.callOnLoadFinished(Loader, Object) line: 438 *LoaderManagerImpl$LoaderInfo.finishRetain() line: 309 * LoaderManagerImpl.finishRetain() line: 765 *LoaderCursor(Activity).performStart() line: 4485 *
[android-developers] Re: Problem with adjustPan andadjustResize
If you're currently supporting API 3, I'd try to bump it to API 4, and see if that helps. I had some similar issues, and while I lost a small percentage of device support, it was worth it for the simplicity of the fix. On Jan 21, 9:09 am, Alok Kulkarni kulsu...@gmail.com wrote: Hi. i am having an activity in which i am adding controls such as EditText and TextView at runtime in a listiiew. What happens is that for the Edittext the keyboard pops up and the controls at the bottom of the screen are not visible even when i scroll down.So when i add the property android:windowSoftInputMode=stateVisible|adjustResize|adjustPan , things work.But suddenly i face the issue that i cannot type in the edit text pressing the keyboard.The focus automatically goes out of the EditText while typing on the keyboard.I have tried this on Devices like Nexus S , Moto Cliq . Both have the same problem.Any ideas. -- 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: change color of Button
I would recommend you specify shape drawables in xml for the background, using gradient to achieve your gradient. See some details here: http://developer.android.com/guide/topics/resources/drawable-resource.html#Shape Also, you can specify different states, see: http://developer.android.com/reference/android/content/res/ColorStateList.html On Jan 19, 5:22 am, pramod.deore deore.pramo...@gmail.com wrote: Hi, everybody I want to change color of button. Now I am done this with button.getBackground().setColorFilter(new LightingColorFilter(0xFF9933, 0x0CC000)); But is it possible to 1)change button color like - At the left top corner have dark color and color become faint as we move to the right bottom corner. 2) Can we change the color of border of button? 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] Re: Beginning?????
I believe this will be useful: http://insanitydesign.com/wp/projects/nehe-android-ports/ On Jan 14, 5:33 am, Vishal vb.41...@gmail.com wrote: hii developers... I am new to this journey and i want to make a 3d game using SDK 1.6 version...i have installed eclipse and has added android plugin in thatcan any body tell me what should i do next for preparing a 3d game.i have gone through opengl also -- 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: Leave crashed app
I agree with TreKing. If you're still very early in the development process, you should be able to locate the null object and do some if(obj==null) { } handling to prevent repetitive errors while debugging/coding. On Jan 14, 1:06 pm, TreKing treking...@gmail.com wrote: On Fri, Jan 14, 2011 at 2:55 AM, lou louis.coq...@wopata.com wrote: Else what are best practices to avoid this matter? Fix the bugs that are causing your app to crash again and again when going from one Activity to the next. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- 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 extend intent
I believe the best way to do what you've described is create your own Video Player Activity, which can contain a VideoView, and you can add listeners for most events (like video stopped or ended). On Oct 6, 5:51 am, zohar lerman lirazo...@gmail.com wrote: Hi, I am using the following code to play video: Intent myIntent = new Intent(Intent.ACTION_VIEW); Uri u = Uri.parse(path); myIntent.setDataAndType(u, video/*); try { context.startActivity(myIntent);} catch (ActivityNotFoundException e) { Log.e(TAG, cannot initiate video, e); } Is it possible to extend the intent and add it some abilities such as : notify when video complete to play? get user events (stop play etc),add new button? If yes how? I failed to find any example for it Zohar -- 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: bitmap magnification
I would advise calculating the scale of original image to screen height/width, and adjusting your inSampleSize accordingly. When it's 2, you're always loading half of the source bitmap, so if it's huge, you're still loading half of huge. You'll want to do something like options.inSampleSize = srcWidth/screenWidth; (maybe different, depending on your ratio, and if you want to fill the screen, etc. You might also want to round inSampleSize to the nearest power of 2. On Oct 4, 5:17 am, n2v2rda2 l...@unimocnc.co.kr wrote: with imageview and network-thread,i am making live cam-view ,bitmap size is 360 240, after parsing network-data to bitmap BitmapFactory.Options options = new BitmapFactory.Options(); options.inSampleSize = 2; Bitmap orgBitmap = BitmapFactory.decodeByteArray(); Bitmap bitmap = Bitmap.createScaledBitmap(orgBitmap, width, height / 2 , true); if (bitmap != null) { Message msg = Message.obtain(handler, 0, current_ch, 0, bitmap); handler.sendMessage(msg); } send bitmap by Message to ImageView.setImageBitmap(bitmap); all thing is good ,i can see live-cam but, to fit image in screen like Bitmap.createScaledBitmap(orgBitmap, width, height / 2 , true) Seeing bitmap is getting slow , the bigger bitmap is , the more speed down finally, shut-downed how to fit image in screen without pain -- 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: Need help getting app to play sounds
It depends on what type of audio you want to play... If you're playing short WAV files, maybe you should look at AudioTrack instead of MediaPlayer? MediaPlayer has worked perfectly well for me with MP3s though. Maybe review the MediaPlayer State Diagram if you're having trouble... On Aug 26, 12:25 pm, ericmahlon ericmah...@hotmail.com wrote: In my class I have an OnTouchEvent and when a certain area is clicked, it will play a sound (Not sure if this is the best way to go about this?). However I have been running into bugs using the MediaPlayer. Sound will double play and then eventually sound will stop completely. I am wondering how to efficiently play 5 sounds. The user will be clicking the screen in different areas and different sounds will be playing. I have the attached code below but it only has the first areasay I add in another area how would I go about changing the media player to play a different sound. @Override public boolean onTouchEvent(MotionEvent e) { x = e.getX(); y = e.getY(); if (x = 232 x=287 y=117 y=157) { //PLAY SOUND } 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: android manifest file from an unzipped apk cannot be read
Activites that are re-usable should have some published way of invoking them... Otherwise, perhaps they do something by file type, like if you start an activity for an MP3, audio players should be able to launch. Why don't you just ask the developer how to invoke an activity, instead of trying to hack through their apk? On Aug 26, 9:41 am, Anil anil.r...@gmail.com wrote: I would like to read the android manifest from an apk file. I unzipped it using 7-zip. However, the manifest seems to be in binary with some ascii but a lot of control chars. Was it meant to be hidden? The philosophy behind Android is to share and reuse activities - but if the manifest cannot be read, then I dont know how it can be done. thanks, Anil -- 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: Can we install Android SDK on windows 7 if yes then how ?
I followed the standard instructions on Windows 7, and everything works great. On Aug 25, 6:07 pm, Mark Murphy mmur...@commonsware.com wrote: On Wed, Aug 25, 2010 at 4:09 AM, Abbas stahaab...@gmail.com wrote: Can we install Android SDK on windows 7 Yes. if yes then how ? By following the instructions for installing the Android SDK on Windows, presumably: http://developer.android.com/sdk/index.html -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.1 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
[android-developers] Re: Using reflection to overide 2.0 method
I agree with TreKing, but I believe you might have to omit the '@Override' annotation. On Aug 5, 11:07 am, TreKing treking...@gmail.com wrote: On Thu, Aug 5, 2010 at 6:01 AM, Neilz neilhorn...@gmail.com wrote: Any ideas please on how I can achieve this? I don't think you have to do anything. I'm no expert on Java reflection, but ... if you add this function to your Activity and it runs on an older platform where there's nothing to override, then it should just appear like any other function that you added to your class. Assuming this is a function the OS calls for you at some point, it will never get called. On newer versions it will override the base function and be called when it's supposed to be. Of course, if you make use of it yourself somewhere where it *could* be called on older platforms, a simple check of the OS build version can keep you from executing anything you shouldn't be. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- 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: Thread
You should be able to read up on threads here: http://download-llnw.oracle.com/javase/tutorial/essential/concurrency/index.html On Aug 4, 4:43 am, perumal316 perumal...@gmail.com wrote: Hi All, I want to write a separate Thread within my application(to do Bluetooth connection). Any idea where I can find any reference for help to write Threads in Android? I searched online but could not find any proper reference. Thanks In Advance, Perumal -- 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: getAlpha for ImageView
If you're calling setAlpha, you should remember what you set the ImageView to. Maybe extend ImageView and add a rememberedAlpha field, that gets it's value on setAlpha() but before a call to super.setAlpha()? It doesn't look like there's a straight forward way to get the alpha... On Aug 3, 9:18 pm, Ozymandias jor...@gmail.com wrote: How do you get the alpha of an ImageView? You can setAlpha, but I can find no way to retrieve it afterwords. Anyone know? -- 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: Launch application or service from html link?
I would make up a scheme... and you can use an Intent-Filter to grab any request to that scheme. use an url like shrenikvikam://some.data.for.your.activity Then if your Activity listens for that scheme, a web link should start your activity. see http://developer.android.com/guide/topics/intents/intents-filters.html On Aug 3, 4:36 am, Shrenik Vikam yoursonyt...@gmail.com wrote: Can I get the detailed description of how to launch application from web link or A trusted link where I can get the steps to do the same Thanks in Advance Shrenik Vikam -- 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: intent to play mp4 problems
maybe try your intent this way: Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(Uri.parse(url), video/mp4); view.getContext().startActivity(intent); On Aug 2, 4:58 pm, Kyle kyle4...@gmail.com wrote: Here is my code that I'm currently using: final class MyWebViewClient extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { if (url.endsWith(.mp4)) { Intent intent = new Intent(android.intent.action.VIEW, Uri.parse(url)); view.getContext().startActivity(intent); return true; } else { return super.shouldOverrideUrlLoading(view, url); } } } On Aug 2, 3:00 pm, Matty busbus...@gmail.com wrote: Are you calling intent.setDataAndType(Uri Data, String Type) ? Sometimes specifying the right mime type makes a big difference. On Aug 2, 1:26 am, Kyle kyle4...@gmail.com wrote: Hey, I've created a WebView which loads a webpage and will play any file that ends in mp4 on click. The problem is, is that when the application is loaded on Android 2.2 and I click a mp4 link, it will open the web browser and immediately close. I can take that same link and manually enter it into the web browser and the media player will launch and play the file properly. What I'm wondering is how can I get my application to properly load the media player and play the video? -- 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: Deploying Custom Configuration with My Android App
If you have web services already, won't it be easy to add one that allows clients to say where should I look for content? They could send version numbers, their own phone number, or other information so you can decide where to point them. Then the client could store that information in a DB, or on the sdcard, or in memory... On Aug 3, 8:42 am, TreKing treking...@gmail.com wrote: On Mon, Aug 2, 2010 at 9:28 AM, droidbm droi...@gmail.com wrote: *Raw Resource: If I unzip the apk and change the settings file, it becomes invalid as I need to resign the apk. Why are you unzipping the APK to change the settings file? You can have several raw resources, one for each configuration, and on first run read the one that's appropriate and use it to set up your app, applying the settings to, say, a SharedPreferences object. Done. What's the problem? - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- 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: Specs for graphics
You can find UI Guidelines for icons here: http://developer.android.com/guide/practices/ui_guidelines/icon_design.html If you click around, you can find other info there too... As for the market submission, here's what the form says (and validates for) Screenshots 0 or 2 320w x 480h or 480w x 854h 24 bit PNG or JPEG (no alpha) Full bleed, no border in art Landscape thumbnails are cropped Promotional Graphic optional 180w x 120h 24 bit PNG or JPEG (no alpha) Full bleed, no border in art -- 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 store a drawable in database?
I can't help but wonder why you would want to do this? On Aug 1, 9:12 am, Jerry Fan jerryfan1...@gmail.com wrote: Hi folks, is there anyway that I can store drawables into database? -- 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 get which listitem is focused
You should be able to create an AdapterView.OnItemSelectedListener, add it to your ListView using setOnItemSelectedListener and keep a pointer to the currently selected item. On Jul 31, 9:17 am, cindy ypu01...@yahoo.com wrote: I have a listActivity which I use ArrayAdapter insider it. When user scrolls the scroll ball, one listitem would be focused. How canI know itemlist is highlighted? It looks simple to me at first, however, it takes several days and still can't find answer. Thanks! April -- 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: new scene ?
1) Create a new activity for your second scene... 2) Add an OnClickListener to your button 3) When button is clicked, call startActivity() with an intent for your second activity. Hope that's what you were asking On Aug 2, 2:05 pm, coy cawe...@gmail.com wrote: hi. I'm beginning to study Android and have a doubt. How do I open a new layout and code (xml and java) by clicking a button on the main scene? A simple help would be greatly appreciated (: -- 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: either im only registering textview and webview clicks or im not getting my listitemclick
Are you perhaps listening to a ListView that doesn't exist any more??? Also, I don't know why you would use a WebView for this... It makes much more sense to download the image into memory and display it as an ImageView. It sounds like you're reloading it every time now anyway. If you don't want to reload it, or store it in a DB, what's wrong with storing it on the filesystem? On Aug 2, 11:36 am, charles berman charles.heath.ber...@gmail.com wrote: i may get flamed for this question, but help me do it right. I was downloading images from a website and putting them into a database, and then displaying them in an imageview. well to reduce the size of my database, i changed from an imageview to a webview and now only do a Webview.Loaddata(ImageLink). all of this is contained within a listactivity. my problem seems to be that for whatever reason now i dont seem to be capturing the Listclick event any longer XML ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/android; android:background = @color/ImageColor android:orientation = horizontal android:layout_width=fill_parent android:layout_height=wrap_content LinearLayout xmlns:android=http://schemas.android.com/apk/res/android; android:background = @drawable/bluebg android:orientation = vertical android:layout_width=wrap_content android:layout_height=wrap_content WebView android:id=@+id/image android:padding = 5pt android:color=@color/ImageColor android:paddingTop =20pt android:layout_width=80px android:background = @drawable/myimage android:layout_height=95px/ /LinearLayout LinearLayout xmlns:android=http://schemas.android.com/apk/res/android; android:background = @drawable/bluebg android:orientation = vertical android:layout_width=fill_parent android:layout_height=wrap_content TextView android:id=@+id/title android:text=title android:paddingRight= 2pt android:paddingLeft= 2pt android:background = @android:color/transparent android:layout_width=fill_parent android:layout_height=wrap_content/ /LinearLayout /LinearLayout Charles Berman 313.790.9851 www.charlesberman.com -- 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: Create Quick Launch of WAP site
I'm not positive what all the options are... You could certainly just wrap your website in a WebView and offer it for free on the market... If users visit your site, you can send them to the market with a market:// link, and you'll get visitors who found your app on the market without even visiting the site first. On Aug 2, 2:10 am, John B johnbuto...@gmail.com wrote: On my website I would like to offer browsers, from an Android device, a button/link that would prompt the user to add the site as a quick launch icon on their screen. I'm sure this is easy to do but have not seen any decent posts on this, though may have missed it. Any recommendations? -- 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: intent to play mp4 problems
Are you calling intent.setDataAndType(Uri Data, String Type) ? Sometimes specifying the right mime type makes a big difference. On Aug 2, 1:26 am, Kyle kyle4...@gmail.com wrote: Hey, I've created a WebView which loads a webpage and will play any file that ends in mp4 on click. The problem is, is that when the application is loaded on Android 2.2 and I click a mp4 link, it will open the web browser and immediately close. I can take that same link and manually enter it into the web browser and the media player will launch and play the file properly. What I'm wondering is how can I get my application to properly load the media player and play the video? -- 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: Detecting lock_layer timed out
That sounds most likely (bug in platform). I've only been able to reproduce it on 1.5 and 1.6, not 2.0 or 2.1... So I guess that returns me to my original question: Is there any way I can detect this state in my code (I guess I don't mind polling when viewing this Activity). If so, what's the right thing to do? Is there a way to release the lock? Can I just kill the app? I guess the main goal is to avoid timing out and show the wait/ force close message in this case. Thanks. On Jul 21, 7:34 pm, Dianne Hackborn hack...@android.com wrote: What version of the platform are you running against? It could just be a bug in the platform. On Wed, Jul 21, 2010 at 11:17 AM, Matty busbus...@gmail.com wrote: My OpenGL stuff seems to draw just fine until some rotate (this is most reproducible if you rotate back and forth with about a second between). Note that Activity B is singleTop Here's a log from the normal startup: I/System.out(17209): Activity A:onCreate() I/System.out(17209): Start Activity B from Activity A I/System.out(17209): Activity B:onCreate() I/System.out(17209): Activity B:onResume() When I rotate and things are fine: I/System.out(17209): Activity B:onPause() I/System.out(17209): Activity B:onDestroy() I/System.out(17209): Activity B:onCreate() I/System.out(17209): Activity B:onResume() I/System.out(17209): Activity A:onCreate() I/System.out(17209): Start Activity B from Activity A I/System.out(17209): Activity B:onPause() I/System.out(17209): Activity B:onResume() So it's actually restoring B before re-creating activity A... But then A resumes B... I think it's doing B-then-A because A is shown through the translucent activity B? For normal cases this works fine... I was able to reproduce the issue by rotating back and forth repeatedly... I sort of had to do it while the screen stayed grey, so I'm not sure exactly when the problem started, but I'm seeing something useful from the log: I/System.out(17910): Start Activity B from Activity A I/System.out(17910): Activity B:onPause() I/System.out(17910): Activity B:onResume() I/System.out(17910): Activity B:onPause() I/System.out(17910): Activity B:onDestroy() I/System.out(17910): Activity B:onCreate() I/System.out(17910): Activity B:onResume() I/System.out(17910): Activity B:onPause() I/System.out(17910): Activity B:onDestroy() I/System.out(17910): Activity B:onCreate() I/System.out(17910): Activity B:onResume() I/System.out(17910): Activity B:onPause() I/System.out(17910): Activity B:onDestroy() I/System.out(17910): Activity B:onCreate() I/System.out(17910): Activity B:onResume() I/System.out(17910): Activity B:onPause() I/System.out(17910): Activity B:onDestroy() It looks like when you rotate that fast, Android doesn't even get to tell anything to Activity A! Somehow it got lost, and after that, I see continuing messsages of: W/SurfaceComposerClient(17910): lock_layer timed out (is the CPU pegged?) layer=2, lcblk=0x420d0120, state=000e (was 000e) Is there any way around this? Am I being to mean with my rotations? On Jul 21, 1:12 pm, Dianne Hackborn hack...@android.com wrote: Have you made sure your SurfaceView UI is actually drawing regularly, and especially redrawing itself as soon as possible with the new size? On Wed, Jul 21, 2010 at 8:02 AM, Matty busbus...@gmail.com wrote: Thanks for the quick response Dianne. I have an activity that uses OpenGL, and if I rotate at just the right time, the log prints W/SurfaceComposerClient( 749): lock_layer timed out (is the CPU pegged?) layer=2, lcblk=0x420d0120, state=000e (was 000e) I basically don't want the Activity to hang. I'm using a plain android.opengl.GLSurfaceView. There are 2 activities involved. A,B. B is started from A using startActivityForResult, and is translucent. On rotate, both finish, and then I start A (which might work) which then starts an intent for B. If I rotate at the right time, I see the message above, and sometimes Activity A draws properly, but usually not quite (only draws some of the screen, or a rotated version of the opposite orientation), and it seems like B is somehow blocked because of the message above. Activity B has the GLSurfaceView. Any advice is greatly appreciated. On Jul 21, 9:22 am, Dianne Hackborn hack...@android.com wrote: What problem is this causing you that you are trying to fix? On Wed, Jul 21, 2010 at 5:47 AM, Matty busbus...@gmail.com wrote: I have looked through many posts on this issue, and I've concluded that there's not much I can do to prevent it... I am able to reproduce this error when repeatedly rotating an Activity that uses OpenGL. W/SurfaceComposerClient( 749): lock_layer timed out (is the CPU pegged?) layer=2, lcblk=0x420d0120, state=000e (was 000e
[android-developers] Re: video playback problem
My guess is the video isn't the right size, so the device is struggling to scale the video and/or the bitrate is just too high... Try a lower bitrate, and check the dimensions of your video. On Jul 22, 7:49 am, berliner myberli...@gmail.com wrote: Hi, what could be the reason that a mp4 video file without sound doesn't play correctly when using the VideoView class? The video plays just fine in vlc, mplayer and ubuntu media player. It has been created on the device using ffmpeg. It is like 5 seconds long, so nothing especially big. Codec is H263 with AAC-Audio, though the audio signal is just empty. The problem is, that the video plays, but the image doesn't change, or at least doesn't change a lot. It seems more like a still image, though small movements is sometimes visible but not at all what has been encoded. I noticed that the VideoView stops playing but the time continues to step up, so it doesn't stop counting after 5 seconds but just goes on counting. I'm using the emulator. Can that be related? I see the following messages in logcat: W/PlayerDriver: Using generic video MIO D/AudioSink: bufferCount (4) is too small and increased to 12 E/SW_DEC: PV SW DECODER is used for MPEG4 W/MediaPlayer: info/warning (1, 44) I/MediaPlayer: Info (1, 44) D/MediaPlayer: getMetadata W/AudioFlinger: write blocked for 118msecs, 1630 delayed writes, thread 0xb388 W/MediaPlayer: Attempt to seek to past end of file: request = 5559, EOF 4018 ... What could be the reason? Any ideas? Might it be an encoder problem? best regards, berliner -- 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 upgrade the os of g1 mobile
What carrier are you on? I believe T-Mobile allowed me to use the update setting... Otherwise I think you'll have to find instructions online. See an example I found with a simple google search: http://www.denraf.be/content/howto-android-21-g1adp1dream On Jul 22, 4:54 am, Narendra Bagade bagadenaren...@gmail.com wrote: Hi All, I have android g1 mobile having os 1.5.I want to upgarde the os from 1.5 to higher version. Please help me how to do this. -- Regards, Narendra -- 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 convert a xml page to speech???
I think you will want to write your own xml parser/handler so that you can decide what gets read to the user. Maybe use SAX? On Jul 22, 6:03 am, prachi prachi.tya...@wipro.com wrote: Hi all I have an xml page which im able to display on webview and also able to convert it to sppech by using text to speech API provided by android. I have stored that xml page in a string variable and hence able to convert it to speech which takes string variable as an input. But my problem is that if the xml has some href tags or imgsrc tags those are also read out by TTs. Can u pl tell me how to overcome this I jst want the text part which is displayed in webview to be read out not the image url or smething else Please help...Its urgent. Any help would be appreciated:) -- 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] Detecting lock_layer timed out
I have looked through many posts on this issue, and I've concluded that there's not much I can do to prevent it... I am able to reproduce this error when repeatedly rotating an Activity that uses OpenGL. W/SurfaceComposerClient( 749): lock_layer timed out (is the CPU pegged?) layer=2, lcblk=0x420d0120, state=000e (was 000e) For reference: I'm calling GLSurfaceView.onPause() and onResume() on activity pause and resume... My question is: Can I detect this error in my java code, so I can try to do something extra to correct it? Is there an ErrorListener, or an object I can access to find out about when this occurs? I have tried ((EGL10) EGLContext.getEGL()).eglGetError(); but does not report an error. I'm guessing I'd need some sort of Surface object? -- 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: Touch event noisy
I'm not positive, but maybe the issue is that you're getting touch events for each time you draw your scene? Try to skip drawing, and just print debug about when your finger is down... I think that will shed some light on the issue. You could also just capture the touchdown, record it's startTime, and if you haven't received an event in some delta (probably like 50ms?) assume you should stop the character. Good Luck. On Jul 21, 2:50 am, billconan billco...@gmail.com wrote: Hello everyone. I'm working on a simple game: when you press a button on the screen, a character will run to certain direction. it's easy to support keyboard input. but, some phone doesn't go with a keyboard or even no a track ball. so I decided to draw a virtual run key on the screen (with opengl). when the user press the virtual key, i apply a velocity to the character. and when the user release the key, i disable the velocity to stop the character. but there seems to be some touch event noisy. if my finger cannot press still, i will see millions of touch down and touch up events, instead of a single long pressing. and occasionally, my program captured the touch down event when i touch the screen, but didn't capture touch up event. so my character will keep moving, even no finger is on the screen. I'm wondering if there is some way to reduce the touch event noisy and tell if the user is currently pressing on the screen, instead of only getting an event when touch up and down happen. it seems the system ui can detect long pressing, for example when you put a finger on one item of the list view widget, the entire item turns to orange. i just don't know how to detect pressing in my opengl game. 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] Re: Widget update problem
How are you delaying 5 seconds, and what operation are you doing once that 5 seconds is complete? Could it be taking more than 5 seconds, thus slowly building up the number of processes that are running? On Jul 21, 5:32 am, NightGospel wutie...@gmail.com wrote: Hi all, I wrote one widget that updates per 5-seconds and I found that if it's run for a period of time, com.android.acore will occupy almost 100% cpu. Could somebody give me suggestions or help? Thanks in advance. NightGospel -- 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 get function call trace on android phones?
Can't you put a breakpoint (in eclipse) at the function you want information about, then just run the code? When you hit a breakpoint, eclipse should show you a call stack. On Jul 14, 2:44 am, Shuo Deng dengshuoama...@gmail.com wrote: Does anybody know how can I get the build-in function call trace on Android phone? Thanks! 2010/7/14 Shuo dengshuoama...@gmail.com Hi, I want to know which functions are called when I am running apps on android phones. Does anyone know how can I get the function call traces? Is there anything similar to the 'Detour' for windows? Thanks a lot! Shuo -- 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: Detecting lock_layer timed out
Thanks for the quick response Dianne. I have an activity that uses OpenGL, and if I rotate at just the right time, the log prints W/SurfaceComposerClient( 749): lock_layer timed out (is the CPU pegged?) layer=2, lcblk=0x420d0120, state=000e (was 000e) I basically don't want the Activity to hang. I'm using a plain android.opengl.GLSurfaceView. There are 2 activities involved. A,B. B is started from A using startActivityForResult, and is translucent. On rotate, both finish, and then I start A (which might work) which then starts an intent for B. If I rotate at the right time, I see the message above, and sometimes Activity A draws properly, but usually not quite (only draws some of the screen, or a rotated version of the opposite orientation), and it seems like B is somehow blocked because of the message above. Activity B has the GLSurfaceView. Any advice is greatly appreciated. On Jul 21, 9:22 am, Dianne Hackborn hack...@android.com wrote: What problem is this causing you that you are trying to fix? On Wed, Jul 21, 2010 at 5:47 AM, Matty busbus...@gmail.com wrote: I have looked through many posts on this issue, and I've concluded that there's not much I can do to prevent it... I am able to reproduce this error when repeatedly rotating an Activity that uses OpenGL. W/SurfaceComposerClient( 749): lock_layer timed out (is the CPU pegged?) layer=2, lcblk=0x420d0120, state=000e (was 000e) For reference: I'm calling GLSurfaceView.onPause() and onResume() on activity pause and resume... My question is: Can I detect this error in my java code, so I can try to do something extra to correct it? Is there an ErrorListener, or an object I can access to find out about when this occurs? I have tried ((EGL10) EGLContext.getEGL()).eglGetError(); but does not report an error. I'm guessing I'd need some sort of Surface object? -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- 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: Detecting lock_layer timed out
My OpenGL stuff seems to draw just fine until some rotate (this is most reproducible if you rotate back and forth with about a second between). Note that Activity B is singleTop Here's a log from the normal startup: I/System.out(17209): Activity A:onCreate() I/System.out(17209): Start Activity B from Activity A I/System.out(17209): Activity B:onCreate() I/System.out(17209): Activity B:onResume() When I rotate and things are fine: I/System.out(17209): Activity B:onPause() I/System.out(17209): Activity B:onDestroy() I/System.out(17209): Activity B:onCreate() I/System.out(17209): Activity B:onResume() I/System.out(17209): Activity A:onCreate() I/System.out(17209): Start Activity B from Activity A I/System.out(17209): Activity B:onPause() I/System.out(17209): Activity B:onResume() So it's actually restoring B before re-creating activity A... But then A resumes B... I think it's doing B-then-A because A is shown through the translucent activity B? For normal cases this works fine... I was able to reproduce the issue by rotating back and forth repeatedly... I sort of had to do it while the screen stayed grey, so I'm not sure exactly when the problem started, but I'm seeing something useful from the log: I/System.out(17910): Start Activity B from Activity A I/System.out(17910): Activity B:onPause() I/System.out(17910): Activity B:onResume() I/System.out(17910): Activity B:onPause() I/System.out(17910): Activity B:onDestroy() I/System.out(17910): Activity B:onCreate() I/System.out(17910): Activity B:onResume() I/System.out(17910): Activity B:onPause() I/System.out(17910): Activity B:onDestroy() I/System.out(17910): Activity B:onCreate() I/System.out(17910): Activity B:onResume() I/System.out(17910): Activity B:onPause() I/System.out(17910): Activity B:onDestroy() I/System.out(17910): Activity B:onCreate() I/System.out(17910): Activity B:onResume() I/System.out(17910): Activity B:onPause() I/System.out(17910): Activity B:onDestroy() It looks like when you rotate that fast, Android doesn't even get to tell anything to Activity A! Somehow it got lost, and after that, I see continuing messsages of: W/SurfaceComposerClient(17910): lock_layer timed out (is the CPU pegged?) layer=2, lcblk=0x420d0120, state=000e (was 000e) Is there any way around this? Am I being to mean with my rotations? On Jul 21, 1:12 pm, Dianne Hackborn hack...@android.com wrote: Have you made sure your SurfaceView UI is actually drawing regularly, and especially redrawing itself as soon as possible with the new size? On Wed, Jul 21, 2010 at 8:02 AM, Matty busbus...@gmail.com wrote: Thanks for the quick response Dianne. I have an activity that uses OpenGL, and if I rotate at just the right time, the log prints W/SurfaceComposerClient( 749): lock_layer timed out (is the CPU pegged?) layer=2, lcblk=0x420d0120, state=000e (was 000e) I basically don't want the Activity to hang. I'm using a plain android.opengl.GLSurfaceView. There are 2 activities involved. A,B. B is started from A using startActivityForResult, and is translucent. On rotate, both finish, and then I start A (which might work) which then starts an intent for B. If I rotate at the right time, I see the message above, and sometimes Activity A draws properly, but usually not quite (only draws some of the screen, or a rotated version of the opposite orientation), and it seems like B is somehow blocked because of the message above. Activity B has the GLSurfaceView. Any advice is greatly appreciated. On Jul 21, 9:22 am, Dianne Hackborn hack...@android.com wrote: What problem is this causing you that you are trying to fix? On Wed, Jul 21, 2010 at 5:47 AM, Matty busbus...@gmail.com wrote: I have looked through many posts on this issue, and I've concluded that there's not much I can do to prevent it... I am able to reproduce this error when repeatedly rotating an Activity that uses OpenGL. W/SurfaceComposerClient( 749): lock_layer timed out (is the CPU pegged?) layer=2, lcblk=0x420d0120, state=000e (was 000e) For reference: I'm calling GLSurfaceView.onPause() and onResume() on activity pause and resume... My question is: Can I detect this error in my java code, so I can try to do something extra to correct it? Is there an ErrorListener, or an object I can access to find out about when this occurs? I have tried ((EGL10) EGLContext.getEGL()).eglGetError(); but does not report an error. I'm guessing I'd need some sort of Surface object? -- 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.comandroid-developers%2bunsubscr...@googlegroups.com android-developers%2bunsubscr...@googlegroups.comandroid
[android-developers] Re: Using a Handler in this code?
I'm not sure why you can't just use a thread (no handler)? If you do need a handler, you can just create a new runnable, and post it to the handler with something like: new Handler().post(new Runnable(){ public void run(){ image = new GLCamTest().extractimage(q); } }); (Obviously, the code above isn't perfect, but hopefully it helps); On Jul 20, 9:28 am, Aidan C aidanchu...@gmail.com wrote: Hey guys, I've got 2 classes `GLLayer` and `GLCamTest`. I'm attempting to run a method located in `GLCamTest`... public Bitmap extractimage(int pos){ LocationData tweets; tweets = new LocationData(this); SQLiteDatabase db = tweets.getWritableDatabase(); //select the data String query = SELECT * FROM tweets;; Cursor mcursor = db.rawQuery(query, null); //Move to Position specified. mcursor.moveToPosition(pos); //get it as a ByteArray byte[] imageByteArray=mcursor.getBlob(7); //the cursor is not needed anymore mcursor.close(); //convert it back to an image ByteArrayInputStream imageStream = new ByteArrayInputStream(imageByteArray); Bitmap theImage = BitmapFactory.decodeStream(imageStream); return theImage; } I'm looking to run in on a thread from `GLLayer` but from what I understand I need a Handler.. public void run() { GLCamTest cam = new GLCamTest(); image = cam.extractimage(q); } I'm starting the Thread from within `public void onDrawFrame(GL10 gl) {` my question is how would I implement said handler? I've readhttp://developer.android.com/reference/android/os/Handler.htmlbut I still don't really understand how I'd implement it. could someone help me out? -- 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: Where is source code (or git file) for ContactsContract.QuickContact
I see ContactsContract here: http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/provider/ContactsContract.java But I don't see a QuickContact... On Jul 15, 5:33 pm, Agus agus.sant...@gmail.com wrote: Hi all, What is the .git file corresponding to ContactsContract.QuickContact class? Agus. -- 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: debugging just the apk file
As a developer, I often find it useful enough if I get a logcat dump with a crash or bug. More information can be found about 'adb logcat' here: http://developer.android.com/guide/developing/tools/adb.html On Jul 14, 8:59 pm, rahul jain jainwolver...@gmail.com wrote: Hi there ! I am not sure how is this possible ?. But we would like to debug the apk files without having the source code (source code lies with developers). But if something breaks I would like to report it to the developers. We would like to report the crash logs and the normal info about the app. Rahul -- 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: Button pressed color
What are your custom buttons? Why not make them extend the Button class so you inherit the default behavior? I have created some default buttons, but I only did so to selectively override default behavior. Try inspecting (new Button(this)).getBackground(); and see if that helps you. On Jul 14, 8:52 am, Ajay aja...@gmail.com wrote: Hi, Is there a way I could get the color that is used when a button is pressed? I know that the button uses a default selector xml that consists of the pressed image. But, I am having some custom buttons for which I want it to be close to the default image used for pressed state. Thank you, AJ -- 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: Force an Application to be alive
I believe you might want to use a service. http://developer.android.com/reference/android/app/Service.html On Jul 13, 3:49 am, perumal316 perumal...@gmail.com wrote: Hi All, I am writing an application to do fileobservation which can be done. Is there any way I can make the application to run in the background without killing it? Unless user restart the phone. Is there any way to do it? Thanks In Advance, Perumal -- 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: Button Long Click to increase Numeric Text View
I do something similar... onLongClick - Start a thread/timer in Timer/Thread - increment value, reschedule timer onTouchListener.OnTouch() - detect MotionEvent.ACTION_UP and stop the timer Hope that helps, sounds like you're on the right track. On Jul 13, 5:48 am, Kris Skarbø kris.ska...@gmail.com wrote: Thanks for the response. But I forgot to mention the part that: I want the numeric to increase, say 1 value pr 1/2 sec, while I hold down the button. -- 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: Support ECIES encryption?
I don't think it's natively supported... But there's some sample java code here: http://www.flexiprovider.de/examples/ExampleECIES.html Might not help, I think they use 3rd party libraries, but perhaps it's a good place to get started. On Jul 13, 5:58 am, ricos rigc8...@gmail.com wrote: Hello. Does Java API of Android support the ECIES encryption? If it is, can anyone inform the reference or sample code for it? Regards, Ricos. -- 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: Block Text
I'm not exactly sure why you would want to do this... What are you doing with calls? Maybe you can get away with turning off/disabling all radios? (I don't know how feasible this is). Maybe you just want to block the notifications, and not the actual messages? On Jul 12, 4:54 pm, ranjan ar ranjan@gmail.com wrote: Hello, I want to block incoming and outgoing Text (as well as email). I am using the broadcast receiver that is not blocking the text but its blocking the outgoing calls. Can some one help me. Thank you. Here is the piece of code that blocks the SMS. - public void onReceive(Context context, Intent intent) { mContext=this; String actionType = intent.getAction(); if ((actionType.equals(Intent.ACTION_SEND))) { setResultData(null); // I tried with abortBroadcast(); this didn't work either } } --- My androidmanifest has all the permissions required. -- 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: drawing lines on top of a image view
If you want to draw on top of an ImageView, I would extend it and override it's onDraw method. This provides you a [relative] canvas to draw on. Just be sure to call super.onDraw() if you want the image to show up also. On Jul 13, 11:23 am, Jags jag...@gmail.com wrote: I am trying to put a background image and draw on top of that screen. I assumed activity will have a on draw method, but it does not have. it seems i need to use surfaceview. Can I put a surfaceview on top of the image view and make it transparent ? any example/tutorial i can refer to ? -- 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: OpenGL texture wrapping flickers. Why?
I was able to solve this... I was calling the texture wrapping code on every draw, right before I bound the texture. Now, I set the texture parameters when the textures are generated, and I don't need to specify wrapping every time I draw a shape... No more flicker, and the code is probably more efficient. -- 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: Theme.NoTitleBar.Fullscreen not working when other activities use a custom title?
I found the solution here: http://groups.google.com/group/android-developers/browse_thread/thread/2de77043f32835aa/f2a1357bf1335461 It's basically: Add the following to your activity: getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); -- 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 define some smart layout?
This simple layout seems to work for me: ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/android; android:layout_width=fill_parent android:layout_height=fill_parent android:orientation=vertical android:gravity=center ListView android:id=@+id/ListView01 android:layout_width=fill_parent android:layout_height=fill_parent android:layout_weight=1 / Button android:text=@+id/Button01 android:id=@+id/Button01 android:layout_width=wrap_content android:layout_height=wrap_content / /LinearLayout On Jul 9, 5:35 am, Jeruliu jeru@gmail.com wrote: I will have a list view on the top and a button on the bottom in the view. Regardless the height of the list view i would like to fix the button position on the bottom all the time. If the list view is too long then make it scrollable. How to do this? 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] OpenGL texture wrapping flickers. Why?
I'm drawing 5 rectangles with OpenGL. They are texture mapped, and use the following parameters/binding: ... gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE); gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE); gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[textureid]); ... I then draw them like this: ... gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, smallTexBuffer); gl.glDrawElements(GL10.GL_TRIANGLE_FAN, VERTS, GL10.GL_UNSIGNED_SHORT, mIndexBuffer); ... When I start the activity, the shapes all flash as if the textures were supposed to wrap (ie, i see more than one texture per shape), then the screen quickly corrects itself. Is there some manual buffering I'm supposed to do while the textures get mapped and unwrapped? -- 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] Theme.NoTitleBar.Fullscreen not working when other activities use a custom title?
My test involves 2 Activities, one with a GridView, and one with a ListView. The GridView is defined as Theme.NoTitleBar.Fullscreen and works great on first launch. The ListView defines a custom title bar using: getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.titlebar); The app starts and you are presented with a GridView. For simplicity I added one item: http://picasaweb.google.com/lh/photo/twm8eQBvUAQcajNr5Z5RRQ?feat=directlink If you click the item you go to a ListView: http://picasaweb.google.com/lh/photo/sFI7SNMjIC0iXjmxQVqKLg?feat=directlink Now when I click back I'm back at the first Activity. If I press up on the dpad I can scroll up: http://picasaweb.google.com/lh/photo/eRx06OVXFtPccmtgT_b0pw?feat=directlink Is this because of the custom title? Can anyone give me advice to avoid this? -- 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: Smooth Image Rotation with Gesture Control?
You should be able to override onDraw, and draw the bitmap using something like: canvas.drawBitmap(bitmap, matrix, paint) I haven't used drawBitmap with a matrix before, but you can check out some more info here: http://www.anddev.org/resize_and_rotate_image_-_example-t621.html You should be able to use a GestureDetector to control when it spins, etc. It might be easier to do this in OpenGL, but I think it's definitely possible with just Canvas if you're not familiar with OpenGL. Hope that helps. On Jul 5, 11:49 pm, ocdtrekkie jtn...@gmail.com wrote: Ah crud, now I feel fairly stupid. ;) People responded and I didn't see it and posted a seperate request. I'm gonna upload the design document for it, I've got the UI designed, I just can't figure out how to program it so it will behave right. I've read a lot of examples/tutorials/help things regarding image rotation, but I haven't seen anything that's the same sort of thing, even though I would imagine it's a fairly simple idea. http://imgs.ocdtrekkie.com/MobileDHDConcept2.jpg This is only a portion of the UI, but it's the one I need help with. Basically I have a fancy circular image (it's a ring), and I want to situate it about there on the screen, and then let people rotate it with their finger. (Only a certain portion of the ring will be visible on screen at a time, as you can see). Looking at the different Layout formats though, I'm wondering if I have to go to OpenGL for something like this, or if it can be done without it. (Oh, TreKing, I just looked at your site... and I will use your app next time I go into the city for sure, I live in the Chicago suburbs, and public transit here baffles me. ;) ) On Jun 24, 10:38 am, TreKing treking...@gmail.com wrote: On Fri, Jun 18, 2010 at 12:01 AM, ocdtrekkie jtn...@gmail.com wrote: Can anyone help get me started? I can program all the logic I need for my program really well, I just need some help with designing the UI to function the way I want it to. What exactly do you expect us to do for you? How are we supposed to help you design a UI for your app? - 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: organizing the code
Well, as far as I can tell, the only error-handling you're doing in that whole block is to set picvalues to an empty object if you get a JSONException... If all you're going to do on Exception is log a message, there's probably no reason to call out each Exception seperately. You can Log each step that might throw, and wrap the whole method in a try/catch. You'll still be able to pull out specific types of Exceptions if you need to... Maybe something like this: public void something() { try { nameValuePairs.add(new BasicNameValuePair(id, picId)); InputStream content = null; HttpClient httpclient = new DefaultHttpClient(); HttpPost httpPost = new HttpPost( http://www.pedroteixeira.org/thennnow/alg_showpopup.php;); httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); response = httpclient.execute(httpPost); content = response.getEntity().getContent(); StringBuilder sb = new StringBuilder(); String line; BufferedReader reader; reader = new BufferedReader(new InputStreamReader(content, UTF-8)); while ((line = reader.readLine()) != null) { sb.append(line); String pic_values = sb.toString(); try { picvalues = new JSONArray(pic_values); } catch (JSONException e) { // TODO Auto-generated catch block picvalues = new JSONArray(); // just so it's not null. } } } catch (JSONException je) { picvalues = new JSONArray(); } catch (Exception e) { Log.d(TAG, Exception: + e); } } On Jul 7, 6:03 am, Pedro Teixeira pedroteixeir...@gmail.com wrote: I'm having a hard time keeping my code clean... mainlly because all the try's and catches... I'm simple doing an HTTP request on which the response is then converted to JSON Array.. but now it's a mess of {}'s .. is there anyway to agregate all this try and catches? The code really looks bad and unreadable like this... and worst, it's executing correctly because I'm not finishing in the correct places.. nameValuePairs.add(new BasicNameValuePair(id, picId)); InputStream content = null; HttpClient httpclient = new DefaultHttpClient(); HttpPost httpPost = new HttpPost(http://www.pedroteixeira.org/ thennnow/alg_showpopup.php); try { httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); } catch (UnsupportedEncodingException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try { response = httpclient.execute(httpPost); } catch (ClientProtocolException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try { content = response.getEntity().getContent(); } catch (IllegalStateException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace();
[android-developers] Complete Newbie - Looking for some help :)
Hi there. Well i decided today that I want to create a very simple app to compliment my website at http://www.gameworldplus.com. I basically want to make a simple app with nice looking buttons, leading to the different areas of help/tutorial, then work from there. I have installed everything need, Eclipse etc and have made my first hello world app in the process. I am no stumped as to where to go next. So hoping for some friendly advice :) Cheers Matt -- 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