[android-developers] Re: Failed binder transaction when passing byte[] (from camera) between intents
So I can never make camera images that are higher resolution then 277x184? :S If I stuff all the camera code into my main activity, then it should work. But that's a little messy. Are you sure there isn't another way to pass the camera images? Thanks On Feb 16, 10:05 pm, Streets Of Boston flyingdutc...@gmail.com wrote: Binary data works upto about 100KByte. Anything larger, you very likely get that error. For images in RGB_565, this is about 277 x 184 pixels max (277 x 184 * 2 = 101936) On Feb 16, 4:17 am, Bart bvandep...@gmail.com wrote: Hi, I have a problem with an app that lets the user take a picture. I've posted it on some forums already, but nobody seems to recognize the problem. Hopefully someone here knows a solution :) I've put the code of taking a picture in a seperate activity. Then I call the camera intent from my main activity using activityForResult. In the camera intent, I use putExtra to return the camera image (as a byte[] without doing anything to it). But when the program transitions back from the camera intent to the parent intent that called it I get aFailedBinderTransaction error in the logcat because the byte[] is too big. But I don't understand this, because the image is not even taken using the maximum resolution :S The code of my camera intent is: package example.imaging.ape; import java.io.IOException; import java.util.Iterator; import java.util.Set; import android.app.Activity; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.PixelFormat; import android.hardware.Camera; import android.hardware.Camera.AutoFocusCallback; import android.os.Bundle; import android.util.Log; import android.view.MotionEvent; import android.view.SurfaceHolder; import android.view.SurfaceView; import android.view.View; import android.view.Window; import android.view.WindowManager; import android.view.View.OnTouchListener; public class TakePicture extends Activity implements SurfaceHolder.Callback{ Camera mCamera; Boolean mPreviewRunning = false; int imageLayoutHeight; int imageLayoutWidth; �...@override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //setup camera surface getWindow().setFormat(PixelFormat.TRANSLUCENT); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.cameralayout); SurfaceView mSurfaceView = (SurfaceView) findViewById(R.id.hist_surface_camera); SurfaceHolder mSurfaceHolder = mSurfaceView.getHolder(); mSurfaceHolder.addCallback(this); mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); Bundle extras = getIntent().getExtras(); imageLayoutHeight = extras.getInt(layoutHeight); imageLayoutWidth = extras.getInt(layoutWidth); OnTouchListener touchListener = new View.OnTouchListener() { public boolean onTouch(View v, MotionEvent e) { System.out.println(MAKING PICTURE); mCamera.autoFocus(cb); return false; } }; //setup touch listener mSurfaceView.setOnTouchListener(touchListener); } AutoFocusCallback cb = new AutoFocusCallback() { public void onAutoFocus(boolean success, Camera c) { c.takePicture(null, null, mPictureCallback); } }; Camera.PictureCallback mPictureCallback = new Camera.PictureCallback() { public void onPictureTaken(byte[] imageData, Camera c) { System.out.println(Picture taken, now returning); Intent resultIntent = new Intent(); resultIntent.putExtra(cameraImage, imageData); System.out.println(put Extra); setResult(Activity.RESULT_OK, resultIntent); finish(); } }; //initialize camera public void surfaceCreated(SurfaceHolder holder) { mCamera = Camera.open(); } public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) { if (mPreviewRunning) { mCamera.stopPreview(); } Camera.Parameters p = mCamera.getParameters(); p.setPreviewSize(h, w); System.out.println(PreviewSize: + h + , + w); p.setPictureSize(h*3,w*3); // is around 1200x900 p.set(rotation, 90); mCamera.setParameters(p); try { mCamera.setPreviewDisplay(holder); } catch (IOException e) { e.printStackTrace(); }
[android-developers] Re: android.bluetooth.a2dp.intent.action.SINK_STATE_CHANGED
Hi. If the bluetooth headset is connected, system send this intent. android.bluetooth.intent.action.HEADSET_STATE_CHANGED So you can receive that and get extra information. For extracting extra information, use this intent. android.bluetooth.intent.HEADSET_STATE Through this you can get bluetooth headset connection state. disconnected, connecting, connected. I'm not sure my answer satisfies your question. On 1월15일, 오전5시19분, Alex Corbi a.co...@gmail.com wrote: Hi Nick, Can you tell me please which devices use ACL Connections, do common bluetooth handsfree devices (like the ones present in cars ) use this transfer protocol? I am researching this to implement a new functionality on my app Voice Alerts (+info -http://49ers.es/corbi/voice-alerts) so the app activates automatically when the phone gets connected with a bluetooth headset or car system. i appreciate the help, Best regards.. Alex. On Jan 12, 5:01 am, Nick Pelly npe...@google.com wrote: On Mon, Jan 11, 2010 at 5:27 PM,AlexCorbia.co...@gmail.com wrote: Hi Nick, Thanks for your answer. What i am trying to do is to detect when a bluetooth headset device connect to the phone so my app can react to this event. is there an alternative? For the requirement you stated there is no public API option. But maybe you can explain what your app wants to do when a BT headset connects, and I might know a better option. For example ACL_CONNECTED will tell you when a low level ACL connection is established and is part of the public API. Alex On Jan 11, 6:17 am, Nick Pelly npe...@google.com wrote: On Mon, Jan 11, 2010 at 7:40 AM,AlexCorbia.co...@gmail.com wrote: HI everybody, im currently looking for the way that my app knows when the phone has being paired and connected to a bluetooth headset device. I read something about this intent, but not on the Reference documentation ofhttp://developer.android.com android.bluetooth.a2dp.intent.action.SINK_STATE_CHANGED is this actually working, is it officially supported. I mean, can we just register a broadcastreceiver to handle this intent , check for the EXTRA_STATE string extra to see if it equals STATE_CONNECTED and be sure that the phone is now connected with a bluetooth headset device ??? What about this BluetoothA2dpService class?? There is no official documentation about this, everything i found i from code snippets of the android OS source code. What do you guys think about this? It's not part of the official Android API. So it is very dangerous to use, since it can (and probably will) break in a future OTA. It might not work at all on some Android devices, since Android devices are only required to implement the official API. There is currently no way to determine if a Bluetooth device is connected to the built-in Bluetooth headset service through the official API. If you can explain what you are trying to do, I might be able to suggest a better alternative? Nick -- 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] online jobs
Best Online Job, Best way to Earn Money, Earn Money Online Opportunity, Opportunity Make Money At Home, Creative Ways to Make Money, Earn Extra Money At .. = http://www.adbrite.com/mb/commerce/purchase_form.php?opid=1003278afsid=1 http://deve12.regeasy.hop.clickbank.net/ http://www.cuteonly.com/?a_aid=bcc2d3c1a_bid=d75df85d http://secure.bidvertiser.com/performance/bdv_rd.dbm?enparms2=1152,492129,986423,1103,1202,1162,1197,1186,1344,1107,1300,497761,176068,56634,1102,1102,126288385ioa=0ncm=1bd_ref_v=http://operationalrisk.50webs.com/TREF=1WIN_NAME=nullfrdto=jloc=http://bdv.bidvertiser.com/bidvertiser.dbm%3Fpid%3D201326%26bid%3D491027%26RD%3D14%26DIF%3D1%26bd_ref_v%3Dhttp%253A//operationalrisk.50webs.com/%26tref%3D1%26win_name%3Dnull%26docref%3D%26jsrand%3D594698%26js1loc%3Dhttp%253A//operationalrisk.50webs.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
Re: [android-developers] what is pending intent?
Notifications are best examples for Pending intent. Check apidemos. On Wed, Feb 17, 2010 at 1:00 PM, saru sarucs...@gmail.com wrote: Hi, Please clarify me What is Pending Intent with an example. -- 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 -- 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] read mail and get money
Best Online Job, Best way to Earn Money, Earn Money Online Opportunity, Opportunity Make Money At Home, Creative Ways to Make Money, Earn Extra Money At .. = http://www.adbrite.com/mb/commerce/purchase_form.php?opid=1003278afsid=1 http://deve12.regeasy.hop.clickbank.net/ http://www.cuteonly.com/?a_aid=bcc2d3c1a_bid=d75df85d http://secure.bidvertiser.com/performance/bdv_rd.dbm?enparms2=1152,492129,986423,1103,1202,1162,1197,1186,1344,1107,1300,497761,176068,56634,1102,1102,126288385ioa=0ncm=1bd_ref_v=http://operationalrisk.50webs.com/TREF=1WIN_NAME=nullfrdto=jloc=http://bdv.bidvertiser.com/bidvertiser.dbm%3Fpid%3D201326%26bid%3D491027%26RD%3D14%26DIF%3D1%26bd_ref_v%3Dhttp%253A//operationalrisk.50webs.com/%26tref%3D1%26win_name%3Dnull%26docref%3D%26jsrand%3D594698%26js1loc%3Dhttp%253A//operationalrisk.50webs.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: Push Notification API
Just saw this one, http://www.xtify.com/, i didn't test it yet. On 1 fév, 19:58, Kevin Duffey andjar...@gmail.com wrote: What sort of push notification API are you looking for? On Mon, Feb 1, 2010 at 10:42 AM, nikhil nik...@gmail.com wrote: No On Jan 30, 11:22 pm, Alie Lee alie@gmail.com wrote: Hi, Is there any push notification API for Android... I tried search with Google but couldnt find any. Regards, Alie -- 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 -- 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 to get raw video frames?
Hello, I am trying to get the raw video frames from the camera. Is there any other way than using startPreview and setPreviewCallback method? Is there anyway we can get the raw video frames at the native layer using similar approach using direct C++ classes? Thanks in advance. Vishal -- 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 to convert Android application to Droid Mobile application?
Hi, i have developed the application in android and i installed the application in to HTC magic mobile , it's working good. but i want to install same application in Droid mobile(480x854 px) , shall i need to modify any code for that? Regards, Jeyavel N +91 964-289-8190 -- 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 to disable USE_OMX_ENC_NODE for opencore
Hi, There is a autogenerated file pv_config.h under eclair/external/ opencore/build_config/opencore_dynamic which has #define USE_OMX_ENC_NODE 1 by default. I want to use software video encoder for my camera video recording. for that I need to set #define USE_OMX_ENC_NODE 0 Which file I need to make it so that the autogenerated file pv_config.h have the changes reflected? Who generates this file? Also, there is an entry of USE_OMX_ENC_NODE in pv_config_derived.mk Thanks in advance, Sachin Nikam Pune, India. -- 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: Appwidget with fast updating needed ...
That actually shouldn't be all that bad -- just disable the updates in ACTION_SCREEN_OFF (and onStop()) and re-enable them in ACTION_SCREEN_ON (and onStart()). Yup - this is the idea - my appwidgets does not need updates when the device is locked or something - no need for wakeup. Like the analog clock - that one doesn't wakeup the phone every second as far as I know. I'm working on gauges which are using real data taken from sensors or other sources - update is needed only when the screen is on. Something like the analog clock but having a voltmeter for example. I know this is not for phones but our aproach is also pretty different - we are working on a platform too which ain't be a phone and it will always have power source - in that case battery is not an issue. And I know that this aproach might be a new one for Android since as far as I've seen most of the developers writing here are developing for phones - which is kinda bad for us since Andoid is pushed more and more in very specific directions but I guess that's it - we have to deal with what we have :) I will digg into homescreens and I might try the service with intent from JP's solution too - in some cases 1 second update like the clock is might be good enough - TY for the tips ... -- 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: USB driver doesn't work with Xperia 10
i am able to connect my HTC magic but still struggling with xperia 10 t connect with debugger. On Feb 16, 1:06 pm, Jonas Petersson jonas.peters...@xms.se wrote: zeeshan wrote: Thanks for your reply Jonas, i am using Windows 7. got the USB driver revision 3 by Android setup but it doesn't work with my device Can't help you there - I've only used Windows 7 for as long as it took me to figure out the hardware details needed to install Ubuntu ;-) (And that was not even needed in the end since everything worked out of the box.) Good luck / Jonas -- 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: Custom BaseAdapter + dynamic updates = crash in ListView layout
On Tue, Feb 16, 2010 at 10:47 PM, whicken whic...@gmail.com wrote: Here's my GroupedListAdapter class, if that helps any - I added the getStableIds returning false in case there was any extra caching going on: Here's a question - what's the purpose of this adapter? What kind of layout / functionality are you trying to achieve? It looks to me like you're reproducing the ExpandablistList functionality in a very strange way. First suggestion would be to stick a break point in every single function and see what gets called and in what order. Also throw in some logging to make sure your logic is correct in each and every function. Beyond that I would strongly suggest reworking this class. Maybe take a look at BaseExpandableListAdapter instead of the BaseAdapter? Or at least create an object that represents a single header with some sections and delegate some of the functionality to it instead of maintaining two lists and trying to do the indexing yourself in the one class. That's bound to get confusing. - 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: How to play a media file on emulator
hey hiii I didnt get u u mean to say dat the prob is wid the emulator actually my code looks lyk dis ---i hav saved my audio file on server... n den runnig dis code MediaPlayer m=new MediaPlayer(); m.setDataSource(path); //path is a String variable containing the path of audio file stored on server side m.prepare(); m.start(); Error it shows isjava.io.IOException:Prepare Failed:status=0x1 can u plzz tell dat this error is coming bcozz dere is some problem with the emulator. On Feb 4, 10:37 am, prachi prachi.tya...@wipro.com wrote: Hey hii all I hav a code toruna start a media player a play anaudiofilesaved in my local disk.But the code is not running and it is showing an exception: PlayerDriver PVMFInfoErrorHandlingComplete Plzz 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] SurfaceView, transparency, bringtofront/bringchildtofront issues
Hi From what I understood SurfaceView is like an opengl or directx surface for windows therefore transparency will never be an option for those. Diane's old post: The surface view is actually BEHIND your window, and a hole punched in the window for you to see it. You thus can put things on top of it in your window, but nothing in your window can appear behind it. My question is - is there a method which is fast enough to have 10+ frames/second except SurfaceView and permits transparency? Using drawables can make this happen? Or I simply should forget high fps and transparency together? Another issue is related to bringtofront/bringhildtofront - they are not working with SurfaceViews or I'm using them wrong ... In my case there are two surfaceview's which are draggable - when I drag one of them I want to be on the top always till it's dragged. Calling bringtofront to the dragged view or bringchildtofront(view) for it's parent layout has zero result. The views are updated in the same order as they was added to the layout and the result is that the dragged object is dragged behind other objects which is ugly. This is also because I use SurfaceView's or that functionality is not working yet? regards, Brown -- 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] (TabActivity) How to switch tab from within a sub activity
Hi, I'm currently working on an application, designed around a TabActivity. It look like this: Main (TabActivity) - Tab1 (Activity) - Tab2 (Activity) Here, Tab1 has a button and I would like when the user click it, it switches to Tab2... How can I do that ? Thank you -- 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 2.1 r1 calender and music player not launching
Hello, i downloaded androidn 2.1 R1 from eclair branch and compiled. Music player and calender applications are not launching. Have any one faced this issue and is there fix available -vinay -- 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: Failed to fetch URL https://dl-ssl.google.com/android/repository/repository.xml
no you're wrong. it works from inside eclipse. and that's the solution to the problem so the program that comes up when just typing 'android' from command line is not good. the developer for that made a crap program. and truly the community has helped me so much in the past that i have the right to assume the problem solved after 56 discussions or so and my expectations are not at all unrealistic. thanks for taking your time and writing all this Bob. my apologies for 'bad behavior' and 'shame on' lines. On Feb 16, 2:00 am, Bob Kerns r...@acm.org wrote: It seems you have quite unrealistic expectations of the community, and aren't even willing to help yourself. Let's see here: 1) Your sysadmins block direct web access to the Internet 2) You route your web requests through some unknown piece of software using one of several protocols to forward your requests, and 3) You expect the community to fix it all up for you? Who's being selfish? I have a solution for you: stop blaming the community. We can't help you with any of that. Talk to your sysadmins. They CAN help you. They may not be willing to. That doesn't make them the bad guys, either; I don't know their situation. But at least the have all the facts available to them, and access to investigate and fix. Finally: it would take you all of 2 minutes to look at repository.xml, and choose the download URL you want from that file. Just replace 'repository.xml' with the appropriate sdk:url.../sdk:url value. If you want to help yourself -- go home, or to a public library or a coffee shop or something, and download it onto a USB key. I think I can safely speak for the community, when I say the community doesn't like being flamed for things that are not the community's fault. On the other hand -- if, in the course of your investigations, you have SPECIFIC questions, with sufficient context, we're still glad to answer. The community doesn't hold grudges, much. Ashish Srivastava wrote: This is really bad behavior. None of you are trying to solve the problem for people with Proxy + Authentication enabled. It's really that people are being truly selfish. Shame on the community. On Jan 4, 9:31 am, teryz teryzpl...@gmail.com wrote: I have a problem using AndroidSDKUpdater (revision 4). For the record I'm under win xp 32-bits, jdk 1.6. I set up the Force https://... sources to be fetched using http:// This seemed to work fine but as I am behing a (corporate)proxyI also filled theproxyserver and port settings, however thisproxyrequires a user/passwordand I can't find a way to give Android Updater aproxy authentication as no authentication box pops up when I try downloading updates and I have a response code: 407 for URL:http://dl-ssl.google.com/android/repository/repository.xml; when refreshing sources. If someone can help... Teryz. On 4 déc 2009, 09:30, Cédric Berger cedric.berge...@gmail.com wrote: 2009/10/29 Cédric Berger cedric.berge...@gmail.com: 2009/10/29 Cédric Berger cedric.berge...@gmail.com: I can't download through aproxyrequiring authentication. I had to select force http, and put user/passwordforproxyin JVM command line. This way I can get the list of available updates. But when trying to download, it stays stuck (looks like it waits for user/password, but no prompt). Oh in fact it is ok. Through a secondproxy(with authentication too) it worked. Looks like the firstproxy(a bit more restrictive) blocked the downloading url. (I could not check why since the URL is not shown) What is the download URL ? Because I still have problems with theproxyI use. I can download updates metadata, but when trying to install, it hangs. I suspect theproxyblocks the download URL (but nothttp://dl-ssl.google.com/android/repository/repository.xml)... how can I check what this download url is (so I could ask for correction in theproxyrules) ? -- 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] Using ContentResolver to add a contact in the mobile
Hello, I'm trying this code and it's getting stopped in the getContentResolver statement ContentValues values = new ContentValues(); values.put(People.NAME, hola); Uri uri = getContentResolver().insert(People.CONTENT_URI, values); What am I doing bad? 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] bluetooth discoverable
Hello, I need to set bluetooth service discoverable till my application is running, how to do that in android 2.0 above -- 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: Intent filters + prevent creation of multiple activity instances?
Mark Wyszomierski wrote: To clarify: MyApp::ActivityA is running Browser launches new MyApp::ActivityA instance. Inside the new instance of MyApp::ActivityA, I want to be able to see that there is already a previous instance of MyApp::ActivityA running, close myself, and bring it to the foreground. Is that possible? Check the various android:launchMode values for the activity element in the manifest to see if one fits your situation. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Training...At Your Office: http://commonsware.com/training -- 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] (TabActivity) How to switch tab from within a sub activity
ColletJb wrote: Hi, I'm currently working on an application, designed around a TabActivity. It look like this: Main (TabActivity) - Tab1 (Activity) - Tab2 (Activity) Here, Tab1 has a button and I would like when the user click it, it switches to Tab2... How can I do that ? setCurrentTab() -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Training...At Your Office: http://commonsware.com/training -- 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] How to convert Android application to Droid Mobile application?
Jeyavel Natesan wrote: i have developed the application in android and i installed the application in to HTC magic mobile , it's working good. but i want to install same application in Droid mobile(480x854 px) , shall i need to modify any code for that? Maybe, maybe not. It all depends on how you wrote your user interface. I'm serializing a chapter from one of my books on this topic over the next couple of weeks at AndroidGuys. Here's the first post: http://www.androidguys.com/2010/02/16/handling-multiple-screen-sizes-part/ -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Training...At Your Office: http://commonsware.com/training -- 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: Move buttons within Layout
I'm still stuck on this problem. I tried to solve it by making the whole activity dynamic. But still the button is positioned at top left. I can't see why ok.layout(k.getLeft(), k.getTop(), k.getRight(),k.getBottom()); isn't repositioning the button, even if it shows the right Values on LogCat. I really need some help on that ! On 10 Feb., 14:35, Kritzli pfister.ta...@googlemail.com wrote: Ok. Here's some more information about my App. I'm going to create a keyboard app. Or rather an App where you can define your own keyboard. Therefore I have two Activities A and B. Activity A: Here I want to create a single key. This is currently realized by configuring a button. The buttons size can be customized with a progress bar. One for height and one for width. Also some letters/text can be added. Then, height, width and the text of the button is send via an Intent to Activity B. Activity B: On Activity B the current Button gets its properties out of the Intent and via Gesture you can set it somewhere on the screen. Afterwards the button get saved in an Arraylist. Everytime I call Activity B the Arraylist is read and the buttons should be shown on their position as before defined. So the screen should be filled with buttons until the keyboard is ready. Then I want to create the keyboard (but I have no idea how yet ;) ) But as mentioned before, after reading the Arraylist the buttons loose their position. And here's the whole code of Activity B: package example.com.fpa; import java.util.ArrayList; import java.util.Iterator; import android.app.Activity; import android.content.Intent; import android.gesture.Gesture; import android.gesture.GestureLibraries; import android.gesture.GestureLibrary; import android.gesture.GestureOverlayView; import android.gesture.Prediction; import android.gesture.GestureOverlayView.OnGesturePerformedListener; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup.LayoutParams; import android.widget.Button; import android.widget.RelativeLayout; import android.widget.Toast; public class keyboard_view extends Activity implements OnGesturePerformedListener { protected Button key_button; protected GestureLibrary mLibrary; // protected keys other_keys; protected int position; public static ArrayListButton keyList = new ArrayListButton(); public Iterator iter; public static RelativeLayout rel_layout; /** * @param args */ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.keyboard_view); final Intent intent = new Intent(this, fpa.class); rel_layout = new RelativeLayout(this); final Button back_button = (Button) findViewById(R.id.back_button); final Button accept_button = (Button) findViewById(R.id.accept_button); key_button = (Button) findViewById(R.id.key_button); mLibrary = GestureLibraries.fromRawResource(this, R.raw.gestures); if (!mLibrary.load()) { finish(); } GestureOverlayView gestures = (GestureOverlayView) findViewById(R.id.gestures); gestures.addOnGesturePerformedListener(this); key_button.setHeight(getIntent().getExtras().getInt(height)); key_button.setWidth(getIntent().getExtras().getInt(width)); key_button.setText(getIntent().getExtras().getCharSequence(letter)); back_button.setOnClickListener(new OnClickListener(){ public void onClick(View v){ //Perform action on clicks intent.putExtra(height, key_button.getHeight()); intent.putExtra(width, key_button.getWidth()); startActivity(intent); } }); accept_button.setOnClickListener(new OnClickListener(){ public void onClick(View v){ //Perform action on clicks keyList.add(key_button); intent.putExtra(height, key_button.getHeight()); intent.putExtra(width, key_button.getWidth()); startActivity(intent); } }); if(keyList.isEmpty() == false){ for (iter = keyList.iterator(); iter.hasNext();){ Button k = (Button) iter.next(); Button ok = new Button(this);
[android-developers] Home Screen Customization problem
Hi all, I am trying to customize the Android HomeScreen by adding some TextView some other Views on it. the Problem is i m not able to do it. I tried some thing but ended up it for all the home screens. what i want is to put the different things(views) on different HomeScreens. How is it possible?? anybody knows how to do it? please suggest.. thnks, satish -- 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] Example that redraws on a key without using a thread?
Howdy android experts. I thought I knew something about programming lots of experience with microcontrollers and embedded simulations that run in a loop and read inputs, do some calcs, send outputs. After days of trying to write a program that prints out a count that increments with a key, I guess I know nothing of how the windows event driven model operates. I see examples that use another thread/task/program to accomplish what I thought would be a couple of lines. After the onCreate, lets say the screen says 'count 0'. The os is now running. right? Any click or key should get 'delivered' to the activity, so it seems I could have an onClick that says count++ and a setText or something and an invalidate, and Bob's Yer Uncle, but noo it aint that easy. I hereby declare that this task is impossible, and no one can show me how to do it. (trying to use reverse psychology as a motivational tool... 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
Re: [android-developers] Re: Move buttons within Layout
Kritzli wrote: I'm still stuck on this problem. I tried to solve it by making the whole activity dynamic. But still the button is positioned at top left. I can't see why ok.layout(k.getLeft(), k.getTop(), k.getRight(),k.getBottom()); isn't repositioning the button, even if it shows the right Values on LogCat. I really need some help on that ! Moving a widget requires altering the layout rules that control where the widget is, via the appropriate *.LayoutParams object. -- 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: power down
Hi, In Eclair 2.1 i am not able to power down the device. Is there any patch available? please help Thanks Kabita On Feb 11, 12:20 pm, Kabita san.k...@gmail.com wrote: hi, in framework.. i am not able to find shutdown() call when phone power off due to low battery.. anybody can help me out.. 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
Re: [android-developers] Re: power down
Kabita wrote: In Eclair 2.1 i am not able to power down the device. Is there any patch available? please help There is no means I am aware of in the SDK to power down the device. If you are developing your own firmware, please try the [android-porting] Google Group. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Training...At Your Office: http://commonsware.com/training -- 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: power down
Hi Mark, the problem is.. i have upgrade my h/w device with Eclair 2.1 while playing with the device. I was that i am not able to power off the phone. When i did power off it hangs... trying to fix it.. but not getting any clue. Is the patch for this problem available.. thanks in advance. kabita On Feb 17, 6:58 pm, Mark Murphy mmur...@commonsware.com wrote: Kabita wrote: In Eclair 2.1 i am not able to power down the device. Is there any patch available? please help There is no means I am aware of in the SDK to power down the device. If you are developing your own firmware, please try the [android-porting] Google Group. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Android Training...At Your Office:http://commonsware.com/training -- 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: power down
Kabita wrote: the problem is.. i have upgrade my h/w device with Eclair 2.1 while playing with the device. AFAIK, there are no upgrades to 2.1 for any Android device presently on the market. If you are using a modded firmware, please contact the source of that firmware. If this is your own firmware, as I indicated earlier, please ask your question on [android-porting]. If this is legitimate firmware from your device manufacturer or mobile provider, contact them for technical support. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _Android Programming Tutorials_ Version 1.9 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: Move buttons within Layout
Kritzli wrote: I'm still stuck on this problem. I tried to solve it by making the whole activity dynamic. But still the button is positioned at top left. I can't see why ok.layout(k.getLeft(), k.getTop(), k.getRight(),k.getBottom()); isn't repositioning the button, even if it shows the right Values on LogCat. instead of using RelativeLayout i'd use custom one extending ViewGroup 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: Android 2.0 battery level
Take a look at http://developer.android.com/reference/android/os/BatteryManager.html#EXTRA_VOLTAGE. Mihai Fonoage On Feb 15, 7:49 am, Maxood maqs...@salsoft.net wrote: Hi Mark! I want to display Batter level stats in my app as shown in the following link: http://itunes.apple.com/us/app/app-genie/id352781306?mt=8 Wonder how can i access batter voltage/power information at runtime? On Dec 23 2009, 5:50 pm, Mark Murphy mmur...@commonsware.com wrote: Motalen wrote: Is this to say that the Droid has the capability to report higher precision values given the nature of the hardware BUT there is no way to access it? Here is my interpretation: -- Precision refers to the fineness of detail. Many Android devices report at 1% precision, but the DROID reports at 10% precision. -- Accuracy refers to how well the reported values reflect reality. If I am mistaken, which I hope I am, how would we go about accessing the finer granularity that is needed when developing batteryapplications on the Droid? As far as I know, you can't. As Ms. Hackborn said, [10%] is just the precision the Droidbatteryreports. I have no problem getting single digit precision with other handsets only the Droid produces the strange '10's increments' only. That's the way Motorola elected to implement thebatterylevel information. The SDK does not mandate a minimum level of precision, so device manufacturers can report 1%, 10%, 3.14%, or whatever floats their boats. Applications (particularly paid ones) should not be relying upon some minimum level of precision, just as they should not be relying on certain LED colors or the availability of a physical CAMERA button. If you have more detailed questions on Motorola devices, I recommend asking Motorola the questions, since they have developer support boards: http://developer.motorola.com -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Android Development Wiki:http://wiki.andmob.org -- 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: Custom BaseAdapter + dynamic updates = crash in ListView layout
I'm just trying to do a grouped layout - so a header would be followed by a bunch of rows, then another header, and another bunch of rows. They aren't collapsable, so I don't think it's quite an ExpandableList. As far as break points go, the only thing that seems to be called before the crash is getCount. I agree that the approach I've got here is all backwards, and I'm going to simplify it into a single class - if I just use the flat FancyAdapter (without the headers, naturally), then the crash goes away. So I think I'll just put support for alternate views into my flat adapter to support the headers, and toss the Grouped adapter for now. I would like to know why it's crashing, though, as I may bump into the problem again if I don't know what I was doing wrong in that code. Wendell On Feb 17, 1:55 am, TreKing treking...@gmail.com wrote: On Tue, Feb 16, 2010 at 10:47 PM, whicken whic...@gmail.com wrote: Here's my GroupedListAdapter class, if that helps any - I added the getStableIds returning false in case there was any extra caching going on: Here's a question - what's the purpose of this adapter? What kind of layout / functionality are you trying to achieve? It looks to me like you're reproducing the ExpandablistList functionality in a very strange way. First suggestion would be to stick a break point in every single function and see what gets called and in what order. Also throw in some logging to make sure your logic is correct in each and every function. Beyond that I would strongly suggest reworking this class. Maybe take a look at BaseExpandableListAdapter instead of the BaseAdapter? Or at least create an object that represents a single header with some sections and delegate some of the functionality to it instead of maintaining two lists and trying to do the indexing yourself in the one class. That's bound to get confusing. --- -- 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
Re: [android-developers] Re: Custom BaseAdapter + dynamic updates = crash in ListView layout
On Wed, Feb 17, 2010 at 8:34 AM, whicken whic...@gmail.com wrote: I'm just trying to do a grouped layout - so a header would be followed by a bunch of rows, then another header, and another bunch of rows. They aren't collapsable, so I don't think it's quite an ExpandableList. I would still recommend the ExpandableListAdapter since it matches your header + list of sections design. You can easily override the collapsing behavior and remove the default expanded / collapsed icon so it looks like a generic list. This gives you the benefit of reusing that class that's already provided to you, separating the header and section Views instead of having one giant view containing both, and makes it easier to support clicking on the header or individual sections. Plus the option to re-enable the collapse behavior if you decide you need it down the road. - 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] eclair 2.1 Lockscreen issue
hi all, I am running ecalir 2.1 codebase on samsung moment phone. The issue is : I launch the camera app , press the endcall key , first the lockscreen is created in landscape mode . then i press the endkey again fastly , the OnResume() of camera app is called and the lockscreen gets recreated in portrait mode after getting onOrientationChanged() callback . Now the issue is before showing the lockscreen , the camera activity is shown first and then after 2 seconds the lockscreen is shown . This issue is even occurring with other apps (calendar etc). Can anybody provide feedback in this regard ? -- 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 filters + prevent creation of multiple activity instances?
Hi Mark, Yeah the problem is that my activity uses a singleton, and if there are multiple instances of the activity, they can conflict with each other if they are all trying to use the singleton simultaneously: TaskA: ActivityB .. singleton.runLongProcess(...); Browser: Click link, launch new instance of ActivityB ActivityB ..singleton.runLongProcess(...); the other issue is that this activity can appear anywhere in the activity stack of my app, so I'm cautious about using the singleTask flag, which seems like the closest thing to what I need. Up until now, I've just been using the: FLAG_ACTIVITY_SINGLE_TOP FLAG_ACTIVITY_CLEAR_TOP flags within the app to make sure that there is only one instance of ActivityB running. I tried the following test which did not work: -Start ActivityA from app tray (launcher, singleTask) -Start ActivityB from button in ActivityA -Home screen -Browser -Click link -Intent filter calls ActivityA. -Since ActivityA is singleTask, the already running activity is resumed. -ActivityA::onNewIntent() is called. -Try to start intent to also resume ActivityB instance: Intent i = new Intent(); i.setClass(this, ActivityB.class); i.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(i); that doesn't work though. The previous instance of ActivityB is not restored, I just see ActivityB::onCreate() get called again, and this second instance has a different memory address than the first one. This is killer. I guess I could just make all of my activities singleTask, but I know Dianne cautions against it and I don't want to modify my app so profoundly by switching all the launchMode flags, I don't know what side effects it will really have. Thanks On Feb 17, 5:05 am, Mark Murphy mmur...@commonsware.com wrote: Mark Wyszomierski wrote: To clarify: MyApp::ActivityA is running Browser launches new MyApp::ActivityA instance. Inside the new instance of MyApp::ActivityA, I want to be able to see that there is already a previous instance of MyApp::ActivityA running, close myself, and bring it to the foreground. Is that possible? Check the various android:launchMode values for the activity element in the manifest to see if one fits your situation. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Android Training...At Your Office:http://commonsware.com/training -- 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: Intent filters + prevent creation of multiple activity instances?
Mark Wyszomierski wrote: Yeah the problem is that my activity uses a singleton, and if there are multiple instances of the activity, they can conflict with each other if they are all trying to use the singleton simultaneously: TaskA: ActivityB .. singleton.runLongProcess(...); Browser: Click link, launch new instance of ActivityB ActivityB ..singleton.runLongProcess(...); Instead of a pure singleton, use an IntentService or something else that queues the long process jobs. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Training in US: 14-18 June 2010: http://bignerdranch.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: Failed binder transaction when passing byte[] (from camera) between intents
In onPictureTaken, save the camera to a file and insert into the media content provider. Then, when the image has been inserted, instead of sending the raw binary data of the bitmap, send back the content-Uri of the image you took. On Feb 17, 3:07 am, Bart bvandep...@gmail.com wrote: So I can never make camera images that are higher resolution then 277x184? :S If I stuff all the camera code into my main activity, then it should work. But that's a little messy. Are you sure there isn't another way to pass the camera images? Thanks On Feb 16, 10:05 pm, Streets Of Boston flyingdutc...@gmail.com wrote: Binary data works upto about 100KByte. Anything larger, you very likely get that error. For images in RGB_565, this is about 277 x 184 pixels max (277 x 184 * 2 = 101936) On Feb 16, 4:17 am, Bart bvandep...@gmail.com wrote: Hi, I have a problem with an app that lets the user take a picture. I've posted it on some forums already, but nobody seems to recognize the problem. Hopefully someone here knows a solution :) I've put the code of taking a picture in a seperate activity. Then I call the camera intent from my main activity using activityForResult. In the camera intent, I use putExtra to return the camera image (as a byte[] without doing anything to it). But when the program transitions back from the camera intent to the parent intent that called it I get aFailedBinderTransaction error in the logcat because the byte[] is too big. But I don't understand this, because the image is not even taken using the maximum resolution :S The code of my camera intent is: package example.imaging.ape; import java.io.IOException; import java.util.Iterator; import java.util.Set; import android.app.Activity; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.PixelFormat; import android.hardware.Camera; import android.hardware.Camera.AutoFocusCallback; import android.os.Bundle; import android.util.Log; import android.view.MotionEvent; import android.view.SurfaceHolder; import android.view.SurfaceView; import android.view.View; import android.view.Window; import android.view.WindowManager; import android.view.View.OnTouchListener; public class TakePicture extends Activity implements SurfaceHolder.Callback{ Camera mCamera; Boolean mPreviewRunning = false; int imageLayoutHeight; int imageLayoutWidth; �...@override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //setup camera surface getWindow().setFormat(PixelFormat.TRANSLUCENT); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.cameralayout); SurfaceView mSurfaceView = (SurfaceView) findViewById(R.id.hist_surface_camera); SurfaceHolder mSurfaceHolder = mSurfaceView.getHolder(); mSurfaceHolder.addCallback(this); mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); Bundle extras = getIntent().getExtras(); imageLayoutHeight = extras.getInt(layoutHeight); imageLayoutWidth = extras.getInt(layoutWidth); OnTouchListener touchListener = new View.OnTouchListener() { public boolean onTouch(View v, MotionEvent e) { System.out.println(MAKING PICTURE); mCamera.autoFocus(cb); return false; } }; //setup touch listener mSurfaceView.setOnTouchListener(touchListener); } AutoFocusCallback cb = new AutoFocusCallback() { public void onAutoFocus(boolean success, Camera c) { c.takePicture(null, null, mPictureCallback); } }; Camera.PictureCallback mPictureCallback = new Camera.PictureCallback() { public void onPictureTaken(byte[] imageData, Camera c) { System.out.println(Picture taken, now returning); Intent resultIntent = new Intent(); resultIntent.putExtra(cameraImage, imageData); System.out.println(put Extra); setResult(Activity.RESULT_OK, resultIntent); finish(); } }; //initialize camera public void surfaceCreated(SurfaceHolder holder) { mCamera = Camera.open(); } public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) { if (mPreviewRunning) { mCamera.stopPreview(); } Camera.Parameters p =
[android-developers] how much time we have at onPause until we are killed?
Hi, When the user press the home key, the onPause method is called. At this time, the application is supposed to save its state so it can be properly recovered later. However, and if the state is taking too much time? For example, issuing a closeAllNetworkConnections that was waiting a feedback from the server, or just if the amount of information we're writting to disk is a lot of info... what would happen? In my tests, i'm getting from 300-500 ms of time until the process is killed. Is there a safer place to put a save everything and quit code so that it can safely save everything before a kill the activity task is issued? thanks! guich -- 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] trying to show a progressdialog in a lengthy task
Hi, When i first launch my main intent, i check if the application was updated and, if yes, i decompress some asset files. This task can take up to 15 seconds (to decompress a 6MB zip file). So, i was trying to show a ProgressDialog to the user. However, nothing in hell makes the dialog appear. The lengthy method is called from onCreate. I already tried to put it in onStart, but same thing. I also tried to run it in the ui thread, same thing: no dialog appears, even if isShowing returns true. This is the code: showProgressDialog while (...) // a 15-second task nowQuit(); What can i do to make the dialog really show up on screen? thanks guich -- 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] how much time we have at onPause until we are killed?
guich wrote: When the user press the home key, the onPause method is called. At this time, the application is supposed to save its state so it can be properly recovered later. That depends on what state you are referring to. onSaveInstanceState() is for data that is transient. onPause() might be a spot to save data that is more persistent. Is there a safer place to put a save everything and quit code so that it can safely save everything before a kill the activity task is issued? Yes: when the user pushes the Save button on the Save menu choice or something, use an AsyncTask or IntentService to persist your changes. Having the BACK button or something imply a save operation is OK when everything is local. If you need Internet access, though, I would not use the BACK button as the save trigger. After all, if you have no Internet connection, you can disable the Save button/menu choice, but you cannot realistically disable the BACK button. In a pinch, fire off an AsyncTask or use an IntentService to persist your data on an Android-supplied background thread. However, if you are not finishing (i.e., isFinishing() is false), you probably also want to cache that data locally, since you may need it in a few milliseconds and should not be waiting both to persist the data to the Internet and then read it back again. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Training in US: 14-18 June 2010: http://bignerdranch.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
Re: [android-developers] trying to show a progressdialog in a lengthy task
guich wrote: Hi, When i first launch my main intent, i check if the application was updated and, if yes, i decompress some asset files. This task can take up to 15 seconds (to decompress a 6MB zip file). So, i was trying to show a ProgressDialog to the user. However, nothing in hell makes the dialog appear. The lengthy method is called from onCreate. Don't do that. That is on the main application thread. I already tried to put it in onStart, but same thing. Don't do that. That is on the main application thread. I also tried to run it in the ui thread, same thing: no dialog appears, even if isShowing returns true. Don't do that. That is on the main application thread. This is the code: showProgressDialog while (...) // a 15-second task nowQuit(); What can i do to make the dialog really show up on screen? Get your long-running work off the main application thread. Use an AsyncTask or an IntentService. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Training in US: 14-18 June 2010: http://bignerdranch.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: how much time we have at onPause until we are killed?
On Feb 17, 4:27 pm, guich guiha...@gmail.com wrote: Hi, When the user press the home key, the onPause method is called. At this time, the application is supposed to save its state so it can be properly recovered later. However, and if the state is taking too much time? For example, issuing a closeAllNetworkConnections that was waiting a feedback from the server, or just if the amount of information we're writting to disk is a lot of info... what would happen? In my tests, i'm getting from 300-500 ms of time until the process is killed. Is there a safer place to put a save everything and quit code so that it can safely save everything before a kill the activity task is issued? thanks! guich in normal scenario your process is not killed everytime you finish your activity, it's killed only when OS is short of resources. if you observe your process to be killed by OS you dont have to care about system resources like Sockets - they are going to be closed by OS 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: trying to show a progressdialog in a lengthy task
Hi, What's the main application thread used if not for lengthy tasks? I really can't understand all the threads of Android... regards guich -- 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 filters + prevent creation of multiple activity instances?
Ah I'm in the position where this code is out there, changing it so drastically would be risky. It looks like there's just no way to resume an already running instance, this doesn't seem right. I thought this should be possible: App Tray ActivityA (singleTask) ActivityB (singleTop) Browser launch ActivityA ActivityA already-running-task is resumed ActivityA::newIntent(ClearTop | SingleTop, ActivityB.class) shouldn't ActivityA just be able to wipe out the already-running instance of B? I see the same instance of A is resumed by memory address, so I am assuming its activity stack is also intact. But the original instance of B somehow gets lost in limbo in the above scenario, I never see ActivityB::onPause::isFinishing(). Thanks On Feb 17, 7:18 am, Mark Murphy mmur...@commonsware.com wrote: Mark Wyszomierski wrote: Yeah the problem is that my activity uses a singleton, and if there are multiple instances of the activity, they can conflict with each other if they are all trying to use the singleton simultaneously: TaskA: ActivityB .. singleton.runLongProcess(...); Browser: Click link, launch new instance of ActivityB ActivityB ..singleton.runLongProcess(...); Instead of a pure singleton, use an IntentService or something else that queues the long process jobs. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Android Training in US: 14-18 June 2010:http://bignerdranch.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: Move buttons within Layout
Thank you for your replies. But I still don't get it... Could you please explain how I should use the LayoutParams ? I thouht I only can use them with FILL_PARENT, WRAP_CONTENT and addRule() but not to define a position with specific values. @pskink How would you do that ? On 17 Feb., 15:23, skink psk...@gmail.com wrote: Kritzli wrote: I'm still stuck on this problem. I tried to solve it by making the whole activity dynamic. But still the button is positioned at top left. I can't see why ok.layout(k.getLeft(), k.getTop(), k.getRight(),k.getBottom()); isn't repositioning the button, even if it shows the right Values on LogCat. instead of using RelativeLayout i'd use custom one extending ViewGroup 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: trying to show a progressdialog in a lengthy task
guich wrote: What's the main application thread used if not for lengthy tasks? Anything *other* than lengthy tasks. The main application thread is the UI thread. I really can't understand all the threads of Android... There's only one thread of significance -- the main application (UI) thread -- unless you arrange for your own threads, either manually forking them or using tools like AsyncTask or IntentService. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Training in US: 26-30 April 2010: http://onlc.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] Causing onMeasure() to be called for an EditView
Hi. I've got a ported application that doesn't use Android UI (our list screens and touch screens). We a FrameLayout that contains two children a View (that we use to paint on our UI) and an EditText which is usually invisible until we have a test field that we want to use in our own UI. To have our UI test field aligned with the android one, once the user press on our list item we set the layout params to set it to the right x and y (using margins) and the width and height, and request focus for the EditText item. This works great, however when resizing we always get the EditText with the previous screen's orientation's LayoutParams. A short test shows the reason: the layout calls onMeasure on itse;f and the children, only then does onResize is called on the View which resizs the list item we have in our UI, and only then the layout params is being assigned to the EditText. Of course it already to late as onMEasure was called already. What i need is for the onMeasure() of he textEdit to be called once the onSizedChanged() has finished. How can i do that ? I can create an ugly hack that if in the onLayout of the FramLayout the EditText's dimensions are not like the measured ones the call on setMeasuredDimension(int, int) to set the size i want. This is a pretty ugly hack though and can cause a lot of instability, so i'll appreciate other suggestions :-\ requestLayout() in the onSizeChanged() didn't help as well (tried in the sizeChanged of the view, the layout and the EditText). -- 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: Home Screen Customization problem
please can anybody suggest me on this? On Wed, Feb 17, 2010 at 6:51 PM, satish bhoyar getsatonl...@gmail.comwrote: Hi all, I am trying to customize the Android HomeScreen by adding some TextView some other Views on it. the Problem is i m not able to do it. I tried some thing but ended up it for all the home screens. what i want is to put the different things(views) on different HomeScreens. How is it possible?? anybody knows how to do it? please suggest.. thnks, satish -- 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: Move buttons within Layout
Kritzli wrote: Thank you for your replies. But I still don't get it... Could you please explain how I should use the LayoutParams ? I thouht I only can use them with FILL_PARENT, WRAP_CONTENT and addRule() but not to define a position with specific values. That's because you can't define a position with specific values. Step #1: Design the layout in XML the way the widgets are originally. You probably already have this already. Step #2: Create an equivalent layout in XML the way the widgets will be after your move. Step #3: Figure out the right changes to LayoutParams, margins, and whatnot to change your widgets, in Java, from the state the widgets start in (Step #1) to the state you want the widgets in after the move (Step #2). You cannot just arbitrarily position widgets wherever you want -- their position is dictated by their layouts. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Training in US: 26-30 April 2010: http://onlc.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] onListItemClick problem
Hello, I have a listview that shows files in a specified folder which works. But what I can't figure out is in the onListItemClick method. How can I get the name of the selected file in the ListView from the ArrayAdapter instead of the position or id? Any suggestion? public void updateFileList() { File home = new File(FILE_PATH); if (home.listFiles().length 0) { for (File file : home.listFiles()) { if (accept(path, file.getName()) == true) { files.add(file.getName()); } } ArrayAdapterString fileList = new ArrayAdapterString(this, R.layout.list_items, files); setListAdapter(fileList); } } @Override protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); try{ File f = new File(Environment.getExternalStorageDirectory()+/ Folder+?); FileInputStream fileIS = new FileInputStream(f); BufferedReader buf = new BufferedReader(new InputStreamReader(fileIS)); String readString = new String(); readString = buf.readLine(); TextView tv = new TextView(this); tv.setText(readString); setContentView(tv); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e){ e.printStackTrace(); } } Cheers -- 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] onListItemClick problem
André wrote: I have a listview that shows files in a specified folder which works. But what I can't figure out is in the onListItemClick method. How can I get the name of the selected file in the ListView from the ArrayAdapter instead of the position or id? Call getItem() on the ArrayAdapter, providing the position. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Training in US: 26-30 April 2010: http://onlc.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: Move buttons within Layout
On Feb 17, 4:58 pm, Mark Murphy mmur...@commonsware.com wrote: You cannot just arbitrarily position widgets wherever you want -- their position is dictated by their layouts. unless he writes own custom layout extending ViewGroup - RelativeLayout in his case is pretty useless 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] onListItemClick problem
Can't you simply use the position to retrieve the file name from the files list? Like: String fileName = files.get (position); Yuvi -- YuviDroid http://android.yuvalsharon.net On Wed, Feb 17, 2010 at 5:03 PM, André pha...@hotmail.com wrote: Hello, I have a listview that shows files in a specified folder which works. But what I can't figure out is in the onListItemClick method. How can I get the name of the selected file in the ListView from the ArrayAdapter instead of the position or id? Any suggestion? public void updateFileList() { File home = new File(FILE_PATH); if (home.listFiles().length 0) { for (File file : home.listFiles()) { if (accept(path, file.getName()) == true) { files.add(file.getName()); } } ArrayAdapterString fileList = new ArrayAdapterString(this, R.layout.list_items, files); setListAdapter(fileList); } } @Override protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); try{ File f = new File(Environment.getExternalStorageDirectory()+/ Folder+?); FileInputStream fileIS = new FileInputStream(f); BufferedReader buf = new BufferedReader(new InputStreamReader(fileIS)); String readString = new String(); readString = buf.readLine(); TextView tv = new TextView(this); tv.setText(readString); setContentView(tv); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e){ e.printStackTrace(); } } Cheers -- 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 -- YuviDroid http://android.yuvalsharon.net -- 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: Move buttons within Layout
skink wrote: On Feb 17, 4:58 pm, Mark Murphy mmur...@commonsware.com wrote: You cannot just arbitrarily position widgets wherever you want -- their position is dictated by their layouts. unless he writes own custom layout extending ViewGroup - Agreed. Got any well-documented examples? -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Training in US: 26-30 April 2010: http://onlc.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: Need Samsung Moment user to help troubleshoot problems
If you determine what the issue is, please share here. ongPay! (com.yakloingames.ongpay) is also not working really at all on Samsung Moment. It is probably OpenGL related as there are a few other posts speaking to that effect. On Feb 16, 11:07 pm, dan raaka danra...@gmail.com wrote: what game is this ? can you give the class name of your app for me to search -Dan On Sat, Feb 13, 2010 at 6:28 PM, ernestw ernest...@gmail.com wrote: Hi all - I'm currently getting some problem comments from people claiming that my game FRG crashes on the Samsung Moment immediately when a bullet hits an enemy. Anybody have a Samsung Moment who could help me figure out the issue? I'd use DeviceAnywhere but their Samsung Moment has been offline for the past 1.5 weeks. :-\ Thanks in advance. Ernest Woo Woo Games http://www.woogames.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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en- 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: onListItemClick problem
Perfect, thanks guys! On Feb 17, 5:07 pm, Yuvi yuvidr...@gmail.com wrote: Can't you simply use the position to retrieve the file name from the files list? Like: String fileName = files.get (position); Yuvi -- YuviDroidhttp://android.yuvalsharon.net On Wed, Feb 17, 2010 at 5:03 PM, André pha...@hotmail.com wrote: Hello, I have a listview that shows files in a specified folder which works. But what I can't figure out is in the onListItemClick method. How can I get the name of the selected file in the ListView from the ArrayAdapter instead of the position or id? Any suggestion? public void updateFileList() { File home = new File(FILE_PATH); if (home.listFiles().length 0) { for (File file : home.listFiles()) { if (accept(path, file.getName()) == true) { files.add(file.getName()); } } ArrayAdapterString fileList = new ArrayAdapterString(this, R.layout.list_items, files); setListAdapter(fileList); } } �...@override protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); try{ File f = new File(Environment.getExternalStorageDirectory()+/ Folder+?); FileInputStream fileIS = new FileInputStream(f); BufferedReader buf = new BufferedReader(new InputStreamReader(fileIS)); String readString = new String(); readString = buf.readLine(); TextView tv = new TextView(this); tv.setText(readString); setContentView(tv); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e){ e.printStackTrace(); } } Cheers -- 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%2Bunsubs cr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- YuviDroidhttp://android.yuvalsharon.net -- 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: Move buttons within Layout
On Feb 17, 5:08 pm, Mark Murphy mmur...@commonsware.com wrote: skink wrote: On Feb 17, 4:58 pm, Mark Murphy mmur...@commonsware.com wrote: You cannot just arbitrarily position widgets wherever you want -- their position is dictated by their layouts. unless he writes own custom layout extending ViewGroup - Agreed. Got any well-documented examples? -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Android Training in US: 26-30 April 2010:http://onlc.com err, well, LinearLayout.java ? :-) 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] Photoshop CS4 workflow for Android UI design
Been googling, but not finding relevant resources. Hoping the folks here can help. I just received my copy of Adobe CS4 Web Premium and have been messing around and reading the docs trying to determine what the workflow is to create 3D UIs. As I don't have a 3d modeling program so I'm interested in their support for taking multilayer 2d graphics, building a 3d model from that, and allowing me to apply lighting and texture effects to the result. Photoshop has most if not all of this capability I think, but I'm not clear on how to proceed if the 3d object you want isn't on the 3d menu. The Adobe package comes with Illustrator and Fireworks too. Should I use these programs to produce graphics and then import them onto Photoshop layers for 3d processing? Answers to these questions, or pointers to existing web resources, as well as and any other advice with regard to using these Adobe tools for Android UI design 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: Why is all the spam suddenly appearing?
We all hope that we all are reporting the spam as spam by going to the conversation and clicking on Report discussion as spam or below the message at Report spam. On Feb 16, 9:25 pm, ian stilbit...@gmail.com wrote: I don't like the spam on our discussion group and it seems to be getting worse in the last week or so. Maybe the sources could be tracked and lose their accounts -- 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: trying to show a progressdialog in a lengthy task
Hi Guich, You're not alone in your misunderstanding of Android threading. However, if you use AsyncTask correctly, you have a 99% chance of getting it right. Just put any code that blocks, takes a long time, or can timeout into the AsyncTask.doInBackground method instead of into an Activity method. As an aside, the main UI thread is in way a lengthy task, but none of its methods should be. This may be a generalization, but it should be idle most of the time, ready to respond to user or lifecycle events. On Wed, Feb 17, 2010 at 7:45 AM, guich guiha...@gmail.com wrote: Hi, What's the main application thread used if not for lengthy tasks? I really can't understand all the threads of Android... regards guich -- 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 -- 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: (TabActivity) How to switch tab from within a sub activity
How can I access that method (setCurrentTab()) from a classic activity ? This method is only defined for TabActivity... Thank you... On 17 fév, 14:06, Mark Murphy mmur...@commonsware.com wrote: ColletJb wrote: Hi, I'm currently working on an application, designed around a TabActivity. It look like this: Main (TabActivity) - Tab1 (Activity) - Tab2 (Activity) Here, Tab1 has a button and I would like when the user click it, it switches to Tab2... How can I do that ? setCurrentTab() -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Android Training...At Your Office:http://commonsware.com/training -- 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: (TabActivity) How to switch tab from within a sub activity
ColletJb wrote: How can I access that method (setCurrentTab()) from a classic activity ? This method is only defined for TabActivity... Simple: get rid of the other activities. I really wish developers would stop doing that -- all you do is make your life more difficult. Just make the tabs be views in the TabActivity. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _Android Programming Tutorials_ Version 1.9 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] screen Oroentation
Hi guys.. In my application i want to do Screen Orientation public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); setContentView(R.layout.screen1_landscape); } This is the function that im using in onCreate() method. But when i use this it is showing an error like - Syntax error on token ), ; expected - Syntax error on token (, ; expected - void is an invalid type for the variable onConfigurationChanged Its an important task..could anyone please respond to resolve my issue Any help 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
Re: [android-developers] Using ContentResolver to add a contact in the mobile
Does your app request permission to write to contacts? On Feb 17, 2010 4:11 AM, LeGeNDuS legen...@gmail.com wrote: Hello, I'm trying this code and it's getting stopped in the getContentResolver statement ContentValues values = new ContentValues(); values.put(People.NAME, hola); Uri uri = getContentResolver().insert(People.CONTENT_URI, values); What am I doing bad? 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.comandroid-developers%2bunsubscr...@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] duplicating the fling motion of one gallery widget to the other gallery widget in same screen
Hi, I have two gallery widgets in same screen. If user flings on top gallery widget I would like to replicate the same fling motion on the other gallery widget thats beneath the first one. Is there a way I can possibly achieve this Thanks in advance for your help -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Causing onMeasure() to be called for an EditView
Using the hack doesn't work. if i call to the setMeasuredDimension() with the dimensions i want from the onLayout() of the layout it wont change the measured values. So i need some help here :-) On Feb 17, 5:56 pm, poohtbear eyaltg...@gmail.com wrote: Hi. I've got a ported application that doesn't use Android UI (our list screens and touch screens). We a FrameLayout that contains two children a View (that we use to paint on our UI) and an EditText which is usually invisible until we have a test field that we want to use in our own UI. To have our UI test field aligned with the android one, once the user press on our list item we set the layout params to set it to the right x and y (using margins) and the width and height, and request focus for the EditText item. This works great, however when resizing we always get the EditText with the previous screen's orientation's LayoutParams. A short test shows the reason: the layout calls onMeasure on itse;f and the children, only then does onResize is called on the View which resizs the list item we have in our UI, and only then the layout params is being assigned to the EditText. Of course it already to late as onMEasure was called already. What i need is for the onMeasure() of he textEdit to be called once the onSizedChanged() has finished. How can i do that ? I can create an ugly hack that if in the onLayout of the FramLayout the EditText's dimensions are not like the measured ones the call on setMeasuredDimension(int, int) to set the size i want. This is a pretty ugly hack though and can cause a lot of instability, so i'll appreciate other suggestions :-\ requestLayout() in the onSizeChanged() didn't help as well (tried in the sizeChanged of the view, the layout and the EditText). -- 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] onPause() not being called for singleTask finish()'d activity?
Hi, I'm not sure why onPause() is not called in the following scenario. Here's my activity: // launchMode = singleTask public class ActivityMain extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.d($$, onCreate()... + getTaskId()); } @Override protected void onPause() { super.onPause(); if (isFinishing()) { Log.d($$, onPause()... + getTaskId()); } } @Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent); Log.d($$, onNewIntent()... + getTaskId()); finish(); } } I launch my activity from the app tray, then hide it by hitting the home key. So the app is running. I then launch the browser, do a url-click action which should launch this activity again (via an intent-filter). I see the onNewIntent() method called. The task id and mem address is the same as the original instance, so I know this is the original one getting recycled. I do not see the onPause() method called though, even though finish() is being called. Shouldn't the call to finish() kill this one and only activity in this task? The log output looks like this: onCreate()...54 onNewIntent()...54 [missing onPause()...54]? 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
Re: [android-developers] Re: Task activity stack always reset when launched from Home
When you say launch do you mean launching from Eclipse? If so, there is a bug in older SDKs where this would use the wrong intent so when you later launch it from the launcher you would get a new task. You can use adb shell dumpsys activity to see the current state of the activity stack at whatever point you want to help diagnose what is going on. On Thu, Mar 26, 2009 at 8:55 AM, jseghers jsegh...@cequint.com wrote: The code that starts the .About activity is: protected void startAbout() { Intent aIntent = new Intent(this, About.class); startActivity(aIntent); } The Manifest entries for .UserLaunch and .About are in my original post. The intent that returns the task to the front is generated by the Launcher. What flags do I need to set (and where) to prevent this from happening? Is one of the default values causing it? My test case here is: 1) launch .UserLaunch from the launcher 2) start .About 3) hit Home key 4) launch .UserLuanch from the launcher There are no long delays in any of this, so the 30 minute auto-clear should not be invoked. - John On Mar 25, 12:15 pm, Dianne Hackborn hack...@android.com wrote: That means you are using some CLEAR_TOP or finish flag in an intent or in the manifest. Or possibly it has been 30 minutes since the app was last launched, in which case the system will restart it automatically. On Wed, Mar 25, 2009 at 11:12 AM, jseghers jsegh...@cequint.com wrote: Thank you for your reply! I am seeing am_task_to_front followed by am_finish_activity. I found the event-log-tags file and apparently the reason is clear. What is not clear to me though is why the activity manager thinks it should clear the the task. The relevant lines of the log are: I/am_on_resume_called( 94): com.android.launcher.Launcher I/dvm_gc_info( 94): [7017575181485176104,-9053780441931634733,-4010030953047537782,8554533] I/force_gc( 209): bg I/dvm_gc_info( 209): [7163384747111232651,-9098816781953771608,-4017912252395432053,7919391] I/am_pause_activity( 52): [1128800640,com.android.launcher/.Launcher] I/am_task_to_front( 52): 3 I/am_finish_activity( 52): [1129575992,3,com.cequint.cityid/.About,clear] I/am_destroy_activity( 52): [1129575992,3,com.cequint.cityid/.About] I/am_new_intent( 52): [112951,3,com.cequint.cityid/.UserLaunch,android.intent.action.MAIN,,, 274726912] I/am_on_paused_called( 94): com.android.launcher.Launcher I/am_resume_activity( 52): [1129749080,3,com.cequint.cityid/.UserLaunch] I/am_on_resume_called( 209): com.cequint.cityid.UserLaunch I/dvm_gc_madvise_info( 94): [290816,245760] I/dvm_gc_madvise_info( 209): [352256,241664] I/force_gc( 94): bg - John On Mar 25, 10:16 am, Dianne Hackborn hack...@android.com wrote: You can do adb logcat -b events to see the event log which will include a line the activity manager prints when finishing an activity, with the reason why it is doing it. On Tue, Mar 24, 2009 at 7:24 PM, jseghers jsegh...@cequint.com wrote: I am just starting on an Android app and I am puzzled about why my Task activity stack is being reset any time the application is launched from the Home screen. I used the ADT tools to create the application in Eclipse. The main activity is .UserLaunch and it starts the activity .About when the user presses a button. If the user then presses HOME and then relaunches the app, .UserLaunch is displayed and is the only thing on the stack. .UserLaunch has the launchMode singleTask. .About is standard. According to the documentation at http://developer.android.com/guide/topics/fundamentals.html#lmodes: However, a singleTask activity may or may not have other activities above it in the stack. If it does, it is not in position to handle the intent, and the intent is dropped. (Even though the intent is dropped, its arrival would have caused the task to come to the foreground, where it would remain.) The Task stack should be brought to the foreground and .About should still be displayed. I added Logging to all of the lifecycle events (edited to remove timestamps and shorten DEBUG/ and INFO/ to D/ and I/) and you can see that when HOME is pressed, .About cycles through onPause and onStop (as expected). Then when the app is again launched, .About is destroyed and .UserLaunch is restarted D/UserLaunch:(670): onCreate() D/UserLaunch:(670): onStart() D/UserLaunch:(670): onResume() I/ActivityManager(52): Displayed activity com.cequint.cityid/.UserLaunch: 4910 ms I/ActivityManager(52): Starting activity: Intent { comp= {com.cequint.cityid/com.cequint.cityid.About} } D/UserLaunch:(670): onPause() D/About(670): onCreate() D/About(670): onStart()
[android-developers] Creation of SMS widget, trying to get next
Hi, I have wroten a wrong code. I manage to display the first SMS but not to use my button to go to next. I don't manage to keep the words for the pendingIntent and onRecieve. this is my code: public class MySMSwidget extends AppWidgetProvider { private int sms_id=0; public void onReceive (Context context, Intent intent){ if (Intent.ACTION_ATTACH_DATA.equals(intent.getAction())) { Bundle extra = intent.getExtras(); sms_id = extra.getInt(Data); } } public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { Cursor c = context.getContentResolver().query(Uri.parse(content:// sms/inbox), null, null ,null,null); String body = null; String number = null; String date = null; c.moveToPosition(sms_id); body = c.getString(c.getColumnIndexOrThrow(body)).toString(); number = c.getString(c.getColumnIndexOrThrow(address)).toString(); date = c.getString(c.getColumnIndexOrThrow(date)).toString(); c.close(); RemoteViews updateViews = new RemoteViews(context.getPackageName(), R.layout.widget_layout); updateViews.setTextColor(R.id.text, 0xFF00); updateViews.setTextViewText(R.id.text,date+'\n'+number+'\n'+body); ComponentName thisWidget = new ComponentName(context, MySMSwidget.class); appWidgetManager.updateAppWidget(thisWidget, updateViews); IntentFilter filter = new IntentFilter(); filter.addAction(Intent.ACTION_ATTACH_DATA); RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_layout); views.setOnClickPendingIntent(R.id.next, changeData(context)); } private PendingIntent changeData(Context context) { Intent Next = new Intent(); Next.putExtra(Data, sms_id+1); Next.setAction(Intent.ACTION_ATTACH_DATA); return(PendingIntent.getBroadcast(context, 0, Next, PendingIntent.FLAG_UPDATE_CURRENT)); } } please help! Just want my button to dysplay next sms! -- 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] onPause() not being called for singleTask finish()'d activity?
Mark Wyszomierski wrote: Hi, I'm not sure why onPause() is not called in the following scenario. Here's my activity: // launchMode = singleTask public class ActivityMain extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.d($$, onCreate()... + getTaskId()); } @Override protected void onPause() { super.onPause(); if (isFinishing()) { Log.d($$, onPause()... + getTaskId()); } } @Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent); Log.d($$, onNewIntent()... + getTaskId()); finish(); } } I launch my activity from the app tray, then hide it by hitting the home key. So the app is running. I then launch the browser, do a url-click action which should launch this activity again (via an intent-filter). I see the onNewIntent() method called. The task id and mem address is the same as the original instance, so I know this is the original one getting recycled. I do not see the onPause() method called though, even though finish() is being called. Shouldn't the call to finish() kill this one and only activity in this task? I don't think onPause() will be called, because you never got to onResume(). -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 2.9 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: onPause() not being called for singleTask finish()'d activity?
You're right, onDestroy() gets called - thanks again Mark. On Feb 17, 9:54 am, Mark Murphy mmur...@commonsware.com wrote: Mark Wyszomierski wrote: Hi, I'm not sure why onPause() is not called in the following scenario. Here's my activity: // launchMode = singleTask public class ActivityMain extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.d($$, onCreate()... + getTaskId()); } @Override protected void onPause() { super.onPause(); if (isFinishing()) { Log.d($$, onPause()... + getTaskId()); } } @Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent); Log.d($$, onNewIntent()... + getTaskId()); finish(); } } I launch my activity from the app tray, then hide it by hitting the home key. So the app is running. I then launch the browser, do a url-click action which should launch this activity again (via an intent-filter). I see the onNewIntent() method called. The task id and mem address is the same as the original instance, so I know this is the original one getting recycled. I do not see the onPause() method called though, even though finish() is being called. Shouldn't the call to finish() kill this one and only activity in this task? I don't think onPause() will be called, because you never got to onResume(). -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 2.9 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: Causing onMeasure() to be called for an EditView
On Feb 17, 6:24 pm, poohtbear eyaltg...@gmail.com wrote: Using the hack doesn't work. if i call to the setMeasuredDimension() with the dimensions i want from the onLayout() of the layout it wont change the measured values. So i need some help here :-) On Feb 17, 5:56 pm, poohtbear eyaltg...@gmail.com wrote: Hi. I've got a ported application that doesn't use Android UI (our list screens and touch screens). We a FrameLayout that contains two children a View (that we use to paint on our UI) and an EditText which is usually invisible until we have a test field that we want to use in our own UI. To have our UI test field aligned with the android one, once the user press on our list item we set the layout params to set it to the right x and y (using margins) and the width and height, and request focus for the EditText item. This works great, however when resizing we always get the EditText with the previous screen's orientation's LayoutParams. A short test shows the reason: the layout calls onMeasure on itse;f and the children, only then does onResize is called on the View which resizs the list item we have in our UI, and only then the layout params is being assigned to the EditText. Of course it already to late as onMEasure was called already. What i need is for the onMeasure() of he textEdit to be called once the onSizedChanged() has finished. How can i do that ? I can create an ugly hack that if in the onLayout of the FramLayout the EditText's dimensions are not like the measured ones the call on setMeasuredDimension(int, int) to set the size i want. This is a pretty ugly hack though and can cause a lot of instability, so i'll appreciate other suggestions :-\ requestLayout() in the onSizeChanged() didn't help as well (tried in the sizeChanged of the view, the layout and the EditText). how you call setMeasuredDimension ? do you use MeasureSpec.makeMeasureSpec ? 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] my EditText is an attention whore
I have a ScrollView which features a variety of widgets -- ProgressBars, Spinners and Checkboxes and a single EditText way down at the bottom. If I am at the top of the ScrollView with the EditText scrolled way off the bottom, touching and changing a ProgressBar at the top causes the ScrollView to jerk all the way to the bottom to proudly show me the EditText with a blinking cursor at the end of it. Toggling a checkbox does not do this. Why would this be? I have no funky code around the EditText and do not try to alter it programmatically after the context view is set. The EditText is defined in XML as EditText android:id=@+id/my_edittext android:layout_marginBottom=6dip android:maxLength=6 android:minEms=4 android:inputType=phone android:singleLine=true android:textColor=#00 android:layout_width=wrap_content android:layout_height=wrap_content/ -- 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] Listview widget example
Thought this might be interesting for others. Here is a bare bones simple ListView widget in a base Activity - NOT a ListActivity. There is no explicit Adapter - it uses the android:entries attribute to load the list data from a resource. Probably not something you would use in a real app, but maybe instructive for understanding the ListViews. --- MyListActivity.java --- package foo.listview; import android.app.Activity; import android.os.Bundle; public class MyListActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.mylistview); } } --- res/layout/mylistview.xml --- ?xml version=1.0 encoding=utf-8? RelativeLayout xmlns:android=http://schemas.android.com/apk/res/ android android:layout_width=fill_parent android:layout_height=fill_parent ListView android:layout_width=fill_parent android:layout_height=fill_parent android:entries=@array/mylistviewdata/ /RelativeLayout --- res/values/mylistdata.xml --- ?xml version=1.0 encoding=utf-8? resources string-array name=mylistviewdata item1952 Albert Schweitzer/item item1954 UN Office for Refugees/item item1962 Linus Pauling/item item1964 Martin Luther King/item item1975 Andrei Sakharov/item item1978 Anwar Sadat amp; Menachem Begin/item item1977 Amnesty International/item item1979 Mother Teresa/item /string-array /resources -- 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: my EditText is an attention whore
More information: this appears only to happen if I first scroll down to reveal the EditText. I notice that as I scroll the view by touch-drag, the EditText is grabbing the focus as it breezes past (a behavior I could do without, I suppose ... I'd be happy to insist on directly clicking on it. I am guessing this is some adverse issue of focus, a feature I have so far not had to directly consider. tone -- 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: AudioTrack lag
The 70 ms here isn't due to the blocking nature, but due to the buffer size. With a 2.5 ms buffer size, you'd be able to stop the sound in 5ms even when both buffers were full. It really has nothing to do with blocking/non-blocking, which simply has to do with who has to do the blocking and checking for buffers full/available. I take it 70 ms is the minimum your hardware supports? If so, non- blocking won't solve it, and you probably need different hardware. The fact that they even HAVE a minimum suggests to me that we'e talking about transferring to hardware buffers. Except for embedded devices, it's been a long time since software wrote the DAC registers directly. But what about that 500 ms? That would seem to be more under your control. You can do your work in smaller chunks. The scheduler is the other thing that'll kill you -- especially if you had smaller buffer sizes. If you're doing work in other threads, you'd want to tune it so you're doing work in small enough chunks that your output thread can run in a timely way. A non-blocking protocol does let you be more explicit about this -- essentially write your own scheduler. But you can get the same result with an audio pipeline approach, where you move small buffers of data through each stage of your processing, in a single thread, and if the UI sets a flag that you should be doing something different, you just exit out of that pipeline wherever you are in the processing, and start up the new pipeline. If you want to try to use up more processor on the earlier parts of your task, to protect against underruns, you can use two threads, with a larger number of small buffers mediating between them. The smaller buffers keep the initial latency small, while the larger number of buffers still allows the upstream processing to get further ahead. On Feb 16, 11:14 pm, Steve Lhomme rob...@gmail.com wrote: I can also say that a blocking AudioTrack would suck for a DJ software where 70 ms of latency to do an action is terrible. 5 ms would be acceptable, and that's also about as much time we use for polling. ...and because of the way our feeding threads work, it can take up to 500 ms between the time the user presses pause and the time the thread using AudioTrack is actually able to handle 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: my EditText is an attention whore
Apparently the EditText is the only focusable view in the ScrollView. Maybe put the progressbar outside the ScrollView. On Feb 17, 10:20 am, DulcetTone dulcett...@gmail.com wrote: I have a ScrollView which features a variety of widgets -- ProgressBars, Spinners and Checkboxes and a single EditText way down at the bottom. If I am at the top of the ScrollView with the EditText scrolled way off the bottom, touching and changing a ProgressBar at the top causes the ScrollView to jerk all the way to the bottom to proudly show me the EditText with a blinking cursor at the end of it. Toggling a checkbox does not do this. Why would this be? I have no funky code around the EditText and do not try to alter it programmatically after the context view is set. The EditText is defined in XML as EditText android:id=@+id/my_edittext android:layout_marginBottom=6dip android:maxLength=6 android:minEms=4 android:inputType=phone android:singleLine=true android:textColor=#00 android:layout_width=wrap_content android:layout_height=wrap_content/ -- 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 find out the TextAppearance of the TextView
Hi, What is the default TextAppearance of the TextView object? And how can I find out the line height of the TextView? Thank you. -- 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] New Project- Suggestions Welcome
This is just a quick note on a project that our group in college is developing. It is a app that acts like a digital diary recording the time and position of most phone events and posting them to a map. It will also have functionality to change the phone profile based on location. Any thoughts our suggestions welcome. I will post an update to this project shortly. Eo -- 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] SSL Implementation on Android
hello everyone, i'm an intern student on a project for Android. i've been searching around the sites about SSL Implementation on Android and most of them are not very helpful. and some said they could not make it. or maybe i still don't find the right one. could someone please share me a link that would explain me about SSL Implementation on android. regards, Sebastian. -- 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] Geocoder no longer works on new PC
I have a problem getting the Geocoder to return results on my new PC during development. I started writing a android app on my other (Win XP) system and Geocoder worked fine and returned locations based on an address that I passed to it. I recently bought a new PC (Win 7). Moved the code over to it and now the no address queries return any results. I tried a couple that did work on the xp machine, but are returning no results on the new pc. It does not give any errors. I did generate a keyfile on the old pc. Do i need to create another on the new pc? Does the Geocoder require the key? It is not from the maps api. -- 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: adding a quick add event to the Calendar
There is an app called Calendar Quick Add on the Market that add events to calendar using the quick add syntax from google calendar itself, i.e. just natural language event description (1pm coffee with mr. g at Starbucks). http://www.cyrket.com/p/android/com.xinlu.quickadd/ (*Warning of bias: I'm the developer of the app above. I would like to hear feedback from users, whether the quick add works well or whether there are places for improvement.*) -- 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] Textview Editable Cursor Visible
Hi, I'm using Textview Editable function. When i click the textview it is showing kaeyboard to type. Now i need is it should show marker in that place to type. Please see the below link image . In that LastName Text will have a marker (Sky Blue Color) to type http://img109.imageshack.us/img109/1636/picture41o.png How to do that in android?.. -- Thanks Regards Sasikumar.S -- 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: Application manager not exiting properly in Eclair 2.1
Hello For two weeks am trying to find details about the CTS. Havent been successfull... Can you give me more details. Where I can find it. How to run it on real device etc. Thanks Bishu On Feb 9, 6:20 pm, vrukesh vrukesh.pa...@gmail.com wrote: Hi, With Android Eclair 2.1 on ARM-based target, we are executing Instrumentation test application from command line: am instrument -e class android.app.foo. -w com.android.cts.foo.MyTestApp/android.test.InstrumentationTestRunner Test application executes fine, showing result of the sub-tests in the MyTestApp. But, Application Manager is not exiting properly. This is observed from ps command output: 1114 0 52328 S app_process /system/bin com.android.commands.am.Am in Due to this issue, we are not able to execute the test applications in shell script. Can someone help in this regard ? Thanks, -Vrukesh -- 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] can't display OpenGL and Camera together on nexus one/Milestone whereas it works fine on HTC Magic
Hello, Most of you would think it's this question again... Well, my application run perfectly (shows 3D model rotating with camera in background) on the HTC Magic. But when I try to launch my application on the Droid or the Nexus one, the only thing I can see is the camera preview. If I delete the line when I add the camera preview (addContentView) in my code, the OpenGL part works fine. The worse is that sometimes everything working fine. And if I start the application again it doesn't! Here is the classic code: mGLSurfaceView = new GLSurfaceView(this); mPreview = new CameraView(this); mGLSurfaceView.setEGLConfigChooser(5, 6, 5, 8, 16, 0); mGLSurfaceView.getHolder().setFormat(PixelFormat.TRANSLUCENT); mGLSurfaceView.setKeepScreenOn(true); mGLSurfaceView.setRenderer(sceneRenderer); setContentView(mGLSurfaceView); addContentView(mPreview, new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT)); Do you have any idea where the issue could come from? Thank you 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] Call data
Is there a way to manipulate the data (voice) of an in/outcoming call, so it would be possible to do some DSP(digital signal processing) on the data. 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] OnActivityResult passing a null intent
Hi, I'm trying to make a simple menu for adding another contact to a list. On the ListView I have a button on a footer which uses startActivityForResult to create a new menu (called add_dialog). This is a simple EditText with an OK button and a Cancel button. The idea is that clicking the OK button will pass the string from the EditText back to the main Activity. When the add_dialog Activity finishes and onActivityResult tries to read the string extra it throws a null pointer exception. The debugger gives the following line: E/AndroidRuntime( 410): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=0, result=-1, data=null} to activity {com.test.hello_listview/ com.test.hello_listview.hello_listview}: java.lang.NullPointerException Can someone please explain why data is always null? Am I not using getIntent().putExtra() correctly? The source for the main Activity is: public class hello_listview extends Activity { private Log logger; private static final String TAG = hello_listview; private String[] Pals; private ArrayAdapterString adapter; private Button addButton; private String palName = ; private static final int ADD_DIALOG = 0; private static final int MAP_VIEW = 1; Intent intent_addPal; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.palslist); Pals = getResources().getStringArray(R.array.pals); Arrays.sort(Pals); ListView list = (ListView) findViewById(R.id.list); adapter = new ArrayAdapterString(this, R.layout.listitem); for (int i = 0; i Pals.length; i++) { adapter.add(Pals[i]); } list.setAdapter(adapter); addButton = (Button) findViewById(R.id.addButton); addButton.setOnClickListener(addButton_clicked); intent_addPal = new Intent(this, com.test.hello_listview.add_dialog.class); } OnClickListener addButton_clicked = new OnClickListener() { @Override public void onClick(View v) { logger.i(TAG, add clicked); startActivityForResult(intent_addPal, ADD_DIALOG); } }; @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { if ((resultCode == Activity.RESULT_OK) (requestCode == ADD_DIALOG)) { logger.i(TAG, add okay. data = + data.getStringExtra(PALNAME));// THIS LINE HERE } } } // End of hello_mapview class The source for the add_dialog Activity is: public class add_dialog extends Activity { EditText addText; Button cancelButton; Button doneButton; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.add_dialog); addText = (EditText) findViewById(R.id.addText); cancelButton = (Button) findViewById(R.id.cancelButton); doneButton = (Button) findViewById(R.id.doneButton); cancelButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { setResult(RESULT_CANCELED); finish(); } }); doneButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { getIntent().putExtra(CONTACTNAME, addText.getText()); // ALSO THIS LINE HERE setResult(RESULT_OK); finish(); } }); } // End of onCreate } // End of add_dialog 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
[android-developers] Textview Editable Place Holder
Hi, I'm using Textview Editable function. When i click the textview it is showing keyboard to type. Now i need is it should show place holder in that place to type. Please see the below link image . In that LastName Text will have a place holder (Sky Blue Color) to type http://img109.imageshack.us/img109/1636/picture41o.png How to do that in android?.. -- Thanks Regards Sasikumar.S -- 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] Access barcode app from website
How can I access the barcode app on the Droid from a webpage like Google is doing with the Shopping page? -- 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] making videogame - newbie need help =P
Hello, this is my first post, so sorry about the newbie thing lol. Well, the problem is the next: I'm making a videogame of strategy, it means i need an image (the background) that scrolls at the same time with the objects on the screen (countrys, like RISK, TEG, EUROPA UNIVERSALIS, .. but I can figure out how can do it. I mean, this objects (the countrys) should be imageview or there is another view I should use that it's better for interacting with the user, think in a map of europe with every country selectable. I was thinking of using an ImageView for the background and the other objects on the screen to be imageviews too. Don't worry, I'm not asking for code, just an idea of how?... and if it's not much to ask, why? 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] Installing the ADT Plugin
In this section: - Now modify your Eclipse preferences to point to the Android SDK directory: 1. Select Window Preferences... to open the Preferences panel (Mac OS X: Eclipse Preferences). 2. Select Android from the left panel. 3. For the SDK Location in the main panel, click Browse... and locate your downloaded SDK directory. 4. Click Apply, then OK. - What does locate your downloaded SDK directory refer to? I can't find the directory or file on my PC that the Eclipse interface is referring to... Thanks, Sean -- 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 verify android basic API? (e.g. Date and Time API)
Am running around to get more details on CTS , where i can find it and how to run those cases on a android real device... thanks bishu On Jan 24, 9:11 pm, Evans shkimst...@gmail.com wrote: Is it already covered by Platform API Tests inCTS(Compatibility Test Suit)? On Jan 24, 8:54 pm, Evans shkimst...@gmail.com wrote: We already use Android API. But sometimes I want to know is it verified or not? by whom?(e.g. Android team in google) by which one? (e.g. Unit test or Basic Acceptance Test for API) Do android team have any test report? Because this is a platform for smartphone. For example, if there has any problem in Android API (e.g. Date and Time), it makes customer spend money and time more. But I can't find any report about verifying API test. If you have any information about it, please let me know :) Also if there has no information, how can I test some API to verify API. Thanks.- 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] Open input method automatically on showing Dialog
Hi, I wanted to open input method automatically on showing Dialog, in my Application. I created the dialog from layout xml and i have tried the following. 1. Added android:windowSoftInputMode=stateAlwaysVisible|adjustResize in the dialog's layout XML 2. tried using InputMethodManager API. InputMethodManager inputMethodManager=(InputMethodManager)this.getSystemService(INPUT_METHOD_SERVICE); inputMethodManager.showSoftInput(ET.getRootView(), InputMethodManager.SHOW_FORCED); Both the approaches is not working. I seen the same behaviour for preferences dialog well. Is there any way to handle this? ~ Parthiban -- 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: Moving the cursor to the beginning of an EditText
You can do it like this. EditText eidtText = new EditText(this); // first, you set text and then.. editText.setSelection(1); editText.extendSelection(0); editText.setSelection(0); On 2월2일, 오후11시44분, Adam Olsen arol...@gmail.com wrote: Using the following code, I am able to move thecursorafter the first character on the left in anEditText: EditTexteditText= newEditText(this); Editable etext =editText.getText(); Selection.setSelection(etext, 1); However, if I change it to Selection.setSelection(etext, 0) with the goal ofmovingthecursorto thebeginningof the text, it moves thecursor(or doesn't move thecursor) to the end of the line instead of thebeginning. How can I move thecursorto thebeginningof the text? -- Adam Olsen SendOutCards.comhttp://www.vimtips.orghttp://last.fm/user/synic -- 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 3rd party api compatibility can be checked using CTS or some other tool??
Hi Am running around to find where i can find CTS and how to use it , seems you have already some experience using the same. can you give me details , where to download and how to run it on the real device.. thanks bishu On Feb 8, 6:50 pm, manohar manohar...@gmail.com wrote: Hi All I wanted to get the info on the following query, could you guys please help me in getting the answer?? I have set of platform api those will be tested byCTSto check compatibility, and I am making use of some 3rd party api in one of the platforms api. Suppose if I am changing or modifying the 3rd party api (to suit some of my requirement), isCTSis capable of telling whether compatibility is broken in the 3rd party api?? Example: Say i have api1, api2, api3…. Api n in our platform. In api3 we have made use of XyzThirdpartyApi.jar. And in XyzThirdpartyApi.jar we have done some modification to meet our requirement. AsCTStest each of the api to check compatibility is not broken, is there any way thatCTSinforms us compatibility is broken in XyzThirdpartyApi.jar?? Or Is there any other tool to find out , compatibility is broken in the 3rd party api’s (after any modification is done to suit our requirement)?? -- 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] Open input method automatically on showing Dialog
Hi, I wanted to open input method automatically on showing Dialog, in my Application. I create the dialog from layout xml and i have tried the following. 1. Added android:windowSoftInputMode=stateAlwaysVisible|adjustResize in the dialog's layout XML 2. -- 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] Call data
Anna Gabi wrote: Is there a way to manipulate the data (voice) of an in/outcoming call, so it would be possible to do some DSP(digital signal processing) on the data. In your own firmware, perhaps, but not from an SDK application. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android App Developer Books: http://commonsware.com/books -- 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] Lots of questions and no answers: upgrading my device from Android 1.6 to 2.0
Hi there, I have been watching this discussion forum to see if anyone has got a reply to the numerous queries along the lines of 'how can I upgrade my Android OS from 1.6 to 2.0 on insert device here'. ~50% of those queries get no reply. The other 50% get a simple 'Not available yet'. I find this hard to believe. Are there a bunch of Android-savvy devs who are secretly upgrading their phones and then chuckling at us Android newbies who can't figure this out? ;) Any advice would be appreciated. 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] Icon size on 480x800 resolution
I found some informations about size of icons on developers' guide. But on 480x800 resolution, i couldn't find any information about that. Is there any formats or recomanded size of icons on 480x800 320x480 screen's icon size : 48x48 480x800 screen's icon size : ? -- 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