Re: [android-developers] Re: notepadv1 tutorial problems
It should work... There should not be any issue... If you put all the layouts and strings and rest of the files in the drawables directory it should work... On Fri, May 27, 2011 at 2:04 AM, exax evan.yeu...@gmail.com wrote: So I tried cleaning and rebuilding the project but still nothing is happening. I restarted eclipse and redid the project but it still doesn't work. I really think I need to be able to fill in that greyed out box. Does anybody know for sure/a way to fix the tutorial? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- *-- Mohammed Hossain Doula Software Engineer desme INC.* *www: http://www.hossaindoula.com @: ron...@desme.com* *facebook: http://www.facebook.com/ROnyWorld* *twitter: http://www.twitter.com/hossaindoula* *blogspot: hossaindoula.blogspot.com GSM: 00880-167-4347101* -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Simpler UI Development with Android-Query
[Reposting to correct group] Hi. I am an Android developer and just started an open source project at: http://code.google.com/p/android-query/ It’s a light weight library that’s designed to make Android coding simpler and easier. If you are familiar with jQuery style of coding, you will like AQuery. Why AQuery? Less Code Chaining Binding Handle Fragmentation Multiple UI, One Piece of Code Extendable Light Weight Open Source Any comments, feedback, or contribution will be appreciated! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: notepadv1 tutorial problems
Your minimum SDK level is greyed out? What happens if you directly enter the minSDK attribute into Manifest.xml This all seems somewhat remote from your original problem, of R.java not being generated. Have a look at the import declarations at the start of your file. Quite possibly, you are alrady importing R.something as a result of a boob or over-zealous cut and paste. Comment out all the import R. statements. Run project clean. Try to complie. You should get errors where you use R. The intellisense will offer some suggestions for fixing; one of these will be importing the correct R file. This may fix your problem. On May 27, 6:04 am, exax evan.yeu...@gmail.com wrote: So I tried cleaning and rebuilding the project but still nothing is happening. I restarted eclipse and redid the project but it still doesn't work. I really think I need to be able to fill in that greyed out box. Does anybody know for sure/a way to fix the tutorial? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: easy facebook android sdk library
I don't know what that parameters is about, but in general you need to create an application at the Facebook site and you get back a key. Using that key in your application is enough to start communicating with Facebook. On May 27, 12:35 am, bob b...@coolgroups.com wrote: Can someone help me what to put for the FacebookApplicationSite parameter in the easy facebook android sdk library? 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] How to print pdf file directly from android device using bluetooth
hi want d same, to print text file or pdf file thr the bluetooth printer, if you got any solution let me know. On Tue, May 24, 2011 at 3:29 PM, ashisitrocks ashisitro...@gmail.comwrote: can anyone help me out how to print any pdf file from my android device directly without using any other app as i was trying previously with awt package but it is not supported in d device , i want to connect my device directly with d printer via bluetooth and then without using nay third party api i want to take a print of my pdf file present in sd card -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Thanks Regards Rakesh Kumar Jha Software Developer Symphony Services Corp (India) Pvt Ltd Bangalore (O) +918030274295 (R) +919886336619 -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Widget-specific Preferences
On Friday, May 27, 2011 3:27:41 AM UTC+1, Jake Colman wrote: String, Where did you find the documentation to do this? I'm not sure now (I've been doing it for quite a while), but I just looked and there's an example in the API Demos app, under Advanced Preferences. I'm sure it's documented *somewhere* else, but the API Demos tend to be a great place to find sample code for stuff like this, in my experience. I would like to add my own XML attributes to my derived preference and would like to know how do it. That's something I've never ventured into, sorry. But I would think it's similar to how you define custom layout attributes for your own View subclasses, so I'd start looking in the API demo for custom views. String -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Bluetooth is driving me nuts -- Galaxy tab lockups and pairing stupidity
I've never owned a device where Bluetooth just works every time. The closest that one came to has been my Garmin GPS. I do hope NFC will make it easier to do adhoc peer-to-peer communications. On May 27, 9:58 am, keyeslabs keyes...@gmail.com wrote: I'm trying to use bluetooth SPP to establish a socket connection between two Android devices. There are a few things that are really driving me crazy in this effort. First, the Galaxy Tab seems to just be broken when it comes to SPP. I can establish the connection just fine, but after a few minutes, and most notably whenever the app on the Tab on which the SPP server socket was established is killed, the tablet effectively locks up, requiring a hard reboot (hold down the power for 7 seconds to reboot). I've seen others mentioning the same thing in various places, but haven't seen any solutions. Has anyone come up with ANYTHING to solve this issue? Second, I've been struggling to find a way to make it easy for users to pair devices. I'm developing a full-screen game involving two devices, and the pairing request on 2.3 and later seems to happen (sometimes) as a notification, which doesn't do much good for a full screen game. In some cases it does seem to be displayed as a dialog (which is what I want), but it's frequently as a notification. Is anyone aware of a reliable way to initiate pairing via DIALOG automatically when a socket is opened between two unpaired devices? Finally, has anyone else noticed pairing requests happening twice? Dialog shows, user clicks pair, second dialog appears, click pair, pairing happens. Thanks for any 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] Can't modify attributes of child in ViewAnimator
I have a ViewAnimator subclass with two children, and I want to modify the size of the second child at runtime. However, setting the width prevents the second child from getting displayed at all. My code looks something like this: setDisplayedChild(1); View view = findViewById(R.id.second_view); view.setWidth(500); Removing the line where I set the width results in the second child getting shown, so the ViewAnimator itself seems fine. I've also tried adding an AnimationListener, but the resulting behavior is erratic. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] 3d game engine for android game development on ubuntu
http://www.youtube.com/watch?v=lHpSEsycAdQ here you can find example of a project done in Ubuntu... :) On Thu, May 26, 2011 at 5:51 PM, Robin Talwar r.o.b.i.n.abhis...@gmail.comwrote: ol ry thanks for sharing the knowledge On Thu, May 26, 2011 at 5:16 PM, Mohammed Hossain Doula hossaindo...@gmail.com wrote: jMonkeyEngine is written on java so you can try that... On Thu, May 26, 2011 at 5:43 PM, Robin Talwar r.o.b.i.n.abhis...@gmail.com wrote: Thanks but i run ubuntu on my system... i am specifically finding one game engine so that i can develop games on ubuntu you find unity3d and shiva3d working on windows environment only On Thu, May 26, 2011 at 4:47 PM, Mohammed Hossain Doula hossaindo...@gmail.com wrote: There are lots of in my knowledge... Like jMonkeyEngine, Shiva3D, Airplay, Untity3D... On Thu, May 26, 2011 at 5:04 PM, gaurav gupta gaurav.gupta...@gmail.com wrote: :) Tell me too. if u got any solution. On Thu, May 26, 2011 at 2:11 PM, Abhishek Talwar r.o.b.i.n.abhis...@gmail.com wrote: hey guys Now after making a few android applications i want to step into 3d game development. I run ubuntu please let me know which game engines do i have as options since most of them are only for windows and mac like unity 3d -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 -- *-- Mohammed Hossain Doula Software Engineer desme INC.* *www: http://www.hossaindoula.com @: ron...@desme.com* *facebook: http://www.facebook.com/ROnyWorld* *twitter: http://www.twitter.com/hossaindoula* *blogspot: hossaindoula.blogspot.com GSM: 00880-167-4347101* -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 -- *-- Mohammed Hossain Doula Software Engineer desme INC.* *www: http://www.hossaindoula.com @: ron...@desme.com* *facebook: http://www.facebook.com/ROnyWorld* *twitter: http://www.twitter.com/hossaindoula* *blogspot: hossaindoula.blogspot.com GSM: 00880-167-4347101* -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 -- *-- Mohammed Hossain Doula Software Engineer desme INC.* *www: http://www.hossaindoula.com @: ron...@desme.com* *facebook: http://www.facebook.com/ROnyWorld* *twitter: http://www.twitter.com/hossaindoula* *blogspot: hossaindoula.blogspot.com GSM: 00880-167-4347101* -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: easy facebook android sdk library
Following points to keep in mind :- - Create an application on developers.facebook.com - In settings make it accessible for Mobile - You will get app id save it - download the facebook for android sdk - create a new android application in your IDE - copy paste the package com.facebook.android - refresh your project by right clicking in project explorer and now you can see the facebook package in your project - implement your activity with DialogListenrer - you will be asked to add unimplemented methods just do as they say - create a new Facebook variable like Facebook facebook = new Facebook(APP_ID) - Create another method and write this peice of code in it - *facebook.authorize(this, new String[]{ publish_stream, read_stream, offline_access }, 0, this);* - The above line of code is necessary for letting the user authorize the facebook application and you have to choose the authorize method which accepts 4 constructors I spend hours to get it working for SSO - Now in your oncreate method call the above created method and thats it :) Following is the code :- public class myFacebook extends Activity implements DialogListener{ /** Called when the activity is first created. */ Facebook facebook = new Facebook(YOUR_APP_ID); @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ImageView iv = (ImageView)findViewById(R.id.img); onfbLogin(); *Calling the method* } public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); facebook.authorizeCallback(requestCode, resultCode, data); } @Override public void onCancel() { // TODO Auto-generated method stub } @Override public void onComplete(Bundle values) { // TODO Auto-generated method stub } @Override public void onError(DialogError e) { // TODO Auto-generated method stub } @Override public void onFacebookError(FacebookError e) { // TODO Auto-generated method stub } public void onfbLogin(){ facebook.authorize(this, new String[]{ publish_stream, // *Necessary peice of code for SSO* read_stream, offline_access }, 0, this); } } On Fri, May 27, 2011 at 12:28 PM, Ali Chousein ali.chous...@gmail.comwrote: I don't know what that parameters is about, but in general you need to create an application at the Facebook site and you get back a key. Using that key in your application is enough to start communicating with Facebook. On May 27, 12:35 am, bob b...@coolgroups.com wrote: Can someone help me what to put for the FacebookApplicationSite parameter in the easy facebook android sdk library? Thanks. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] iosched 2011 in zip or tar format
Trying to get iosched 2011 source for eclipse project in a simple zip format. Its at http://code.google.com/p/iosched/source/browse/ but its using hg -arrrhhh. Its a lazy request of mine I know, but I do not have enough brain RAM to learn hg at this point. Or a github ref? Most ioscheds on github are 2010 - arrrg. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Animating from offscreen with TranslateAnimation causes adjacent view to be clipped
Right now I have a view that I'm just popping onto the screen by changing the view from GONE to VISIBLE, and I instead want to have a TranslateAnimation that shifts the view onto the screen. As soon as the animation starts the view on the right becomes clipped though. I assume this is because the parent view is taking the width of the view on the left and factoring that into the view calculation? Is there any way to not have that happen, so it looks like both views are shifting onto and off of the screen? Setting android:clipChildren=false android:clipToPadding=false didn't seem to 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: iosched 2011 in zip or tar format
OK, OK, answering my own question. I have found it (I think) at: https://github.com/underhilllabs/iosched2011 Looks like the right one. Thanks to underhill. Now to try it 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] Multiple overlay on the map
Hi everyone! I'm working with google map on android right now. But now i'm stuck with loading more then 500 overlays on the map. It take too much time and some time it crash because of using too much resource (CPU over 90%). Here it is my code : public void initArrayPostion(ListAttraction attraction){ for(int i=0;iattraction.size();i++){ Double latitude = Double.valueOf(attraction.get(i).latitude)* 1E6; Double longitude = Double.valueOf(attraction.get(i).longitude) * 1E6; if (latitude.intValue() != 0 longitude.intValue() !=0) { minLatitude = (minLatitude latitude.intValue()) ? latitude.intValue() : minLatitude; maxLatitude = (maxLatitude latitude.intValue()) ? latitude.intValue() : maxLatitude; // Sets the minimum and maximum latitude so we can span and zoom minLongitude = (minLongitude longitude.intValue()) ? longitude.intValue() : minLongitude; maxLongitude = (maxLongitude longitude.intValue()) ? longitude.intValue() : maxLongitude; // mPoints.add(new Point(latitude.intValue(), longitude.intValue())); } GeoPoint point = new GeoPoint(latitude.intValue(), longitude.intValue()); OverlayItem overlayitem =new OverlayItem(point, DataStore.myAttraction.get(i).name, i+); itemizedOverlay.addOverlay(overlayitem); } mapOverlays.add(itemizedOverlay); mapController.zoomToSpan((maxLatitude - minLatitude), (maxLongitude - minLongitude)); mapController.animateTo(new GeoPoint((maxLatitude + minLatitude)/2,(maxLongitude + minLongitude)/2 )); } This code use itemizedOverlay to add object in google map and i pass array of attraction (each attraction have longitude and latitude and many thing elses) as argument. what is the problem ?? Thank u in advance for ur kindness :) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] KEYCODE COLON?
Anyone knows how to send KEYCODE COLON? : According to http://thecodeartist.blogspot.com/2011/03/simulating-keyevents-on-android-device.html (look at table) such keycode not exist 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] How to run app on command shell?
I use a script like this: adb install ${TargetApkPath} adb shell monkey -p ${PackageName} -v 1 where the two parameters are the apk you want to install, then the package name you can append an -r to adb install as well, so you don't have to uninstall it everytime. tj On 05/27/2011 09:27 AM, daniel wrote: Hi, If have a good way to run app on command shell? The app will be auto download to device and auto run when we use eclipse to develop, but how to do it on command? I can use adb install xxx.app to install app, but I must open device and click it to run. Regards, daniel -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] sensorLandscape orientation and disabled auto-rotate screen preference (Honeycomb)
Hi, My Honeycomb app uses the sensorLandscape orientation. On my tablet, when I uncheck the auto-rotate screen preference in the system settings, my app continues using the sensor to detect which orientation to use, instead of locking the 0° landscape orientation (as some other apps do, like Youtube, Pulse, CNN, but not Market). So, is there a way for my app to not use the sensor when auto-rotate screen is disabled? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] WebView - Flash overdrawing issue
Has anyone noticed that Flash content within a Webview control overdraws other adjacent controls? It seems that the clipping region of the WebView is not respected. I'm using Adobe Flash 10.3 and a Nexus S. Here is a screen capture of flash content drawing outside of my Webview control. Notice the cartoon drawing on top of the native controls: http://i55.tinypic.com/ea36f9.jpg Is there any setting for WebView to keep plugins like Flash within the clipping boundaries? Thanks for your help! Josh -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 simulate 3D-rotation of irregular object using OpenGL in android?
Thank you! could you please provide sample for importing 3D objects in Android using this Blender tool? Bhavani On May 26, 5:58 pm, Nicholas Johnson metthejohn...@gmail.com wrote: This would not be relevant to Android, unless you're talking about how to import the object into memory. For 3D object creation there are a variety of tools to use. Check out some of the free ones, such as Blender http://www.blender.org/. 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
[android-developers] java.lang.UnsatisfiedLinkError : Couldn't load jpcap
Hi, I was trying to make a simple packet sniffer application in Android using Jpcap. I have added the jpcap.jar in my project. i.e. Java Build Path -- Libraries -- Add External Jars : But still am not able to run my application. its getting this following error and get killed. java.lang.UnsatisfiedLinkError: Couldn't load jpcap: findLibrary returned null. Can anyone help me to resolve this issue: Regards, Vijay -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] What is the best way to upgrade database version with loosing stored data in database?
Hi all, I have created a database file(myapp.db) using SQLite Browser and i am accessing it from assets/ folder in my project. The application has more than 25 tables and each table contains more than 20 fields. The application sends request to the server and get the response in the form of JSON string. All the data will be stored in the phone database from the response string. As per the above, i need to do. Question: If i get change in database, which is the best way to upgrade database version without loosing stored data? The data will be stored permanently in the application and if there is any change in database, i need to keep the data in application. If i uninstall the application, the data will be lost. Technically, when the application runs first time, the database schema file(myapp.db) will be copied in the application. Whenever the application run, it will check for the existing database which is exists or not. If it is not, it will copy from the assets/ folder otherwise it will not perform any action and simply ready to use it. Please provide me any suggestions or guidance or example to do so. Your help would be greatly appreciate. Thanks. Pranav -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: What is the best way to upgrade database version with loosing stored data in database?
http://developer.android.com/reference/android/database/sqlite/SQLiteOpenHelper.html#onUpgrade%28android.database.sqlite.SQLiteDatabase,%20int,%20int%29 Every tutorial I've seen on Android SQLite has mentioned this. On May 27, 5:32 am, Pranav vips...@gmail.com wrote: Hi all, I have created a database file(myapp.db) using SQLite Browser and i am accessing it from assets/ folder in my project. The application has more than 25 tables and each table contains more than 20 fields. The application sends request to the server and get the response in the form of JSON string. All the data will be stored in the phone database from the response string. As per the above, i need to do. Question: If i get change in database, which is the best way to upgrade database version without loosing stored data? The data will be stored permanently in the application and if there is any change in database, i need to keep the data in application. If i uninstall the application, the data will be lost. Technically, when the application runs first time, the database schema file(myapp.db) will be copied in the application. Whenever the application run, it will check for the existing database which is exists or not. If it is not, it will copy from the assets/ folder otherwise it will not perform any action and simply ready to use it. Please provide me any suggestions or guidance or example to do so. Your help would be greatly appreciate. Thanks. Pranav -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Returning Activity object from createTabContent method of TabHost.TabContentFactory instead of View object
I have a TabActivity that implements TabHost.TabContentFactory interface and Overrides createTabContent method which returns View object. My question is: How can I return an activity object from the createTabContent method instead of View object. I don't want to inflate the view from xml because my activities have events of which i handled individually in their respective activity classes Or is their any workaround for the my situation am using RadioGroup for my tabs. Thanks, will appreciate response. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Rtsp Http Streaming
I can upen this file in vlc player. But same problem still continue PVMFInfoErrorHandlingComplete error. I also tryed android 1.6 , anroid 2.1 and android 2.3 devices. Filiz Gökçe On 26 May 2011 18:27, dan raaka danra...@gmail.com wrote: If this is a generic issue - please file a bug under b.android.com -Dan On Thu, May 26, 2011 at 1:55 AM, Hitendrasinh Gohil hitendra.virtuei...@gmail.com wrote: hi, then just try to log the url that ur applying to datasource.and first check it out with vlc player that is it working or not? because there is an error with initialization. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to run app on command shell?
Android doesn't have a concept of run an app. Depending on the app in question, running it may involve starting one of its Activities, displaying AppWidgets, invoking BroadcastReceivers, etc., etc. What Android does have is a concept of is send an intent to a package. So in order to kick your app into life (whatever that means for your app), you need to fire an appropriate Intent. You can do this from the shell via am (which I believe is the Application Manager). A typical intent to launch an activity might look like this: adb shell am start -a android.intent.action.MAIN -n com.your.packagename/.ActivityName where you obviously want to substitute in your own package and activity names. Hint: when you run an app form Eclipse, the Android Console shows the intent that was used to launch it. Can be helpful in forming the parameters to shell am. String -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Launch via URL issue
Hi All, I have an application which gets launched on the URL click. Now if i get an SMS or in Calendar event i have a URL and i click on the link to launch the application it works fine; i see splash screen followed by login screen. Then If i long home and go back to the SMS or Calendar it displays the splash screen( which the launcher and reads the Intent ) of my application; which is not expected. Is there any way to handle this case; the Messaging app or Calendar app should not display the application which they have launched. I tried using the android:taskAffinity and android:allowTaskReparenting flags in AndroidManifest file; but it did not help. Any suggestions on this...? Thanks and Regards; Abhay -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] getFilesDir() throws NullPointerException
Dear list, calling getFilesDir() in my main activity works as expected, but if I call it later from another class it throws a NullPointerException: D/AndroidRuntime( 716): Shutting down VM W/dalvikvm( 716): threadid=1: thread exiting with uncaught exception (group=0x40015560) E/AndroidRuntime( 716): FATAL EXCEPTION: main E/AndroidRuntime( 716): java.lang.RuntimeException: Unable to start activity ComponentInfo{se.miun.application/se.miun.application.MainActivity}: java.lang.NullPointerException What could be the reason and how to fix this? (The problematic class extends Activity). Please tell me if I should provide more information. Marco -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 client with .NET + CQRS Back-end example available
In case someone is interested in using Android as a client for .NET with CQRS back-end, we have an example that simplifies the development of such architecture. We're going to add automatic Android UI generation based on CQRS architecture as well, but I figured to drop by and share the already existing example. The videos are available at: http://www.youtube.com/playlist?p=PLB3366B17004D5DB9 The documentation of freely available simplification technology with separate case study for CQRS (including the Android client) is available at: http://abstractiondev.wordpress.com We'll be happy to assist anyone who wants to simplify their area of development regarding to Android development. Kalle -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] getFilesDir() throws NullPointerException
The only reason I can think of for getFilesDir() to return null is if it's not a real live Activity instance (you created it via new MyActivity() instead of starting it with startActivity(), you call getFilesDir() sometime after the activity is destroyed, etc.). On Fri, May 27, 2011 at 8:00 AM, Marco net...@lavabit.com wrote: Dear list, calling getFilesDir() in my main activity works as expected, but if I call it later from another class it throws a NullPointerException: D/AndroidRuntime( 716): Shutting down VM W/dalvikvm( 716): threadid=1: thread exiting with uncaught exception (group=0x40015560) E/AndroidRuntime( 716): FATAL EXCEPTION: main E/AndroidRuntime( 716): java.lang.RuntimeException: Unable to start activity ComponentInfo{se.miun.application/se.miun.application.MainActivity}: java.lang.NullPointerException What could be the reason and how to fix this? (The problematic class extends Activity). Please tell me if I should provide more information. Marco -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.6 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: getFilesDir() throws NullPointerException
Thanks for the very fast response. The only reason I can think of for getFilesDir() to return null is if it's not a real live Activity instance (you created it via new MyActivity() instead of starting it with startActivity(), you call getFilesDir() sometime after the activity is destroyed, etc.). Where do I have to call startActivity()? It's not unlikely that I make something conceptually wrong in my application, since I'm new to android. This is what I did: /*/ // MainActivity.java public class MainActivity extends Activity { public MainActivity() { } @Override public void onCreate(Bundle savedInstanceState) { // getFilesDir() works here AnotherClass myA = new AnotherClassImpl(); myA.start(); } } // AnotherClassImpl.java public class AnotherClassImpl implements AnotherClass { public AnotherClassImpl () { ProblematicClass props = ProblematicClass.getProperties(); } // ProblematicClass.java public class ProblematicClass extends Activity { private static ProblematicClass myProblematicClass = null; public static ProblematicClass getProperties(){ if(myProblematicClass == null) { myProblematicClass = new ProblematicClass(); } return myProblematicClass; } public MediaSenseProperties() { // getFilesDir() failes here } } /*/ I hope this illustrates my method. All this should take place in the same activity. Marco -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Immediate need of Java Developer // Chicago,IL // GC/CITIZEN
Hello, Hope you are doing well. I am a technical recruiter with Panzer Solutions LLC Software Implementing and IT consulting company located in CT. Please go through the Job Description and send me your updated resume with contact information. Title : Java Developer Location: Chicago,IL Duration: 6 month contract to hire (They need to be eligible to go perm) ** MUST BE GC/ US CITIZEN * Must Haves: 5 years of experience with Java Development (J2EE) Eclipse IDE Spring Java Beans JDBC Experience with Java architecture for XML Binding (JAXB) Strong written and verbal skills Strong analytical skills Plusses: Skills / Knowledge in the following technologies: FIX Unix Oracle This position is a development role and we are seeking a Software Engineer who is very excited to work in a challenging environment. They will work on complex, enterprise-scale projects using Java J2EE development technologies. This position also requires an individual with strong spring experience and has extensive experience in developing, deploying, and tuning Java EE applications. Experience with Eclipse IDE and JDBC are needed. Warm Regards, Emraaz Khan, Panzer Solutions LLC emr...@panzersolutions.com Direct: 203-813-2052 -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] webview autoclick
Let's say you have a Webview with a button in it that says Tweet. Is there a way to automatically click that button? Thanks. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Widget-specific Preferences
Kostya/String, Is nothing ever easy? So close, yet so far... :-) Some of my preferences have dependent keys. Since the keys are being renamed to be widget-specific I, of course, have to rename the dependent keys accordingly as well. Pref2 is dependent on Pref1. Pref1 comes through my overridden onPrepareAddPreference and I call setKey to rename its key. Pref2 comes through onPrepareAddPreference and I reset its key as usual and I also reset its dependent key to have the correct Pref1 key name. This triggers a java.lang.IllegalStateException stating that Dependency not found for preference. Since Pref1 has already been reset I would expect that by the time Pref2 comes in Pref1 is already out there. Also, I did not think that ordering would matter anyway as long as all the keys make sense at the of the inflation. Any ideas? Incidentally, I tried both onPrepareAddPreference and addPreference just in case one worked differently than the other. And, yes, I called up to super at the end of my overridden method. ...Jake KV == Kostya Vasilyev kmans...@gmail.com writes: KV Yes, a cast is what I'm suggesting. From the design point of KV view, you'll end up with two classes that are meant to be used KV together. KV You could even do an instanceof check before the cast, and throw KV an exception with a nice descriptive message if the check returns KV false :) KV -- KV Kostya Vasilyev KV 27.05.2011 1:56 пользователь Jake Colman col...@ppllc.com KVнаписал: All the magic happens from addPreferencesFromResource which inflates my preferences XML and instantiates the Preference objects. With everything we've discussed until now, I know what/how to subclass so that I can hook into things at the correct level to reset my key. But if it's WidgetOptionsActivity that has the widget id (from its super class) how does that get passed into addPreferencesFromResource? Unless you are suggesting that I can call a method via the context which is, in essence, my Activity? So cast the context into the Activity and call the method? KV == Kostya Vasilyev kmans...@gmail.com writes: KV Preferences are inflated with a Context, which in this case is KV your PreferenceActivity subclass. KV I'd make two classes, WidgetOptionsActivity and KV WidgetOptionsPreferenceCategory, with the expectation that the KV latter is always used within the former (like maps API and KV MapActivity). KV The widget id is passed to the activity as an intent extra, so KV just get it from there and make available as a method / field KV before you call addPreferencesFromResource(). KV Then you could derive YourProjectNameWidgetOptionsActivity from KV WidgetOptionsActivity. KV -- Kostya KV 2011/5/27 Jake Colman col...@ppllc.com Thanks Kostya and String, these were great answers. I can see how I can create my own subclass and use them instead of my the android classes. My problem now is that it is the Preference Activity, through an intent extra, that knows the specific widget ID KV for which it is being displayed. I don't see that the Preference or PreferenceCategory subclassses have access to the parent activity that caused them to be created. Since Android is instantiating my subclasses for me, I don't see how I have a hook to pass the subclass the crucial piece of data required to reset its key - which is the whole purpose of this exercise. It looks like onPrepareAddPreference is probable the better place to reset the key than is addPreference simply because this is more of a preparation step anyway. It's great to have multiple options! ...Jake KV == Kostya Vasilyev kmans...@gmail.com writes: KV Where your preference class needs to have the standard KV constructor, just like with views: KV public class MyPreferenceCategory extends PreferenceCategory { KV public MyPreferenceCategory(Context context, AttributeSet attrs) { KV super(context, attrs); KV } KV } KV And here is another useful override: KV KV http://developer.android.com/reference/android/preference/PreferenceGroup.html#onPrepareAddPreference(android.preference.Preference KV ) KV onPrepareAddPreference KV -- Kostya KV 2011/5/27 String sterling.ud...@googlemail.com In your XML settings-definition file, here's what you need. Just KV use: com.my.package.PrefSubclass android:key=pref_key ... / where com.my.package is your package name, and PrefSubclass is the class name of your Preference subclass. Use this instead of: EditTextPreference android:key=pref_key ... / or whatever Preference class you're
[android-developers] Mac or PC for development
Hi all, I am going to buy a new machine. Either the Macbook pro 15' baseline or a PC with the same specs. I will mainly be using it for development purposes. I will be working on android mainly. Which one should I buy? I will also be working with a lot of the other languages such as python, ruby, java etc. Thanks -- Raghav Sood http://www.raghavsood.com/ http://www.androidappcheck.com/ http://www.telstop.tel/ -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: getFilesDir() throws NullPointerException
ProblematicClass should not extend Activity. On Fri, May 27, 2011 at 9:10 AM, Marco net...@lavabit.com wrote: Thanks for the very fast response. The only reason I can think of for getFilesDir() to return null is if it's not a real live Activity instance (you created it via new MyActivity() instead of starting it with startActivity(), you call getFilesDir() sometime after the activity is destroyed, etc.). Where do I have to call startActivity()? It's not unlikely that I make something conceptually wrong in my application, since I'm new to android. This is what I did: /*/ // MainActivity.java public class MainActivity extends Activity { public MainActivity() { } @Override public void onCreate(Bundle savedInstanceState) { // getFilesDir() works here AnotherClass myA = new AnotherClassImpl(); myA.start(); } } // AnotherClassImpl.java public class AnotherClassImpl implements AnotherClass { public AnotherClassImpl () { ProblematicClass props = ProblematicClass.getProperties(); } // ProblematicClass.java public class ProblematicClass extends Activity { private static ProblematicClass myProblematicClass = null; public static ProblematicClass getProperties(){ if(myProblematicClass == null) { myProblematicClass = new ProblematicClass(); } return myProblematicClass; } public MediaSenseProperties() { // getFilesDir() failes here } } /*/ I hope this illustrates my method. All this should take place in the same activity. Marco -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.6 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
Re: [android-developers] Mac or PC for development
On Fri, May 27, 2011 at 11:06 PM, Raghav Sood raghavs...@gmail.com wrote: Hi all, I am going to buy a new machine. Either the Macbook pro 15' baseline or a PC with the same specs. I will mainly be using it for development purposes. I will be working on android mainly. Which one should I buy? I will also be working with a lot of the other languages such as python, ruby, java etc. Thanks It doesn't matter. Get as many cores and as much memory as you can afford. And a big screen. P.S. Apple is evil :) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: getFilesDir() throws NullPointerException
On 2011-05-27 Mark Murphy mmur...@commonsware.com wrote: ProblematicClass should not extend Activity. Then methods like getFileDir(), openFileInput(), … are not defined. That's the reason why I extended Activity. How to get access to these methods correctly? Marco -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Mac or PC for development
On 27 May 2011 16:06, Raghav Sood raghavs...@gmail.com wrote: I will mainly be using it for development purposes. I will be working on android mainly. Which one should I buy? I will also be working with a lot of the other languages such as python, ruby, java etc. PC shall be cheaper so you will have some spare bucks for devices Regards, Marcin Orlowski *Tray Agenda http://bit.ly/trayagenda* - keep you daily schedule handy... *Date In Tray* http://bit.ly/dateintraypro - current date at glance... WebnetMobile on *Facebook http://webnetmobile.com/fb/* and *Twitterhttp://webnetmobile.com/twitter/ * -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Looking for Documentum Admin in Nashville,TN
Dear Professional, Hope you are doing well. I am a technical recruiter with Panzer Solutions LLC Software Implementing and IT consulting company located in CT. Please go through the Job Description and send me your updated resume with contact information. *Please reply at emr...@panzersolutions.com * Title :Documentum Admin Location :Nashville,TN Duration :Long Term Contract F2F Required * Need: SME in Documentum Admin (migrations, matienence, troubleshooting) I am think these candidates will have some sort of development background as well. We need to have someone with good communicaiton. Local candidates are preferred but not required. They may need to bring this person in for a face to face interview. * * Warm Regards, Emraaz Khan, Panzer Solutions LLC emr...@panzersolutions.com Direct: 203-813-2052* -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Mac or PC for development
I purchased a MacBookPro 6 months ago and I like it but there are things I definitely miss about my old thinkpad. If you think you'll ever want to develop for the iphone or ipad then you should get the mac. Otherwise get the PC and save some money. On May 27, 10:34 am, Marcin Orlowski webnet.andr...@gmail.com wrote: On 27 May 2011 16:06, Raghav Sood raghavs...@gmail.com wrote: I will mainly be using it for development purposes. I will be working on android mainly. Which one should I buy? I will also be working with a lot of the other languages such as python, ruby, java etc. PC shall be cheaper so you will have some spare bucks for devices Regards, Marcin Orlowski *Tray Agenda http://bit.ly/trayagenda* - keep you daily schedule handy... *Date In Tray* http://bit.ly/dateintraypro - current date at glance... WebnetMobile on *Facebook http://webnetmobile.com/fb/* and *Twitterhttp://webnetmobile.com/twitter/ * -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Simpler UI Development with Android-Query
Hello Peter, It's a nice idea and project. I haven't tried AQuery yet, but I have a little remark. In your examples there is: aq.id(R.id.icon).image(R.drawable.icon).visible().clicked(this, someMethod); I'm not a big fan of this clicked() function. The problem is that the java compiler cannot check whether someMethod exists, and also it is not available to Eclipse refactoring, when renaming a method, which is a pretty handy feature. I think that a clicked(OnClickListener listener) method could be better. Also, having different methods for each click event isn't so nice. For instance, in my case, I have a file manager, with about 10 buttons (not all visible at the same time), but I have only one method to handle all clicks: @Override public void onClick(View view) { switch (view.getId()) { case R.id.button1: ... case R.id.button10: } } I'm using this in quite a few places and find it pretty efficient. To register my class as listener for all these buttons I use a small loop. But, with jQuery you have these selectors and such which allow you to register as event listener for multiple elements at once. Maybe that you could consider the idea, for example with a method which matches all instances of a certain View class, within a given ViewGroup. Just a couple of ideas :) Olivier On 05/27/2011 08:17 AM, Peter Liu wrote: [Reposting to correct group] Hi. I am an Android developer and just started an open source project at: http://code.google.com/p/android-query/ It’s a light weight library that’s designed to make Android coding simpler and easier. If you are familiar with jQuery style of coding, you will like AQuery. Why AQuery? Less Code Chaining Binding Handle Fragmentation Multiple UI, One Piece of Code Extendable Light Weight Open Source Any comments, feedback, or contribution will be appreciated! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Adapting BluetoothChat Example for One Server and Multiple Clients
I'm attempting to adapt the BluetoothChat example that comes with the SDK to a single-server, multiple-client configuration. I'm having issues and hope someone can help. I've created two distinct apps, a server and a client, rather than have a single app function as both server and client, as in the example. So the upon starting the app, the server creates a bluetooth service, which creates a new AcceptThread, which listens for incoming connections. I made a couple of modifications to the example code so that the AcceptThread continues to listen, even after the first connection is made (the example stops listening after the one connection is made, because it only needs to establish connections between two devices). I created an ArrayList to handle the multiple connections. Each time a new connection is attempted from a remote device, a new ConnectedThread is created and added to the list. The first client connects just fine. When the second client attempts to connect, the connection fails. The log output is: D/BluetoothEventLoop( 140): Device property changed: device address property: Connected value: true I/BluetoothService( 140): ACL connected, mAclLinkCount = 2 D/BluetoothEventLoop( 140): Device property changed: device address property: Connected value: false I/BluetoothService( 140): ACL disconnected, mAclLinkCount = 1 So it looks like the second connection attempt is successful, but then it is immediately disconnected. This looks like it's happening at a low level, outside anything the code is handling. This happens with a number of different types of test devices, so I don't think it's due to a particular firmware or hardware issue. Can anyone help with this? Also, can anyone point to an example of a server-multiple client connection example using bluetooth with Android? I came across an Air Hockey example: http://code.google.com/p/apps-for-android/source/browse/#svn%2Ftrunk%2FBTClickLinkCompete%2Fsrc%2Fnet%2Fclc%2Fbt But this project is very glitchy on my test devices and the actual game won't display properly. Does anyone know if there is an example of BluetoothChat extended to handle multiple connections? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Animation transition between activities in ActivityGroup?
it is not working for Activity group. As i found after google, in case of ActivityGroup we have to do some thing with localActivityManager. that i am unable to do presently. Regards Imran ali On May 27, 3:19 am, TreKing treking...@gmail.com wrote: On Thu, May 26, 2011 at 8:15 AM, imran ali imran...@gmail.com wrote: I am using ActivityGroup and in that i have been using activities, how can i animate activities at the time of setContentView(view)? Maybe this:http://developer.android.com/reference/android/app/Activity.html#over..., int) - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Widget-specific Preferences
Jake, I just tried it with a simple test, and yes, I get the same exception. The reason is that setDependency() tries to register the dependency right away, and doesn't find the depndency because the process of loading preferences from XML hasn't completed yet (which it does not check). It *might* be possible to work around it with more overrides here and there, but... instead... I admit that the idea only seemed good, and then was crushed to pieces by the reality of how things work. My apologies for having wasted your time. -- Kostya 2011/5/27 Jake Colman col...@ppllc.com Kostya/String, Is nothing ever easy? So close, yet so far... :-) Some of my preferences have dependent keys. Since the keys are being renamed to be widget-specific I, of course, have to rename the dependent keys accordingly as well. Pref2 is dependent on Pref1. Pref1 comes through my overridden onPrepareAddPreference and I call setKey to rename its key. Pref2 comes through onPrepareAddPreference and I reset its key as usual and I also reset its dependent key to have the correct Pref1 key name. This triggers a java.lang.IllegalStateException stating that Dependency not found for preference. Since Pref1 has already been reset I would expect that by the time Pref2 comes in Pref1 is already out there. Also, I did not think that ordering would matter anyway as long as all the keys make sense at the of the inflation. Any ideas? Incidentally, I tried both onPrepareAddPreference and addPreference just in case one worked differently than the other. And, yes, I called up to super at the end of my overridden method. ...Jake KV == Kostya Vasilyev kmans...@gmail.com writes: KV Yes, a cast is what I'm suggesting. From the design point of KV view, you'll end up with two classes that are meant to be used KV together. KV You could even do an instanceof check before the cast, and throw KV an exception with a nice descriptive message if the check returns KV false :) KV -- KV Kostya Vasilyev KV 27.05.2011 1:56 пользователь Jake Colman col...@ppllc.com KVнаписал: All the magic happens from addPreferencesFromResource which inflates my preferences XML and instantiates the Preference objects. With everything we've discussed until now, I know what/how to subclass so that I can hook into things at the correct level to reset my key. But if it's WidgetOptionsActivity that has the widget id (from its super class) how does that get passed into addPreferencesFromResource? Unless you are suggesting that I can call a method via the context which is, in essence, my Activity? So cast the context into the Activity and call the method? KV == Kostya Vasilyev kmans...@gmail.com writes: KV Preferences are inflated with a Context, which in this case is KV your PreferenceActivity subclass. KV I'd make two classes, WidgetOptionsActivity and KV WidgetOptionsPreferenceCategory, with the expectation that the KV latter is always used within the former (like maps API and KV MapActivity). KV The widget id is passed to the activity as an intent extra, so KV just get it from there and make available as a method / field KV before you call addPreferencesFromResource(). KV Then you could derive YourProjectNameWidgetOptionsActivity from KV WidgetOptionsActivity. KV -- Kostya KV 2011/5/27 Jake Colman col...@ppllc.com Thanks Kostya and String, these were great answers. I can see how I can create my own subclass and use them instead of my the android classes. My problem now is that it is the Preference Activity, through an intent extra, that knows the specific widget ID KV for which it is being displayed. I don't see that the Preference or PreferenceCategory subclassses have access to the parent activity that caused them to be created. Since Android is instantiating my subclasses for me, I don't see how I have a hook to pass the subclass the crucial piece of data required to reset its key - which is the whole purpose of this exercise. It looks like onPrepareAddPreference is probable the better place to reset the key than is addPreference simply because this is more of a preparation step anyway. It's great to have multiple options! ...Jake KV == Kostya Vasilyev kmans...@gmail.com writes: KV Where your preference class needs to have the standard KV constructor, just like with views: KV public class MyPreferenceCategory extends PreferenceCategory { KV public MyPreferenceCategory(Context context, AttributeSet attrs) { KV super(context, attrs); KV } KV } KV And here is another useful override: KV KV
Re: [android-developers] Re: getFilesDir() throws NullPointerException
On Fri, May 27, 2011 at 10:31 AM, Marco net...@lavabit.com wrote: On 2011-05-27 Mark Murphy mmur...@commonsware.com wrote: ProblematicClass should not extend Activity. Then methods like getFileDir(), openFileInput(), … are not defined. That's the reason why I extended Activity. You cannot create new Activity instances via the constructor and expect them to work. http://developer.android.com/guide/topics/fundamentals/activities.html How to get access to these methods correctly? Move the code from ProblematicClass into MainActivity. Or, if you are careful, you can pass your instance of MainActivity to ProblematicClass. Or, if you are careful, you can make ProblematicClass an inner class of MainActivity. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.6 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: Two-way listeners/observers
@Kostya: Thanks for your answer. Based on your answer, Handler does sound better that AsyncTask for this. I looked a little bit into HandlerThread, probabaly have to try it out to understand it fully. One question though, forgetting about the whole native thing for a moment... even if there are two Java classes (one Activity one backend) with methods running in two threads. Can they BOTH implement listeners, hold a reference to each other call each other's listening methods? That would make the design really tightly-coupled. Is there a design pattern to use where they both can listen to each other call each other asynchronously - whenever needed to? On May 26, 1:07 pm, Kostya Vasilyev kmans...@gmail.com wrote: I would start by wrapping some of the C++ code in Java with JNI (you probably already have that). AsyncTask isn't really appropriate, because it's a task, not a process, meaning it doesn't have a duration in time any more than necessary for one item of work. You can use Handler objects, they are not necessarily tied to the UI. You'd need two: one on the UI thread owned by the activity, one owned by the Java wrapper of the back-end thread, and associated with that thread. Take a look at HandlerThread, that's the basic idea for your backend, except you'd be calling a native method for processing messages. -- Kostya 2011/5/26 Oceanblue ns1...@gmail.com I have an interesting design challenge: I have a frontend(Activity) and a backend (written in native C/C++) code. The backend is a complex object which partially controls the flow of application once started runs in it's own thread. So I have a distributed control scenario. The Activity needs to be able to send messages asynchronously to the backend which then takes certain actions. But the backend also needs to be able to send messages asynchronously to the Activity, to which it responds by chnaging UI, firing methods etc. Essentially what I need is a two-way listener. So backend sends a message to screen (take picture, prompt user, get location, take another picture nowm etc) and screen does what it needs to do. But in addition, the screen should also be able to call the backend-listener to send back messages (captured camera image, system generated - I got paused/destroyed message, etc) in the callbacks of these events. Main problem is that this is all asynchronous. Is this possible without tight-coupling? Is this even possible? I have thought of Asynctask/handlers (but that's a one way street for informing the UI thread), observer-pattern (both objects will be observer/observable?) but confused on where to begin. Any thoughts, links would be very helpful. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Widget-specific Preferences
Kostya, You did not waste my time at all! First of all, this was a great learning opportunity. Second of all, the suggestion was great - this should have worked! Maybe I need to do a second pass, somehow, to reset the dependent keys. But if I need a second pass, maybe I just do it all at that time. ...Jake KV == Kostya Vasilyev kmans...@gmail.com writes: KV Jake, KV I just tried it with a simple test, and yes, I get the same KV exception. KV The reason is that setDependency() tries to register the KV dependency right away, and doesn't find the depndency because the KV process of loading preferences from XML hasn't completed yet KV (which it does not check). It *might* be possible to work around KV it with more overrides here and there, but... instead... KV I admit that the idea only seemed good, and then was crushed to KV pieces by the reality of how things work. KV My apologies for having wasted your time. KV -- Kostya KV 2011/5/27 Jake Colman col...@ppllc.com Kostya/String, Is nothing ever easy? So close, yet so far... :-) Some of my preferences have dependent keys. Since the keys are being renamed to be widget-specific I, of course, have to rename the dependent keys accordingly as well. Pref2 is dependent on Pref1. Pref1 comes through my overridden onPrepareAddPreference and I call setKey to rename its key. Pref2 comes through onPrepareAddPreference and I reset its key as usual and I also reset its dependent key to have the correct Pref1 key name. This triggers a java.lang.IllegalStateException stating that Dependency not found for preference. Since Pref1 has already been reset I would expect that by the time Pref2 comes in Pref1 is already out there. Also, I did not think that ordering would matter anyway as long as all the keys make sense at the of the inflation. Any ideas? Incidentally, I tried both onPrepareAddPreference and addPreference just in case one worked differently than the other. And, yes, I called up to super at the end of my overridden method. ...Jake KV == Kostya Vasilyev kmans...@gmail.com writes: KV Yes, a cast is what I'm suggesting. From the design point of KV view, you'll end up with two classes that are meant to be used KV together. KV You could even do an instanceof check before the cast, and throw KV an exception with a nice descriptive message if the check returns KV false :) KV -- KV Kostya Vasilyev KV 27.05.2011 1:56 пользователь Jake Colman KV col...@ppllc.com KV написал: All the magic happens from addPreferencesFromResource which inflates my preferences XML and instantiates the Preference objects. With everything we've discussed until now, I know what/how to subclass so that I can hook into things at the correct level to reset my key. But if it's WidgetOptionsActivity that has the widget id (from its super class) how does that get passed into addPreferencesFromResource? Unless you are suggesting that I can call a method via the context which is, in essence, my Activity? So cast the context into the Activity and call the method? KV == Kostya Vasilyev kmans...@gmail.com writes: KV Preferences are inflated with a Context, which in this case is KV your PreferenceActivity subclass. KV I'd make two classes, WidgetOptionsActivity and KV WidgetOptionsPreferenceCategory, with the expectation that the KV latter is always used within the former (like maps API and KV MapActivity). KV The widget id is passed to the activity as an intent extra, so KV just get it from there and make available as a method / field KV before you call addPreferencesFromResource(). KV Then you could derive YourProjectNameWidgetOptionsActivity from KV WidgetOptionsActivity. KV -- Kostya KV 2011/5/27 Jake Colman col...@ppllc.com Thanks Kostya and String, these were great answers. I can see how I can create my own subclass and use them instead of my the android classes. My problem now is that it is the Preference Activity, through an intent extra, that knows the specific widget ID KV for which it is being displayed. I don't see that the Preference or PreferenceCategory subclassses have access to the parent activity that caused them to be created. Since Android is instantiating my subclasses for me, I don't see how I have a hook to pass the subclass the crucial piece of data required to reset its key - which is the whole purpose of this exercise. It looks like onPrepareAddPreference is probable the better place to reset the key than is addPreference simply because this is more of a
[android-developers] Re: Text scaling properly on two different mdpi devices (Evo, and Galaxy Tab 10.1)
Robert, one thing I have done to mitigate this problem is have special code in my onCreate that checks for table-like resolutions (e.g., width or height 854) and then do perform a scaling function on the text sizes of those TextViews that need it. It works, but makes assumptions I would not like to make about display resolution and physical screen size. This obviously is not ideal, and is a hack. That's why I was wondering if the folks at Google could suggest a better way to do this. On May 26, 7:22 pm, Robert Green rbgrn@gmail.com wrote: I also want to do this exact same thing. I don't want mytextto be the same physical size - I want it to be bigger when there are more pixels regardless of density (yes it means super bigtexton a 10 screen). Since Android made compatibility mode a postage stampish kind of mode on tablets instead of just magnifying (like I really, really think it should have) it broke all my legacy games (they look like crap on the tablets) and now I have lots more updating work to do, but since I was stupid about it and usedtextviews for games like Wixel (which used to sound like a good idea for what kind of game it was but now I'm regretting using anything other than a single custom view that I have control over) I have a ridiculous amount ofscaling around of things that probably will need additional work later as different screens come out... On May 25, 11:49 am, Mike michaeldouglaskra...@gmail.com wrote: OK. Having a day or so to think about this, I think I asked the wrong question. So, let me try again: Is there way to do fontscalingsimilar to the way you can assign percentages to a layout? I realized that with my existing portrait mdpi layout, I was inadvertently relying on the height of some of mytextto affect the placement of Views that came below thetext. This looks great on a myTouch, but crappy on a Galaxy Tab 10.1 since there are so many remaining vertical pixels (even with the fontscalingusing dp units.) Regards, - Mike On May 23, 4:46 pm, Dianne Hackborn hack...@android.com wrote: The font size should be the same on those two devices (myTouch and Galaxy Tab 10.1) because they have the same density. What is bringing you to think they should be different? On Mon, May 23, 2011 at 3:34 PM, Mike michaeldouglaskra...@gmail.comwrote: Hi Dianne, Thanks for the quick reply. I understand density to be a function of native resolution versus physical display size. So, the new Galaxy Tab 10.1 which has a native resolution of 800 x 1280 pixels and a physical display size of 10.1 diagonal ends up being a mdpi device. When I populate a DisplayMetrics for the Galaxy Tab 10.1, it gives me a density of 1.0 and a density dpi of DENSITY_MEDIUM which confirms this. I misspoke with regard to the Evo. I apologize. It is indeed an hdpi device. In any case, I believe I still need to address this issue since a device such as the myTouch (320x480 native resolution) is an mdpi device as well. Even though the myTouch and Galaxy Tab 10.1 have drastically different native resolutions as you point out. I've been having difficulty using device independent units for mytextsize to make the font look appropriate on both devices since they map to the same layout file. - Mike On May 23, 4:16 pm, Dianne Hackborn hack...@android.com wrote: Evo and Galaxy Tab are both hdpi (though the Tab technically should probably be mdpi... hdpi is okay though, it is just a design decision for the device to make the overall UI larger). Also density != higher res. It is REALLY REALLY important to understand this. The Xoom is mdpi but much higher resolution than the hdpi phones. It just has a bigger screen, but as a result is lower density. If all you care about is the screen resolution (that is you don't care really about having your UI size remain about the same across devices), then don't use density which will pick resources based on *screen density* not resolution. You could instead use -nodpi and just do your own resource selection based on how many pixels you have to use. On Mon, May 23, 2011 at 2:35 PM, Mike michaeldouglaskra...@gmail.com wrote: I've started work to get my games to scale nicely for the higher-res displays like the Xoom and Galaxy Tab devices. I've made use of the ldpi/mdpi/hdpi/xhdpi folder naming convention for my resources which works nicely for layouts and graphics, but not so much fortextsizescaling. The problem is that an Evo and a Galaxy Tab 10.1 are both mdpi devices and will map to the same layout file. Yet, I need to scale thetextsize differently for these two devices. (I'm usingtextsize units of dp.) Any ideas on something obvious I might be
[android-developers] Re: Two-way listeners/observers
Yes, that's possible. You'd have to take care of the threading issues, though (avoiding race conditions or deadlocks, etc). -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Widget-specific Preferences
Actually, the reason we went down this path in the first place was because if I did not reset the keys during the inflation process the Preference Screen did not reflect the current values. I can still use a second pass, however, inside of onCreate() but after inflation to reset the dependent keys. That should probably work. Jake == Jake Colman col...@ppllc.com writes: Jake Kostya, Jake You did not waste my time at all! First of all, this was a Jake great learning opportunity. Second of all, the suggestion was Jake great - this should have worked! Maybe I need to do a second Jake pass, somehow, to reset the dependent keys. But if I need a Jake second pass, maybe I just do it all at that time. Jake ...Jake KV == Kostya Vasilyev kmans...@gmail.com writes: KV Jake, KV I just tried it with a simple test, and yes, I get the same KV exception. KV The reason is that setDependency() tries to register the KV dependency right away, and doesn't find the depndency because the KV process of loading preferences from XML hasn't completed yet KV (which it does not check). It *might* be possible to work around KV it with more overrides here and there, but... instead... KV I admit that the idea only seemed good, and then was crushed to KV pieces by the reality of how things work. KV My apologies for having wasted your time. KV -- Kostya KV 2011/5/27 Jake Colman col...@ppllc.com Kostya/String, Is nothing ever easy? So close, yet so far... :-) Some of my preferences have dependent keys. Since the keys are being renamed to be widget-specific I, of course, have to rename the dependent keys accordingly as well. Pref2 is dependent on Pref1. Pref1 comes through my overridden onPrepareAddPreference and I call setKey to rename its key. Pref2 comes through onPrepareAddPreference and I reset its key as usual and I also reset its dependent key to have the correct Pref1 key name. This triggers a java.lang.IllegalStateException stating that Dependency not found for preference. Since Pref1 has already been reset I would expect that by the time Pref2 comes in Pref1 is already out there. Also, I did not think that ordering would matter anyway as long as all the keys make sense at the of the inflation. Any ideas? Incidentally, I tried both onPrepareAddPreference and addPreference just in case one worked differently than the other. And, yes, I called up to super at the end of my overridden method. ...Jake KV == Kostya Vasilyev kmans...@gmail.com writes: KV Yes, a cast is what I'm suggesting. From the design point of KV view, you'll end up with two classes that are meant to be used KV together. KV You could even do an instanceof check before the cast, and throw KV an exception with a nice descriptive message if the check returns KV false :) KV -- KV Kostya Vasilyev KV 27.05.2011 1:56 пользователь Jake Colman KV col...@ppllc.com KV написал: All the magic happens from addPreferencesFromResource which inflates my preferences XML and instantiates the Preference objects. With everything we've discussed until now, I know what/how to subclass so that I can hook into things at the correct level to reset my key. But if it's WidgetOptionsActivity that has the widget id (from its super class) how does that get passed into addPreferencesFromResource? Unless you are suggesting that I can call a method via the context which is, in essence, my Activity? So cast the context into the Activity and call the method? KV == Kostya Vasilyev kmans...@gmail.com writes: KV Preferences are inflated with a Context, which in this case is KV your PreferenceActivity subclass. KV I'd make two classes, WidgetOptionsActivity and KV WidgetOptionsPreferenceCategory, with the expectation that the KV latter is always used within the former (like maps API and KV MapActivity). KV The widget id is passed to the activity as an intent extra, so KV just get it from there and make available as a method / field KV before you call addPreferencesFromResource(). KV Then you could derive YourProjectNameWidgetOptionsActivity from KV WidgetOptionsActivity. KV -- Kostya KV 2011/5/27 Jake Colman col...@ppllc.com Thanks Kostya and String, these were great answers. I can see how I can create my own subclass and use them instead of my the android classes. My problem now is that it is the Preference Activity, through an intent extra, that knows the specific widget ID KV for which it is being displayed. I don't see that the Preference or PreferenceCategory subclassses have access to
[android-developers] Re: A little Hi and our old Unable to establish connections...
Hi Michael, now works, thanks! now i receive OK messages of connections from LogCat; but now i'm confusing in how redirect messages from emulator to another OSC client in my computer (i'm reading http://developer.android.com/guide/developing/devices/emulator.html#console, but i'm still very confuse [i'm not a programmer ;) ]); any help will be great! Here is an method used on onResume() to connect and the class OSCConnection mentioned... private void startOSCConnection(Boolean connection) { if(connection){ this.osc = new OSCConnection(); IP = 10.0.2.3 PORT = 11001; try { osc.connect(IP, PORT); if(osc.isConnected()){ isOscConnected = osc.isConnected(); //now send a notification for other side: //TODO: create a method to receive notifications osc.send(getString(R.string.oscAddr_notify_connection), OSCConnection.OSC_HELLO); // replace by: /helloOSC/notification/ connections and hello Log.d(TAG, OSC message sent: +[+getString(R.string.oscAddr_notify_connection) +,+OSCConnection.OSC_HELLO+]); } } catch (Exception e) { Log.e(TAG, unabe to establish OSC connection, e); } } else{ //TODO AlertDialog } } public class OSCConnection implements Connection { /* OSC addresses*/ public static final String OSC_ROOT = /helloOSC; public static final String OSC_HELLO = hello; public static final String IP_ADB = 10.0.2.3; public static final int PORT_ADB = ; public static final int OSC_PD = 11002; private String ipServer = null; private Integer portServer = null; private OSCPortOut sender = null; public OSCConnection() { } public void connect(String ip, Integer port){ /* * first check values: IP and port */ if(ip!=null){ ipServer = ip; Log.d(TAG,Setting IP with value: +ipServer); } else{ Log.i(TAG,IP assigned with null value by user.); Log.d(TAG,Setting IP with default value: +IP_ADB); ipServer = IP_ADB; } if(port!=null){ portServer = port; Log.d(TAG,Setting Port with value: +portServer); } else{ Log.i(TAG,Port assigned with null value by user.); Log.d(TAG,Setting IP with default value: +PORT_ADB); portServer = port; } //values setted, now try connect try { sender = new OSCPortOut(InetAddress.getByName(ipServer), portServer); if(sender!=null){ Log.i(TAG,connected with sucess: + sender.getClass()); } else{ Log.e(TAG,OSCPortOut assigned with null value); } } catch (Exception e) { Log.i(TAG,Not be possible to connect, e); } } @Override public Boolean isConnected() { return (sender != null); } public void send(String oscAddr, Object[] args) { if (oscAddr != null) { OSCMessage msg = new OSCMessage(oscAddr, args); try { sender.send((OSCPacket) msg); Log.i(TAG, message sent to +oscAddr+ at +getIP() +, port+getPort()); } catch (Exception e) { Log.e(OSCConnection.send(), Couldn't send to +oscAddr+ at +ipServer, e); } } } public void send(String oscAddr, String arg) { send(oscAddr, new Object[] {arg}); } public void disconnect() { Log.d(TAG, disconnecting from server, +getIP() +:+getPort()); if (sender != null) { sender.close(); sender = null; Log.d(TAG, disconnected from server); } else{ Log.e(TAG, check out if Object OSCPortOut was
[android-developers] Re: Bluetooth is driving me nuts -- Galaxy tab lockups and pairing stupidity
I think I've come up with a pretty good interim solution (until nfc) to the adhoc comm issue, using qr codes and bt spp. It looks like it's going to require lots of fine-tuning for individual devices though, which just sucks. I've tried a number of different approaches, including bonjour over wifi, which worked surprisingly well, but the dependence on wifi was just a bit too goofy, so the only choice left is bt. making the experience truly seamless for my users has been surprisingly difficult -- this use case is not well thought out at all by Google, particularly how pairing works. I'm hoping for some guidance from someone there on how to make that work well, but I'm not holding my breath. I'm going to post the code for connecting two peers via bt spp comm using qr codes if I can get it to work well enough. If it all comes together it will be a nice stop-gap until nfc is everywhere, which will be a while... On May 27, 3:32 am, Zsolt Vasvari zvasv...@gmail.com wrote: I've never owned a device where Bluetooth just works every time. The closest that one came to has been my Garmin GPS. I do hope NFC will make it easier to do adhoc peer-to-peer communications. On May 27, 9:58 am, keyeslabs keyes...@gmail.com wrote: I'm trying to use bluetooth SPP to establish a socket connection between two Android devices. There are a few things that are really driving me crazy in this effort. First, the Galaxy Tab seems to just be broken when it comes to SPP. I can establish the connection just fine, but after a few minutes, and most notably whenever the app on the Tab on which the SPP server socket was established is killed, the tablet effectively locks up, requiring a hard reboot (hold down the power for 7 seconds to reboot). I've seen others mentioning the same thing in various places, but haven't seen any solutions. Has anyone come up with ANYTHING to solve this issue? Second, I've been struggling to find a way to make it easy for users to pair devices. I'm developing a full-screen game involving two devices, and the pairing request on 2.3 and later seems to happen (sometimes) as a notification, which doesn't do much good for a full screen game. In some cases it does seem to be displayed as a dialog (which is what I want), but it's frequently as a notification. Is anyone aware of a reliable way to initiate pairing via DIALOG automatically when a socket is opened between two unpaired devices? Finally, has anyone else noticed pairing requests happening twice? Dialog shows, user clicks pair, second dialog appears, click pair, pairing happens. Thanks for any 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
Re: [android-developers] How to use ProgressDialog(Context,theme) ??
On Thu, May 26, 2011 at 11:21 PM, MOHIT SHARMA mohit7...@gmail.com wrote: i tried to pass PROGRESSDIALOG.STYLE_HORIZONTAL in theme but nothing happens . That's not a theme - that's for this: http://developer.android.com/reference/android/app/ProgressDialog.html#setProgressStyle(int) - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Two-way listeners/observers
Agreed. If the service is local, you can just direct Java method calls to communicate, either your own scheme, or these guys: http://developer.android.com/reference/java/util/Observable.html But a direct Java method call won't switch threads for you. For posting an event to the UI thread, your options are limited, because the UI thread's loop is already implemented inside the Android framework. Handler is one of those options, and you might as well use it in the opposite direction as well, going from the UI thread to the worker thread. An nice property of Handler is that it works with Message objects, which can contain useful payload, including a plain Java object (no need to serlialize, etc., as long as you're within the same process). Here is a HandlerThread snippet from my current project: http://pastebin.com/kpSFH6Ke Clients call submitWorkItem on the UI thread, which processes them one by one in onWorkItem(), on the worker thread. -- Kostya 2011/5/27 Streets Of Boston flyingdutc...@gmail.com Yes, that's possible. You'd have to take care of the threading issues, though (avoiding race conditions or deadlocks, etc). -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Widget-specific Preferences
True. The initial values are set by onSetInitialValue, which is called during initialiation (the last phase, onAttachedToHierarchy). Resetting the values after adding preferences to the activity should work, although might require some knowledge in the activity about what the default values are. Better than an exception, though :) -- Kostya 27 мая 2011 г. 20:01 пользователь Jake Colman col...@ppllc.com написал: Actually, the reason we went down this path in the first place was because if I did not reset the keys during the inflation process the Preference Screen did not reflect the current values. I can still use a second pass, however, inside of onCreate() but after inflation to reset the dependent keys. That should probably work. Jake == Jake Colman col...@ppllc.com writes: Jake Kostya, Jake You did not waste my time at all! First of all, this was a Jake great learning opportunity. Second of all, the suggestion was Jake great - this should have worked! Maybe I need to do a second Jake pass, somehow, to reset the dependent keys. But if I need a Jake second pass, maybe I just do it all at that time. Jake ...Jake KV == Kostya Vasilyev kmans...@gmail.com writes: KV Jake, KV I just tried it with a simple test, and yes, I get the same KV exception. KV The reason is that setDependency() tries to register the KV dependency right away, and doesn't find the depndency because the KV process of loading preferences from XML hasn't completed yet KV (which it does not check). It *might* be possible to work around KV it with more overrides here and there, but... instead... KV I admit that the idea only seemed good, and then was crushed to KV pieces by the reality of how things work. KV My apologies for having wasted your time. KV -- Kostya KV 2011/5/27 Jake Colman col...@ppllc.com Kostya/String, Is nothing ever easy? So close, yet so far... :-) Some of my preferences have dependent keys. Since the keys are being renamed to be widget-specific I, of course, have to rename the dependent keys accordingly as well. Pref2 is dependent on Pref1. Pref1 comes through my overridden onPrepareAddPreference and I call setKey to rename its key. Pref2 comes through onPrepareAddPreference and I reset its key as usual and I also reset its dependent key to have the correct Pref1 key name. This triggers a java.lang.IllegalStateException stating that Dependency not found for preference. Since Pref1 has already been reset I would expect that by the time Pref2 comes in Pref1 is already out there. Also, I did not think that ordering would matter anyway as long as all the keys make sense at the of the inflation. Any ideas? Incidentally, I tried both onPrepareAddPreference and addPreference just in case one worked differently than the other. And, yes, I called up to super at the end of my overridden method. ...Jake KV == Kostya Vasilyev kmans...@gmail.com writes: KV Yes, a cast is what I'm suggesting. From the design point of KV view, you'll end up with two classes that are meant to be used KV together. KV You could even do an instanceof check before the cast, and throw KV an exception with a nice descriptive message if the check returns KV false :) KV -- KV Kostya Vasilyev KV 27.05.2011 1:56 пользователь Jake Colman KV col...@ppllc.com KV написал: All the magic happens from addPreferencesFromResource which inflates my preferences XML and instantiates the Preference objects. With everything we've discussed until now, I know what/how to subclass so that I can hook into things at the correct level to reset my key. But if it's WidgetOptionsActivity that has the widget id (from its super class) how does that get passed into addPreferencesFromResource? Unless you are suggesting that I can call a method via the context which is, in essence, my Activity? So cast the context into the Activity and call the method? KV == Kostya Vasilyev kmans...@gmail.com writes: KV Preferences are inflated with a Context, which in this case is KV your PreferenceActivity subclass. KV I'd make two classes, WidgetOptionsActivity and KV WidgetOptionsPreferenceCategory, with the expectation that the KV latter is always used within the former (like maps API and KV MapActivity). KV The widget id is passed to the activity as an intent extra, so KV just get it from there and make available as a method / field KV before you call addPreferencesFromResource(). KV Then you could derive YourProjectNameWidgetOptionsActivity from KV WidgetOptionsActivity. KV -- Kostya KV 2011/5/27 Jake Colman col...@ppllc.com Thanks
Re: [android-developers] Multiple overlay on the map
On Fri, May 27, 2011 at 3:14 AM, thavorac chun thavorac.c...@gmail.comwrote: what is the problem ?? 500 items would be the first problem. Do you really need that many items on the map at once? Second, I don't see a call to populate() in your code. If you're calling populate() with each call to addOverlay(overlayItem) that is going to kill your performance. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Animation transition between activities in ActivityGroup?
Those are for window animations, which are applied to an entire window. These activities are all put inside of one window so it is a completely different situation. Consider looking at the Fragment APIs in the support library, this is the new replacement for ActivityGroup. On Fri, May 27, 2011 at 8:02 AM, imran ali imran...@gmail.com wrote: it is not working for Activity group. As i found after google, in case of ActivityGroup we have to do some thing with localActivityManager. that i am unable to do presently. Regards Imran ali On May 27, 3:19 am, TreKing treking...@gmail.com wrote: On Thu, May 26, 2011 at 8:15 AM, imran ali imran...@gmail.com wrote: I am using ActivityGroup and in that i have been using activities, how can i animate activities at the time of setContentView(view)? Maybe this: http://developer.android.com/reference/android/app/Activity.html#over..., int) - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Adapting BluetoothChat Example for One Server and Multiple Clients
It doesn't work well in general, this seems to be something buggy going on (and even worse if it's not all the same phone). This has been discussed previously on the list, search around, I'll post some links later. But in general, there's not much I've seen that can be done for this scenario (I got three to work, and then after a while the connection died, I ended up implementing application layer handler. But it seems the socker won't always inform you of disconnection.) On May 27, 2011 11:00 AM, polyclefsoftware dja...@gmail.com wrote: I'm attempting to adapt the BluetoothChat example that comes with the SDK to a single-server, multiple-client configuration. I'm having issues and hope someone can help. I've created two distinct apps, a server and a client, rather than have a single app function as both server and client, as in the example. So the upon starting the app, the server creates a bluetooth service, which creates a new AcceptThread, which listens for incoming connections. I made a couple of modifications to the example code so that the AcceptThread continues to listen, even after the first connection is made (the example stops listening after the one connection is made, because it only needs to establish connections between two devices). I created an ArrayList to handle the multiple connections. Each time a new connection is attempted from a remote device, a new ConnectedThread is created and added to the list. The first client connects just fine. When the second client attempts to connect, the connection fails. The log output is: D/BluetoothEventLoop( 140): Device property changed: device address property: Connected value: true I/BluetoothService( 140): ACL connected, mAclLinkCount = 2 D/BluetoothEventLoop( 140): Device property changed: device address property: Connected value: false I/BluetoothService( 140): ACL disconnected, mAclLinkCount = 1 So it looks like the second connection attempt is successful, but then it is immediately disconnected. This looks like it's happening at a low level, outside anything the code is handling. This happens with a number of different types of test devices, so I don't think it's due to a particular firmware or hardware issue. Can anyone help with this? Also, can anyone point to an example of a server-multiple client connection example using bluetooth with Android? I came across an Air Hockey example: http://code.google.com/p/apps-for-android/source/browse/#svn%2Ftrunk%2FBTClickLinkCompete%2Fsrc%2Fnet%2Fclc%2Fbt But this project is very glitchy on my test devices and the actual game won't display properly. Does anyone know if there is an example of BluetoothChat extended to handle multiple connections? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: The following classes could not be found: fragment
Awesome -- thanks! I'll give that a try. On May 26, 4:05 pm, Tor Norbye tnor...@google.com wrote: In the I/O demo we were showing a snapshot build of ADT 11. It hasn't been released yet, but you can download a milestone build fromhttp://tools.android.com/download And yes, that milestone build contains the new fragment support which is documented here:http://tools.android.com/recent/ -- Tor On Thu, May 26, 2011 at 12:51 PM, mlevin marshall.le...@gmail.com wrote: Hi everyone, I'm trying to run the iosched sample app to learn a bit more about fragments. I can get it to build fine in eclipse, but when I try to use the GUI to view/edit one of the layouts (the home screen, for example), I don't see a proper view of what the home screen looks like -- instead I see two big gray boxes that say fragment and I get an error in the window below that says: The following classes could not be found: fragment I added both the google analytics and the fragment support JARs (as specified by the README.txt file) to my project's libs directory and added them to the eclipse build path as well. I have the absolute latest android plugins and sdk installed. I'm on Ubuntu 10.10 64 bit and I'm running Eclipse Helios. I set my project to target SDK 11 (Android 3.0). Needless to say, this isn't how it looked when they gave the demo at IO ;-) What am I doing wrong? Thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Bluetooth is driving me nuts -- Galaxy tab lockups and pairing stupidity
Iirc qualcomm is working on their own hugh level ad hoc networking stack. Ill try to remember the name, but you might google around for it (I don't know if it materialized.) On May 27, 2011 12:16 PM, keyeslabs keyes...@gmail.com wrote: I think I've come up with a pretty good interim solution (until nfc) to the adhoc comm issue, using qr codes and bt spp. It looks like it's going to require lots of fine-tuning for individual devices though, which just sucks. I've tried a number of different approaches, including bonjour over wifi, which worked surprisingly well, but the dependence on wifi was just a bit too goofy, so the only choice left is bt. making the experience truly seamless for my users has been surprisingly difficult -- this use case is not well thought out at all by Google, particularly how pairing works. I'm hoping for some guidance from someone there on how to make that work well, but I'm not holding my breath. I'm going to post the code for connecting two peers via bt spp comm using qr codes if I can get it to work well enough. If it all comes together it will be a nice stop-gap until nfc is everywhere, which will be a while... On May 27, 3:32 am, Zsolt Vasvari zvasv...@gmail.com wrote: I've never owned a device where B... -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] switching from one app to another
* I have an app that opens a web browser, but after awhile I want the app to switch from the web browser back to itself. Is there an easy way to do this?* * * Technically, I can think of a way to do this, but I agree with Mark (so I'm not going to explain how). You should use a WebView in your app instead. Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Thu, May 26, 2011 at 6:39 PM, Mark Murphy mmur...@commonsware.comwrote: On Thu, May 26, 2011 at 8:06 PM, bob b...@coolgroups.com wrote: I have an app that opens a web browser, but after awhile I want the app to switch from the web browser back to itself. Is there an easy way to do this? That sounds rather user-hostile, considering that you have no way of knowing which Web browser it is and what the user is doing in that application. If you want that degree of control over the flow, use WebView in your own app, please. Also, maybe killing the web browser could work to. Is there a way to do this? Fortunately, no. If you want that degree of control over the flow, use WebView in your own app, please. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.6 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] java.lang.ArrayStoreException on Honeycomb device (Acer Iconia A500)
I get the following exception: java.lang.ArrayStoreException: java.util.LinkedHashMap$LinkedEntry cannot be stored in an array of type java.util.HashMap$HashMapEntry[] at java.util.LinkedHashMap.addNewEntry(LinkedHashMap.java:193) at java.util.HashMap.put(HashMap.java:412) at java.util.HashSet.add(HashSet.java:95) at com.mycompany.myapp.MyClass.void init()(MyClass.java:135) Here's the code: private LinkedHashSetCell cells; protected void init() { cells = new LinkedHashSetCell(); for (int i = 0; i 20; i++) { cells.add(getCell(i));// -- that's line 135 } } getCell() always returns a Cell object. I'm 100% positive about that because it returns just values from an array: private final Cell[] cells = new Cell[20]; Even if the Cell objects were Null it would work because HashSet supports Null elements. Even if it would contain duplicate entries it wouldn't throw an ArrayStoreException but one of the other possible exceptions ( IllegalArgumentException, ClassCastException, IllegalStateException). I assume the exception occurs because of Honeycomb for the following reasons: - I really can't see a reason why it could/should crash at all - the piece of code has run thousands of times on at least 100 different devices without ever failing - I got the exception on an Acer Iconia A500 running Android 3.0.1. The percentage of devices running Honeycomb that the app runs on is still too small to even show in the app's statistics. If it were a problem in my code it would have shown on pre-Honeycomb devices already. Any ideas? Emanuel Moecklin 1gravity LLC -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Slow motion video
Anyone got an idea how to implement slow motion ? or at least slow down the playback of a video ? thanks in advance On May 24, 2011, at 7:19 PM, TheBear wrote: I am able to play back video using the mediaplayer with the standard video control buttons. My question is how can I use a slider /progress bar to act as a play back speed. which function would I have to override and how. basically while not end of movie play next frame sleep (value of progress bar (0 - 100) * 4000); this way when the slider/progress bar is at 0 sleep is 0; thus there is NO delay in playback when the slider is at 100 then sleep is 40,000, thus there is a 40 second delay between frames causing the video to slow. As you can see I have a concept but I am not sure of the routines, I found reference to play a frame but could not find any examples and it would appear that it is now depreciated. 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 -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] ActionBar tabs - dynamic setIcon()
I'd like to use an ActionBar tab that has a text title of Messages, and use setIcon() with a custom drawable to show an unread messages count ... a little red bubble with a number inside. This will attact a users attention to the tab, letting them know there are messages to be read. No problem creating the custom drawable and setting it as the tab bar icon, have that working fine. However, when the # of unread messages is zero, I want this icon to disappear. I found that simply getting the tab from actionBar() and calling setIcon(null) doesn't actually do anything on the tab. I can fiddle with visibility, but the icon appears to still occupy space in the view, i.e. the text isn't centered. Is going down the path of setCustomView() on the tab the only option? Thanks in advance! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: java.lang.ArrayStoreException on Honeycomb device (Acer Iconia A500)
Debug it. put getCell(i) into a variable and see what that variable is. And it seems that during run-time something is about to be stored in a LinkedHash*Map* (and not in LinkedHashSet as shown in your code). -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] cookies?
I've got this code for downloading a web page: public static String getStringFromURL(String src) { BufferedReader in = null; String page = null; HttpClient client = new DefaultHttpClient(); HttpGet request = new HttpGet(); try { request.setURI(new URI(src)); HttpResponse response = client.execute(request); in = new BufferedReader(new InputStreamReader(response.getEntity() .getContent())); StringBuffer sb = new StringBuffer(); String line = ; String NL = System.getProperty(line.separator); while ((line = in.readLine()) != null) { sb.append(line + NL); } in.close(); page = sb.toString(); } catch (URISyntaxException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClientProtocolException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return page; } Anyone know how I can check to see if the page is trying to set any cookies? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: java.lang.ArrayStoreException on Honeycomb device (Acer Iconia A500)
Offhand it looks like some sort of system bug, but hard to tell where -- Map source code, interface method resolution, heap management -- could be anywhere. (But one thing to beware of is multithreading -- Only HashTable is thread-safe, and HashMap/HashSet can be tied in a knot if modified asynchronously.) But so long as you're not multithreading I don't think it's your bug (though certainly a bug on your part could be exercising an untested path in the system). On May 27, 1:11 pm, Emanuel Moecklin 1gravity...@gmail.com wrote: I get the following exception: java.lang.ArrayStoreException: java.util.LinkedHashMap$LinkedEntry cannot be stored in an array of type java.util.HashMap$HashMapEntry[] at java.util.LinkedHashMap.addNewEntry(LinkedHashMap.java:193) at java.util.HashMap.put(HashMap.java:412) at java.util.HashSet.add(HashSet.java:95) at com.mycompany.myapp.MyClass.void init()(MyClass.java:135) Here's the code: private LinkedHashSetCell cells; protected void init() { cells = new LinkedHashSetCell(); for (int i = 0; i 20; i++) { cells.add(getCell(i)); // -- that's line 135 } } getCell() always returns a Cell object. I'm 100% positive about that because it returns just values from an array: private final Cell[] cells = new Cell[20]; Even if the Cell objects were Null it would work because HashSet supports Null elements. Even if it would contain duplicate entries it wouldn't throw an ArrayStoreException but one of the other possible exceptions ( IllegalArgumentException, ClassCastException, IllegalStateException). I assume the exception occurs because of Honeycomb for the following reasons: - I really can't see a reason why it could/should crash at all - the piece of code has run thousands of times on at least 100 different devices without ever failing - I got the exception on an Acer Iconia A500 running Android 3.0.1. The percentage of devices running Honeycomb that the app runs on is still too small to even show in the app's statistics. If it were a problem in my code it would have shown on pre-Honeycomb devices already. Any ideas? Emanuel Moecklin 1gravity LLC -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Two-way listeners/observers
Thanks for the links. Your code clarifies things a lot. Thinking about Handler/HandlerThread made me wonder about something... Activity class provides a method called runOnUIThread(), which seems to me a very straight-forward way to execute commands emanating from other threads, on UI thread. Is there any idisadvantage of using this instead of Handler or HandlerThread? On May 27, 11:26 am, Kostya Vasilyev kmans...@gmail.com wrote: Agreed. If the service is local, you can just direct Java method calls to communicate, either your own scheme, or these guys: http://developer.android.com/reference/java/util/Observable.html But a direct Java method call won't switch threads for you. For posting an event to the UI thread, your options are limited, because the UI thread's loop is already implemented inside the Android framework. Handler is one of those options, and you might as well use it in the opposite direction as well, going from the UI thread to the worker thread. An nice property of Handler is that it works with Message objects, which can contain useful payload, including a plain Java object (no need to serlialize, etc., as long as you're within the same process). Here is a HandlerThread snippet from my current project: http://pastebin.com/kpSFH6Ke Clients call submitWorkItem on the UI thread, which processes them one by one in onWorkItem(), on the worker thread. -- Kostya 2011/5/27 Streets Of Boston flyingdutc...@gmail.com Yes, that's possible. You'd have to take care of the threading issues, though (avoiding race conditions or deadlocks, etc). -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: java.lang.ArrayStoreException on Honeycomb device (Acer Iconia A500)
This doesn't have to do with the types or null-ness of objects going into the map, but rather with the implementaiton internals of LinkedHashSet. LinkedHashMap . addNewEntry, line 193: http://www.google.com/codesearch/p?hl=ru#cZwlSNS7aEw/libcore/luni/src/main/java/java/util/LinkedHashMap.javaq=LinkedEntry%20lang:javal=193 LinkedEntry extends HashMapEntry: http://www.google.com/codesearch/p?hl=ru#cZwlSNS7aEw/libcore/luni/src/main/java/java/util/LinkedHashMap.javaq=LinkedEntry%20lang:javal=148 Definition of table, whose element is assigned to: http://www.google.com/codesearch/p?hl=ru#cZwlSNS7aEw/libcore/luni/src/main/java/java/util/HashMap.javaq=LinkedEntry%20lang:javad=7l=94 an array of HashMap$HashMapEntry Based on the above, the assignment at line 193 should succeed. Might this be a Java runtime bug? of course if that's actually the version of java.util.* that is used in Android 3.0.1. But it looks reasonable, given that 1) the line number matches and 2) the top of the page says this is a cached copy of source.android.com. -- Kostya 2011/5/27 Streets Of Boston flyingdutc...@gmail.com Debug it. put getCell(i) into a variable and see what that variable is. And it seems that during run-time something is about to be stored in a LinkedHash*Map* (and not in LinkedHashSet as shown in your code). -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Two-way listeners/observers
It's just a shortcut: public final void runOnUiThread(Runnable action) { if (Thread.currentThread() != mUiThread) { mHandler.post(action); } else { action.run(); } } to post a Runnable to the UI thread's handler. -- Kostya 2011/5/27 Oceanblue ns1...@gmail.com Thanks for the links. Your code clarifies things a lot. Thinking about Handler/HandlerThread made me wonder about something... Activity class provides a method called runOnUIThread(), which seems to me a very straight-forward way to execute commands emanating from other threads, on UI thread. Is there any idisadvantage of using this instead of Handler or HandlerThread? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Immediate need of Mainframe Technical Lead/Developer
Hello, Hope you are doing well. I am a technical recruiter with Panzer Solutions LLC Software Implementing and IT consulting company located in CT. Please go through the Job Description and send me your updated resume with contact information. *Please reply at emr...@panzersolutions.com emr...@panzersolutions.com * Title : Mainframe Technical Lead/Developer Location: Miami FL Duration: 6-7 month contract Must Haves: Extensive Mainframe development experience Java front-end development Service Order application knowledge (may end up being a plus) Plus: CIS2 experience Responsibilities: This person will be responsible for Mainframe DESIGN and DEVELOPMENT SUPERVISION for the service order amend and cancel, and ABP and deposit project. Warm Regards, Emraaz Khan, Panzer Solutions LLC emr...@panzersolutions.com Direct: 203-813-2052 -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Immediate need of Mainframe Technical Lead/Developer
Can a moderator please boot this spammer? - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Bluetooth is driving me nuts -- Galaxy tab lockups and pairing stupidity
In my experience, Bluetooth is often a little flaky, requiring pairing when already paired, timing out before the user has the chance to enter the code, etc. But I haven't seen anything quite as bad as what you describe for the Galaxy Tab, and the flakiness I have seen never seemed specific to Android. On May 26, 6:58 pm, keyeslabs keyes...@gmail.com wrote: I'm trying to use bluetooth SPP to establish a socket connection between two Android devices. There are a few things that are really driving me crazy in this effort. First, the Galaxy Tab seems to just be broken when it comes to SPP. I can establish the connection just fine, but after a few minutes, and most notably whenever the app on the Tab on which the SPP server socket was established is killed, the tablet effectively locks up, requiring a hard reboot (hold down the power for 7 seconds to reboot). I've seen others mentioning the same thing in various places, but haven't seen any solutions. Has anyone come up with ANYTHING to solve this issue? Second, I've been struggling to find a way to make it easy for users to pair devices. I'm developing a full-screen game involving two devices, and the pairing request on 2.3 and later seems to happen (sometimes) as a notification, which doesn't do much good for a full screen game. In some cases it does seem to be displayed as a dialog (which is what I want), but it's frequently as a notification. Is anyone aware of a reliable way to initiate pairing via DIALOG automatically when a socket is opened between two unpaired devices? Finally, has anyone else noticed pairing requests happening twice? Dialog shows, user clicks pair, second dialog appears, click pair, pairing happens. Thanks for any 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: Career as an Andoid developer. Is there any point?
That is a good example of the many cases where it is NOT a good thing to do as IOS does! On May 26, 2:05 pm, Dianne Hackborn hack...@android.com wrote: On Thu, May 26, 2011 at 1:46 PM, dipu contac...@gmail.com wrote: Developing apps for android is fun. I just do not want to put a nail on every null to avoid force close. Now even an ardent Agile fan would call me a bad programmer. That is where I see religion (or cult). How about get a few ex-ms people on board. Maybe they can resolve the issue with the new incarnation of Blue Screen of Death called Force Close. Core engineers on Android come from Sun, Be, Danger, Palm, Microsoft, as well as other companies. Also Blue Screen of Death is when your entire computer crashes. Force Close is when the current application crashes. These are very much not the same thing. The force close dialog is the same as the app crash dialog on windows. Of course we could do like iOS and just silently kill the app and return to the launcher. -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Error when i open socket and enter data to be send
05-27 23:34:12.933: INFO/ActivityThread(311): Pub com.android.deskclock: com.android.deskclock.AlarmProvider 05-27 23:40:10.814: ERROR/ActivityManager(61): ANR in yaraby.y (yaraby.y/.yaraby) 05-27 23:40:10.814: ERROR/ActivityManager(61): Reason: keyDispatchingTimedOut 05-27 23:40:10.814: ERROR/ActivityManager(61): Load: 0.17 / 1.97 / 1.47 05-27 23:40:10.814: ERROR/ActivityManager(61): CPU usage from 3844ms to -1833ms ago: 05-27 23:40:10.814: ERROR/ActivityManager(61): 20% 61/system_server: 11% user + 8.6% kernel / faults: 366 minor 4 major 05-27 23:40:10.814: ERROR/ActivityManager(61): 1% 126/zygote: 0.1% user + 0.8% kernel / faults: 142 minor 05-27 23:40:10.814: ERROR/ActivityManager(61): 1% 128/zygote: 0.3% user + 0.7% kernel / faults: 107 minor 05-27 23:40:10.814: ERROR/ActivityManager(61): 0% 415/yaraby.y: 0% user + 0% kernel / faults: 80 minor 7 major 05-27 23:40:10.814: ERROR/ActivityManager(61): 0.7% 40/adbd: 0% user + 0.7% kernel 05-27 23:40:10.814: ERROR/ActivityManager(61): 0% 13/kswapd0: 0% user + 0% kernel 05-27 23:40:10.814: ERROR/ActivityManager(61): 0.1% 37/qemud: 0% user + 0.1% kernel 05-27 23:40:10.814: ERROR/ActivityManager(61): 0% 425/logcat: 0% user + 0% kernel 05-27 23:40:10.814: ERROR/ActivityManager(61): 33% TOTAL: 16% user + 16% kernel + 0.2% softirq 05-27 23:40:10.814: ERROR/ActivityManager(61): CPU usage from 1100ms to 1759ms later: 05-27 23:40:10.814: ERROR/ActivityManager(61): 16% 61/system_server: 6.1% user + 10% kernel / faults: 12 minor 05-27 23:40:10.814: ERROR/ActivityManager(61): 13% 92/ InputDispatcher: 6.1% user + 7.6% kernel 05-27 23:40:10.814: ERROR/ActivityManager(61): 1.5% 62/HeapWorker: 0% user + 1.5% kernel 05-27 23:40:10.814: ERROR/ActivityManager(61): 1.5% 69/ SurfaceFlinger: 1.5% user + 0% kernel 05-27 23:40:10.814: ERROR/ActivityManager(61): 38% TOTAL: 19% user + 19% kernel -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Immediate need of Business Analyst with Utility background in Miami,FL
Hello, Hope you are doing well. I am a technical recruiter with Panzer Solutions LLC Software Implementing and IT consulting company located in CT. Please go through the Job Description and send me your updated resume with contact information. *Please reply at emr...@panzersolutions.com emr...@panzersolutions.com * Title : Business Analyst with Utility background Location: Miami FL Duration: 7+ month contract MUST 7+ yrs of BA experience Utility background (energy, electric, water management, ami, dsm) Must be able to communicate well with the business (non-technical users) and the technical team. The jargon they use for the users will be different from what they use for the technical team. They must be able to translate user requirements to the technical team in a way they will understand, and vice versa. DSM (Demand Side Management) __ Warm Regards, Emraaz Khan, Panzer Solutions LLC emr...@panzersolutions.com Direct: 203-813-2052 -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] sensorLandscape orientation and disabled auto-rotate screen preference (Honeycomb)
No the point of this config is to allow it to rotate with the sensor. The user can still lock the screen to one orientation. On Fri, May 27, 2011 at 2:28 AM, clemp6r clemplant...@gmail.com wrote: Hi, My Honeycomb app uses the sensorLandscape orientation. On my tablet, when I uncheck the auto-rotate screen preference in the system settings, my app continues using the sensor to detect which orientation to use, instead of locking the 0° landscape orientation (as some other apps do, like Youtube, Pulse, CNN, but not Market). So, is there a way for my app to not use the sensor when auto-rotate screen is disabled? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] KEYCODE COLON?
I don't know of any device that has a colon key (that is why there is no keycode for it). Generally this is generated by shifting with another key, such as shift-; on a PC keyboard. On Fri, May 27, 2011 at 2:08 AM, SJ boris.iva...@gmail.com wrote: Anyone knows how to send KEYCODE COLON? : According to http://thecodeartist.blogspot.com/2011/03/simulating-keyevents-on-android-device.html (look at table) such keycode not exist 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 -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Error when i open socket and enter data to be send
You need to read: http://developer.android.com/resources/articles/painless-threading.html Also, put some more effort into your questions don't just dump some log text. On Fri, May 27, 2011 at 1:46 PM, ingy abbas ingy.abba...@gmail.com wrote: 05-27 23:34:12.933: INFO/ActivityThread(311): Pub com.android.deskclock: com.android.deskclock.AlarmProvider 05-27 23:40:10.814: ERROR/ActivityManager(61): ANR in yaraby.y (yaraby.y/.yaraby) 05-27 23:40:10.814: ERROR/ActivityManager(61): Reason: keyDispatchingTimedOut 05-27 23:40:10.814: ERROR/ActivityManager(61): Load: 0.17 / 1.97 / 1.47 05-27 23:40:10.814: ERROR/ActivityManager(61): CPU usage from 3844ms to -1833ms ago: 05-27 23:40:10.814: ERROR/ActivityManager(61): 20% 61/system_server: 11% user + 8.6% kernel / faults: 366 minor 4 major 05-27 23:40:10.814: ERROR/ActivityManager(61): 1% 126/zygote: 0.1% user + 0.8% kernel / faults: 142 minor 05-27 23:40:10.814: ERROR/ActivityManager(61): 1% 128/zygote: 0.3% user + 0.7% kernel / faults: 107 minor 05-27 23:40:10.814: ERROR/ActivityManager(61): 0% 415/yaraby.y: 0% user + 0% kernel / faults: 80 minor 7 major 05-27 23:40:10.814: ERROR/ActivityManager(61): 0.7% 40/adbd: 0% user + 0.7% kernel 05-27 23:40:10.814: ERROR/ActivityManager(61): 0% 13/kswapd0: 0% user + 0% kernel 05-27 23:40:10.814: ERROR/ActivityManager(61): 0.1% 37/qemud: 0% user + 0.1% kernel 05-27 23:40:10.814: ERROR/ActivityManager(61): 0% 425/logcat: 0% user + 0% kernel 05-27 23:40:10.814: ERROR/ActivityManager(61): 33% TOTAL: 16% user + 16% kernel + 0.2% softirq 05-27 23:40:10.814: ERROR/ActivityManager(61): CPU usage from 1100ms to 1759ms later: 05-27 23:40:10.814: ERROR/ActivityManager(61): 16% 61/system_server: 6.1% user + 10% kernel / faults: 12 minor 05-27 23:40:10.814: ERROR/ActivityManager(61): 13% 92/ InputDispatcher: 6.1% user + 7.6% kernel 05-27 23:40:10.814: ERROR/ActivityManager(61): 1.5% 62/HeapWorker: 0% user + 1.5% kernel 05-27 23:40:10.814: ERROR/ActivityManager(61): 1.5% 69/ SurfaceFlinger: 1.5% user + 0% kernel 05-27 23:40:10.814: ERROR/ActivityManager(61): 38% TOTAL: 19% user + 19% kernel -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- ~ Jeremiah:9:23-24 Android 2D MMORPG: http://solrpg.com/, http://www.youtube.com/user/revoltingx -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 vs View (Canvas Size?)
Hi All, I am writing an application that needs to put a View inside a ScrollView. Since View is used to display some content that is very long, I do View.setMeasuredDimension(width, large_height) in View's onMeasure() callback function. I noticed that no matter how high the View is, its Canvas size I queried in View.onDraw() is the same with that of the viewport. This is good since the memory consumption is only dependent on the size of the viewport. But the downside is that I have to redraw the entire Canvas manually every time onDraw() is called. Instead of View, I can use SurfaceView. However, the problem is that I cannot do SurfaceView.setMeasuredDimension(width, large_height). I found that the Canvas size of SurfaceView is the same with its virtual size (not the same with the viewport as View). So the underlying Bitmap takes lots of memory and my application won't even run (because of out of memory). Does any of you know any solution to this problem? Thank you very much. Thanks, Frank -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Error when i open socket and enter data to be send
What i must add to this code public void appendText(View view){ Text.append( \n In chat ); try{ // while (true) //{ sentence=inputfld.getText().toString(); sentence1=ing; Text.append( \n DataStream creating); outToServer.writeBytes(sentence); outToServer.writeBytes(sentence1); modifiedSentence = inFromServer.readLine(); Text.append(modifiedSentence); inputfld.setText(null); //if(modifiedSentence.equals(QUIT)) //break; // } } catch(Exception modifiedsentence){ Text.append(Exception); } } public void connect(View view){ try{ clientSocket= new Socket(192.168.1.3,54637); Text.append( \n created a socket); outToServer = new DataOutputStream(clientSocket.getOutputStream()); Text.append( \n created a datastream); inFromServer = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); Text.append( \n created a bufferReader); outToServer = new DataOutputStream(clientSocket.getOutputStream()); try{ Thread listen = new Thread(new clientThread(clientSocket)); listen.start(); }catch(Exception e){} // Connect.setVisibility(1); // Text.append( \n remove connect button); // Enter.setVisibility(0); }catch(Exception e){ System.out.println(Error); } } } to solve the thread problem ?? On May 27, 10:56 pm, Miguel Morales therevolti...@gmail.com wrote: You need to read:http://developer.android.com/resources/articles/painless-threading.html Also, put some more effort into your questions don't just dump some log text. On Fri, May 27, 2011 at 1:46 PM, ingy abbas ingy.abba...@gmail.com wrote: 05-27 23:34:12.933: INFO/ActivityThread(311): Pub com.android.deskclock: com.android.deskclock.AlarmProvider 05-27 23:40:10.814: ERROR/ActivityManager(61): ANR in yaraby.y (yaraby.y/.yaraby) 05-27 23:40:10.814: ERROR/ActivityManager(61): Reason: keyDispatchingTimedOut 05-27 23:40:10.814: ERROR/ActivityManager(61): Load: 0.17 / 1.97 / 1.47 05-27 23:40:10.814: ERROR/ActivityManager(61): CPU usage from 3844ms to -1833ms ago: 05-27 23:40:10.814: ERROR/ActivityManager(61): 20% 61/system_server: 11% user + 8.6% kernel / faults: 366 minor 4 major 05-27 23:40:10.814: ERROR/ActivityManager(61): 1% 126/zygote: 0.1% user + 0.8% kernel / faults: 142 minor 05-27 23:40:10.814: ERROR/ActivityManager(61): 1% 128/zygote: 0.3% user + 0.7% kernel / faults: 107 minor 05-27 23:40:10.814: ERROR/ActivityManager(61): 0% 415/yaraby.y: 0% user + 0% kernel / faults: 80 minor 7 major 05-27 23:40:10.814: ERROR/ActivityManager(61): 0.7% 40/adbd: 0% user + 0.7% kernel 05-27 23:40:10.814: ERROR/ActivityManager(61): 0% 13/kswapd0: 0% user + 0% kernel 05-27 23:40:10.814: ERROR/ActivityManager(61): 0.1% 37/qemud: 0% user + 0.1% kernel 05-27 23:40:10.814: ERROR/ActivityManager(61): 0% 425/logcat: 0% user + 0% kernel 05-27 23:40:10.814: ERROR/ActivityManager(61): 33% TOTAL: 16% user + 16% kernel + 0.2% softirq 05-27 23:40:10.814: ERROR/ActivityManager(61): CPU usage from 1100ms to 1759ms later: 05-27 23:40:10.814: ERROR/ActivityManager(61): 16% 61/system_server: 6.1% user + 10% kernel / faults: 12 minor 05-27 23:40:10.814: ERROR/ActivityManager(61): 13% 92/ InputDispatcher: 6.1% user + 7.6% kernel 05-27 23:40:10.814: ERROR/ActivityManager(61): 1.5% 62/HeapWorker: 0% user + 1.5% kernel 05-27 23:40:10.814: ERROR/ActivityManager(61): 1.5% 69/ SurfaceFlinger: 1.5% user + 0% kernel 05-27 23:40:10.814: ERROR/ActivityManager(61): 38% TOTAL: 19% user + 19% kernel -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- ~ Jeremiah:9:23-24 Android 2D MMORPG:http://solrpg.com/,http://www.youtube.com/user/revoltingx -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: All Renderscript samples fail to run on actual device (Samsung Galaxy Tab 10.1 'google io edition')
Hi Xav, Were you able to deploy a fix? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] SurfaceView vs View (Canvas Size?)
You shouldn't put a SurfaceView inside of a ScrollView or other such container. Since a surface view is actually creating a separate window that is positioned along with your window and provides the surface, those kinds of interactions just won't work. The way a scroll view works is that it expects to have one child view, whose height is potentially larger than the scroll view. If it is larger, then the scroll view will change offsets to scroll around in it. The view being larger in height doesn't use any more memory or such -- this is just a virtual coordinate space, with appropriate offsets and clipping applied by the scroll view when it is drawn. Calling setMeasuredDimension() in onMeasure() should definitely make it be the size you specify. Make sure you are not calling the super class implementation or doing your code after calling the super class, since there is a default implementation in View to set the measurements. Also make sure you are using wrap_content for the view, not match_parent. You could try looking in hierarchyviewer to see what is going on with the view hierarchy. On Fri, May 27, 2011 at 2:54 PM, Frank frank.android@gmail.com wrote: Hi All, I am writing an application that needs to put a View inside a ScrollView. Since View is used to display some content that is very long, I do View.setMeasuredDimension(width, large_height) in View's onMeasure() callback function. I noticed that no matter how high the View is, its Canvas size I queried in View.onDraw() is the same with that of the viewport. This is good since the memory consumption is only dependent on the size of the viewport. But the downside is that I have to redraw the entire Canvas manually every time onDraw() is called. Instead of View, I can use SurfaceView. However, the problem is that I cannot do SurfaceView.setMeasuredDimension(width, large_height). I found that the Canvas size of SurfaceView is the same with its virtual size (not the same with the viewport as View). So the underlying Bitmap takes lots of memory and my application won't even run (because of out of memory). Does any of you know any solution to this problem? Thank you very much. Thanks, Frank -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: All Renderscript samples fail to run on actual device (Samsung Galaxy Tab 10.1 'google io edition')
hey, we found an issue in the packaging that are delaying things. However, here's a workaround, by downloading the previous platform-tools, revision 03, which contains the compiler we used in 3.0 Links: https://dl-ssl.google.com/android/repository/platform-tools_r04-windows.zip https://dl-ssl.google.com/android/repository/platform-tools_r04-macosx.zip https://dl-ssl.google.com/android/repository/platform-tools_r04-linux.zip Download, unarchive and replace the existing folder at SDK/platform-tools Sorry for the inconvenience. Xav On Fri, May 27, 2011 at 3:32 PM, Streets Of Boston flyingdutc...@gmail.com wrote: Hi Xav, Were you able to deploy a fix? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Xavier Ducrohet Android SDK Tech Lead Google Inc. http://developer.android.com | http://tools.android.com Please do not send me questions directly. 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: All Renderscript samples fail to run on actual device (Samsung Galaxy Tab 10.1 'google io edition')
oops wrong links. Here are the good ones: https://dl-ssl.google.com/android/repository/platform-tools_r03-windows.zip https://dl-ssl.google.com/android/repository/platform-tools_r03-macosx.zip https://dl-ssl.google.com/android/repository/platform-tools_r03-linux.zip On Fri, May 27, 2011 at 4:24 PM, Xavier Ducrohet x...@android.com wrote: hey, we found an issue in the packaging that are delaying things. However, here's a workaround, by downloading the previous platform-tools, revision 03, which contains the compiler we used in 3.0 Links: https://dl-ssl.google.com/android/repository/platform-tools_r04-windows.zip https://dl-ssl.google.com/android/repository/platform-tools_r04-macosx.zip https://dl-ssl.google.com/android/repository/platform-tools_r04-linux.zip Download, unarchive and replace the existing folder at SDK/platform-tools Sorry for the inconvenience. Xav On Fri, May 27, 2011 at 3:32 PM, Streets Of Boston flyingdutc...@gmail.com wrote: Hi Xav, Were you able to deploy a fix? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Xavier Ducrohet Android SDK Tech Lead Google Inc. http://developer.android.com | http://tools.android.com Please do not send me questions directly. Thanks! -- Xavier Ducrohet Android SDK Tech Lead Google Inc. http://developer.android.com | http://tools.android.com Please do not send me questions directly. 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: Error when i open socket and enter data to be send
Did you read the link I sent? What have you tried? On Fri, May 27, 2011 at 3:18 PM, ingy abbas ingy.abba...@gmail.com wrote: What i must add to this code public void appendText(View view){ Text.append( \n In chat ); try{ // while (true) //{ sentence=inputfld.getText().toString(); sentence1=ing; Text.append( \n DataStream creating); outToServer.writeBytes(sentence); outToServer.writeBytes(sentence1); modifiedSentence = inFromServer.readLine(); Text.append(modifiedSentence); inputfld.setText(null); //if(modifiedSentence.equals(QUIT)) //break; // } } catch(Exception modifiedsentence){ Text.append(Exception); } } public void connect(View view){ try{ clientSocket= new Socket(192.168.1.3,54637); Text.append( \n created a socket); outToServer = new DataOutputStream(clientSocket.getOutputStream()); Text.append( \n created a datastream); inFromServer = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); Text.append( \n created a bufferReader); outToServer = new DataOutputStream(clientSocket.getOutputStream()); try{ Thread listen = new Thread(new clientThread(clientSocket)); listen.start(); }catch(Exception e){} // Connect.setVisibility(1); // Text.append( \n remove connect button); // Enter.setVisibility(0); }catch(Exception e){ System.out.println(Error); } } } to solve the thread problem ?? On May 27, 10:56 pm, Miguel Morales therevolti...@gmail.com wrote: You need to read: http://developer.android.com/resources/articles/painless-threading.html Also, put some more effort into your questions don't just dump some log text. On Fri, May 27, 2011 at 1:46 PM, ingy abbas ingy.abba...@gmail.com wrote: 05-27 23:34:12.933: INFO/ActivityThread(311): Pub com.android.deskclock: com.android.deskclock.AlarmProvider 05-27 23:40:10.814: ERROR/ActivityManager(61): ANR in yaraby.y (yaraby.y/.yaraby) 05-27 23:40:10.814: ERROR/ActivityManager(61): Reason: keyDispatchingTimedOut 05-27 23:40:10.814: ERROR/ActivityManager(61): Load: 0.17 / 1.97 / 1.47 05-27 23:40:10.814: ERROR/ActivityManager(61): CPU usage from 3844ms to -1833ms ago: 05-27 23:40:10.814: ERROR/ActivityManager(61): 20% 61/system_server: 11% user + 8.6% kernel / faults: 366 minor 4 major 05-27 23:40:10.814: ERROR/ActivityManager(61): 1% 126/zygote: 0.1% user + 0.8% kernel / faults: 142 minor 05-27 23:40:10.814: ERROR/ActivityManager(61): 1% 128/zygote: 0.3% user + 0.7% kernel / faults: 107 minor 05-27 23:40:10.814: ERROR/ActivityManager(61): 0% 415/yaraby.y: 0% user + 0% kernel / faults: 80 minor 7 major 05-27 23:40:10.814: ERROR/ActivityManager(61): 0.7% 40/adbd: 0% user + 0.7% kernel 05-27 23:40:10.814: ERROR/ActivityManager(61): 0% 13/kswapd0: 0% user + 0% kernel 05-27 23:40:10.814: ERROR/ActivityManager(61): 0.1% 37/qemud: 0% user + 0.1% kernel 05-27 23:40:10.814: ERROR/ActivityManager(61): 0% 425/logcat: 0% user + 0% kernel 05-27 23:40:10.814: ERROR/ActivityManager(61): 33% TOTAL: 16% user + 16% kernel + 0.2% softirq 05-27 23:40:10.814: ERROR/ActivityManager(61): CPU usage from 1100ms to 1759ms later: 05-27 23:40:10.814: ERROR/ActivityManager(61): 16% 61/system_server: 6.1% user + 10% kernel / faults: 12 minor 05-27 23:40:10.814: ERROR/ActivityManager(61): 13% 92/ InputDispatcher: 6.1% user + 7.6% kernel 05-27 23:40:10.814: ERROR/ActivityManager(61): 1.5% 62/HeapWorker: 0% user + 1.5% kernel 05-27 23:40:10.814: ERROR/ActivityManager(61): 1.5% 69/ SurfaceFlinger: 1.5% user + 0% kernel 05-27 23:40:10.814: ERROR/ActivityManager(61): 38% TOTAL: 19% user + 19% kernel -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- ~ Jeremiah:9:23-24 Android 2D MMORPG: http://solrpg.com/,http://www.youtube.com/user/revoltingx -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: All Renderscript samples fail to run on actual device (Samsung Galaxy Tab 10.1 'google io edition')
No inconvience :-) Thanks for the update. I'm going to try it out asap. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: v4 Fragments library VerifyError crash
On May 26, 1:57 am, Dave Johnston john...@gmail.com wrote: Aye, I'm going to try enabling/disabling certain optimisation passes and see if I can isolate the one causing this issue. Methods that are only referenced via reflection may be dropped as dead. If that's what's happening here, there's a way to specify them as not dead in the makefile. (See the proguard docs.) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: help: all threads have the same pid, tid, same priority
On May 25, 5:17 pm, redmapleleaf redmaplel...@gmail.com wrote: Thread t = new Thread(r); t.start(); then a new thread should be created off of the parent process. Is this not true? A new thread is created that executes Thread.run(). If you do exactly what you have typed above, you will create a new Thread whose run() does nothing, and the thread will exit immediately. You should either be subclassing Thread and overriding run(), or creating a class that is an instance of Runnable and passing that to the Thread constructor. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: All Renderscript samples fail to run on actual device (Samsung Galaxy Tab 10.1 'google io edition')
Alas, same result... it still doesn't work. still the same result, the error that the cache-file cannot be opened: 05-27 20:12:11.220: WARN/bcc(9334): Unable to open /data/data/com.android.rs.helloworld/cache/@com.android.rs.helloworld:raw@helloworld.oBCCin read mode. (reason: No such file or directory) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: All Renderscript samples fail to run on actual device (Samsung Galaxy Tab 10.1 'google io edition')
Success!!! Thank you! You are awesome :-) Have a great memorial day weekend! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Killing Background Processes
Hi, I am working with an Android 2.1 Device (API Level 7). I know that in API Level 8, you can call PackageManager's killBackgroundProcesses(String packageName) to kill background processes of packages. Is there a way to accomplish this in API Level 7? Thanks, Edmund Chang -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] canonicalToCurrentPackageNames and currentToCanonicalPackageNames
Hi, I am working on an Android 2.1 (API Level 7) device. The canonicalToCurrentPackageNames() and currentToCanonicalPackageNames() functions are API Level 8 (2.2) and above. Is there any way I can accomplish that functionality in Android 2.1? Thanks, -- Edmund Chang -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Problem while inserting webview inside the progress dialog for twitter
Hello everyone, I am trying to implement twitter sharing for my application. I have used the progessdialog with webview inside it for the twitter login. I am using browser type of application so that once i am successfully logged in, Twitter will send me to the callback url which is of my webpage. But when i logged in successfully it doesnt send me to my webpage neither does anything. I was wondering is there any problem while using webview with progressdialog in android 3.0 ?? Because this sharing is working fine with android 2.2. Thanks in advance, aby -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Killing Background Processes
No there is just the old, brutal force stop API. On Fri, May 27, 2011 at 5:22 PM, Edmund chang.edm...@gmail.com wrote: Hi, I am working with an Android 2.1 Device (API Level 7). I know that in API Level 8, you can call PackageManager's killBackgroundProcesses(String packageName) to kill background processes of packages. Is there a way to accomplish this in API Level 7? Thanks, Edmund Chang -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] canonicalToCurrentPackageNames and currentToCanonicalPackageNames
SDK developers shouldn't care about these. On Fri, May 27, 2011 at 5:27 PM, Edmund chang.edm...@gmail.com wrote: Hi, I am working on an Android 2.1 (API Level 7) device. The canonicalToCurrentPackageNames() and currentToCanonicalPackageNames() functions are API Level 8 (2.2) and above. Is there any way I can accomplish that functionality in Android 2.1? Thanks, -- Edmund Chang -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Cannot connect to VM
I am getting this error of Cannot connect to VM. Anyone know what causes this or how to fix it? Thanks. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: All Renderscript samples fail to run on actual device (Samsung Galaxy Tab 10.1 'google io edition')
Is the SDK 3.1 V2 just released related to this? On May 28, 7:25 am, Xavier Ducrohet x...@android.com wrote: oops wrong links. Here are the good ones: https://dl-ssl.google.com/android/repository/platform-tools_r03-windo...https://dl-ssl.google.com/android/repository/platform-tools_r03-macos...https://dl-ssl.google.com/android/repository/platform-tools_r03-linux... On Fri, May 27, 2011 at 4:24 PM, Xavier Ducrohet x...@android.com wrote: hey, we found an issue in the packaging that are delaying things. However, here's a workaround, by downloading the previous platform-tools, revision 03, which contains the compiler we used in 3.0 Links: https://dl-ssl.google.com/android/repository/platform-tools_r04-windo... https://dl-ssl.google.com/android/repository/platform-tools_r04-macos... https://dl-ssl.google.com/android/repository/platform-tools_r04-linux... Download, unarchive and replace the existing folder at SDK/platform-tools Sorry for the inconvenience. Xav On Fri, May 27, 2011 at 3:32 PM, Streets Of Boston flyingdutc...@gmail.com wrote: Hi Xav, Were you able to deploy a fix? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Xavier Ducrohet Android SDK Tech Lead Google Inc. http://developer.android.com|http://tools.android.com Please do not send me questions directly. Thanks! -- Xavier Ducrohet Android SDK Tech Lead Google Inc.http://developer.android.com|http://tools.android.com Please do not send me questions directly. 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] Re: echo cancellation
wear headphones On May 27, 12:52 am, neha jain neha.05...@gmail.com wrote: thanx 4 rply... but if i turn down volume control thn will not be able to hear playbackd voice. and how to seperate mic and speaker .. On Thu, May 26, 2011 at 3:19 PM, Ashwani Kumar ash1...@gmail.com wrote: When the mic can hear the speaker then there is acoustical feedback howling because the sound goes around and around. To stop the howling: a) Turn down the gain control or volume control. b) Separate the mic and speaker and point them away from each other. c) Use a good speaker with a flat frequency response instead of a cheap speaker that has a peak in its frequency response On Thu, May 26, 2011 at 5:53 PM, neha neha.05...@gmail.com wrote: Denial, I tried what u said,but it dint solve my problem but producing more echo.. I think its happening bcoz voice coming from speaker is also going in mic. If u have ny idea about it,Plz help. On May 26, 1:20 pm, Daniel Drozdzewski daniel.drozdzew...@gmail.com wrote: On Thu, May 26, 2011 at 11:59 AM, neha neha.05...@gmail.com wrote: Thanx alot 4 rply but if i use large buffer size ,it produce delay between record and play. Neha, All I suggested was to use the larger of values returned by both getMinBufferSize() calls for all 3 aspects: recording, playing and transfer of the data instead of arbitrary 400. On May 26, 11:46 am, Daniel Drozdzewski daniel.drozdzew...@gmail.com wrote: Neha, Your echo comes from the fact that you are using 400 bytes buffer to transfer the recording to the playback. It will physically take time to fill that buffer and then process. Making the buffer much smaller might not necessarily work either, as it will mean more overhead of the recording + playing management in a unit of time. However adjusting the buffer size would be a first step. You are using getMinBufferSize() method, but you ignore the returned values, when it comes to the buffer used to transfer the recording to the playback track. You should use Math.max(recordingMinBufferSize, playbackMinBufferSize) as a buffer size in all 3 cases. You should also write only bytesRead bytes, rather than writing full buffer every time. Daniel On Thu, May 26, 2011 at 10:28 AM, neha neha.05...@gmail.com wrote: Is there any way to synchronize the capturing and playback of audio data in Android? I am using audioRecord/track to achieve this.But its producing echo. Is there any way to cancel echo. My code is- { isRecording=true; bufferSize = AudioRecord.getMinBufferSize(8000,AudioFormat.CHANNEL_CONFIGURATION_MONO,Au dioFormat.ENCODING_PCM_16BIT); audioRecord = new AudioRecord(MediaRecorder.AudioSource.MIC, 8000, AudioFormat.CHANNEL_CONFIGURATION_MONO,AudioFormat.ENCODING_PCM_16BIT, bufferSize); audioRecord.startRecording(); int BUFFER_SIZE_IN_BYTES =AudioTrack.getMinBufferSize(RECORDER_SAMPLERATE,AudioFormat.CHANNEL_CONFIG URATION_MONO,RECORDER_AUDIO_ENCODING); AudioTrack audioTrack = new AudioTrack(AudioManager.STREAM_SYSTEM, 8000,AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT, BUFFER_SIZE_IN_BYTES, AudioTrack.MODE_STREAM); byte[] buffer=new byte[400]; audioTrack.play(); while (isRecording) { int bytesRead = audioRecord.read(buffer, 0, 400); int bytesWritten = audioTrack.write(buffer, 0, 400); } -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this
[android-developers] Re: java.lang.ArrayStoreException on Honeycomb device (Acer Iconia A500)
Can't debug it because it's a market crash report. I tried to reproduce it but no luck so far. Although I did try it on 3.0 and 3.1 only (where do I get 3.0.1 anyway?) On May 27, 2:35 pm, Streets Of Boston flyingdutc...@gmail.com wrote: Debug it. put getCell(i) into a variable and see what that variable is. And it seems that during run-time something is about to be stored in a LinkedHash*Map* (and not in LinkedHashSet as shown in your code). -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en