[android-developers] Re: Updating UI from second thread
Nobody tells you to freeze the UI thread. Dig into source code, see how Handlers, Looper and MessageQueue works and you'll get an idea how you can implement everything on UI thread without having it frozen. It's all about that. On Aug 19, 6:35 am, Snowak psno...@gmail.com wrote: What a wonderful answer. It's a great idea to answer everything with you don't know what you're doing and tell me to do it using worst possible method. Yeah, let's freeze the UI thread. It's gonna be cool. On 17 Sie, 23:17, Mark Murphy mmur...@commonsware.com wrote: On Wed, Aug 17, 2011 at 12:44 PM, Snowak psno...@gmail.com wrote: I have hundreds of CheckBox widgets in my layout That is unlikely to be a good idea. Obviously such heavy work should be done in separate thread, Not really. The only thing that this thread actually can do is looping through the list and posting the Runnable for every found checkbox. The problem is that all those Runnables arrive in the UI thread almost at the same time, thus they're all executed at once... The application behaves exactly like I would run the above code in the UI thread - everything freezes. A possible solution is sleeping for some miliseconds after each checkbox so the Runnable can be executed and the UI will have time to process the events... but it's more like a hack. How can I solve this problem? Redesign your UI to not have hundreds of CheckBox widgets at once. Or, update them on the main application thread and hope for the best. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy _Android Programming Tutorials_ Version 3.9 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Using Mock Locations in Google Maps Navigation App
I'm trying to write an app that will simulate a driving route with Google Maps Navigation. I am using: LocationManager locationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE); locationManager.addTestProvider(LocationManager.GPS_PROVIDER, false, false,false, false, true, true, true, 0, 5); locationManager.setTestProviderEnabled(LocationManager.GPS_PROVIDER, true); locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, this); Location location = new Location(LocationManager.GPS_PROVIDER); location.setLatitude(latitude); location.setLongitude(longitude); location.setAltitude(altitude); locationManager.setTestProviderLocation(LocationManager.GPS_PROVIDER,location); I feed in the latitude, longitude, and altitude at regular intervals. The mock locations update properly in Maps and Navigation. However, I see a Searching for GPS Signal message at the bottom of Navigation and the turn-by-turn driving directions / route recalculation features are not active. I was wondering if anyone has any advice for how to get the Navigation application to use my mock coordinates instead of the GPS signal. I've done a pretty extensive online search over the last few days but have not found any similar problems. Thanks for your help. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: On ExpandableListViews Again
Could you elaborate on the solution you found? I'm experiencing the same view-restriction issue. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Candle Stick Graph in Android??
http://www.artfulbits.com/products/android/aiCharts.aspx On Aug 9, 1:04 pm, Thulasi thulas...@gmail.com wrote: Hi, Is there any good Candle Stick graph libraries for android..?? i managed to find couple of evaluatory versions.. not sure if there is a tested charting library for Candle Stick in Android..?? Any comments or solutions is highly appreciated.. thanks thulasi. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Charts in android
http://www.artfulbits.com/products/android/aiCharts.aspx On Aug 8, 12:45 am, niki nikhil2...@gmail.com wrote: how to make chart component in android. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: close cursor
Make sure yoy are not reopening batabase after you've opened it. On Aug 4, 1:19 am, Dev_red sktniranjanad...@gmail.com wrote: Thank you very much. but i am getting this error.. Finalizing a Cursor that has not been deactivated or closed. database = /data/data/com.android.myproject/databases/sampleDB, table = n ull, query = select * from TableName E/Cursor ( 863): android.database.sqlite.DatabaseObjectNotClosedException: App lication did not close the cursor or database object that was opened here On Aug 3, 5:59 pm, Vladimir Svydenko vov...@gmail.com wrote: Hi, If You close cursor inside this method - it will return null. So, You do not need here closing cursor. Here You can get data from cursor and then close it. regards On Aug 3, 2:56 pm,Dev_redsktniranjanad...@gmail.com wrote: hi How to close cursor in following method? where i have to add cur.close()? Cursor getData() { SQLiteDatabase sdb=this.getWritableDatabase(); Cursor cur = sdb.rawQuery(select * from + manpowerLUTable,null); if (cur != null) { cur.moveToFirst(); } sdb.close(); return cur; } -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 execute KILL -9 pID command
Look at http://developer.android.com/reference/android/Manifest.permission.html#KILL_BACKGROUND_PROCESSES But I do agree with Mark. Please don't write anything like that. On Aug 4, 5:20 pm, Mark Murphy mmur...@commonsware.com wrote: On Thu, Aug 4, 2011 at 2:12 PM, vinaykant vinaykant.s...@gmail.com wrote: I am new baby in android development and developing an application which will KILL a running application (ex. com.example.helloWorld). Please don't. I tried process.getruntime().exec(kill -9 211), here 211 is the pID which I am able to get. But the process.getruntime().exec command giving me permission error as the current user is not having permission. Correct. You can't kill processes. Please can any one help me out to get the permission through the programmatic ? You can't. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy Android Training in NYC:http://marakana.com/training/android/ -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Dynamic Tab Difficulties
I'm trying to dynamically create tabs and a tabHost based on XML that I receive from an API. The XML basically defines the UI and how the layout should be setup. Here's an example XML snippet: https://gist.github.com/1119132 Traversing the XML and building most of the views is all working decent at the moment, however when dealing with dynamic tab generation I'm running into some issues that I can't quite seem to figure out. Here's two snippets of part of the code that should be building the tab interface: https://gist.github.com/1119143 With this code I end up getting a NullPointerException on TabHost.addTab(), https://gist.github.com/1119148 Has anyone worked with dynamic tab building, and could maybe lend a hand at deciphering this error or finding an appropriate route to building tabs like this? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How Android Market's OTA works?
It's push. Android market (vending process on your device) keeps passive connection with Android Market server. Same way Gmail app works. This is why email delivery is instant. On Aug 1, 7:23 pm, Jose_GD jose.gonzale...@gmail.com wrote: Hi all, I'm wondering how the Android Market's web app communicates with the associated phone to initiate the installation of a new app in devices. I'm pretty sure it's not Cloud to Device Messaging, because my Eclair phone works perfectly with this feature and C2DM is for Froyo + devices. Is it just a service polling the Android Market server at regular intervals? TIA, José -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: inApp soundgeneration possible without heavy use of CPU ?
First guess: have you tried moving heavy stuff to C/C++ and linking via JNI? On Jul 31, 3:35 pm, Peter Pippinger pe...@pippinger.de wrote: Hello, I have now completed my first app (https://market.android.com/details?id=com.pippinger.android.frogthisw...). For the music I was working withhttp://www.warmplace.ru/soft/sunvox/which is a very powerful synthesizer in my opinion. I think the chiptunes-style fits best for android-apps. On the other side it takes much memory for having long music in the app if you are insert it by .ogg or something like that. So my question: is it possible to do some synthesizer-calculation in Java for the music with not to much CPU-consumption? Maybe you have some links (maybe also to some apps which are doing something like this)? Thanks a lot and kind regards, Peter -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Need help diagnosing problem
Omg! Are you serious? On Jul 30, 11:37 am, ajaykumar kanchak ajaykumar.kanc...@gmail.com wrote: you need arrange the things like for example u may used only for drawable ldpi, only but having mdpi ldpi hdpi so u have check out the things may be it may work only landscape make it as potrait and take resolutions dynamically it may fix only for some screens. On Jul 30, 9:27 pm, bob b...@coolgroups.com wrote: My stuff is getting really low ratings partly because it doesn't work on certain phones. Can someone take a look at my app here and help me figure it out? https://market.android.com/details?id=com.coolfone.sonicboomfeature=... If you have an HTC Eris, this would be especially 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
[android-developers] Re: please stop logcat autoscroll
Press scroll lock button on a keyboard :) On Jul 23, 2:16 pm, TreKing treking...@gmail.com wrote: On Sat, Jul 23, 2011 at 2:11 PM, freeanderson freeander...@gmail.comwrote: please stop logcat 'autoscroll' or please make its option. It is an option. If you scroll to the bottom of the log, it autoscrolls. If you scroll up even one tick, it stops autoscrolling. - 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] Ways to promote your Android app
Here's my list of the top ways I can think of to market your Android app. If you have any suggestions to add please leave them in the comments or email me at p...@bowen.fm. I've tried to order the list in terms of risk vs effort vs reward to order in terms of which strategy will have the most effect in getting more people to use your app. 1. Make it free(mium): So this isn't a way to promote your app but it's a marketing strategy. Making your app free will ensure that every one of the rest of the suggestions below is more effective by 10x or more, releasing a paid app, especially on Android, will only bring you pain. If you want some reasons why you should make your app freemium go here: 2. App stores: Submitting your app to several app stores is an easy free way to ensure you're more visible. The first stop should be Google Market. You could leave it at at but it's free to submit to Getjar and Amazon Android Market place so you might as well. Google Market + Amazon take a revenue share of the money you make from either selling your app or from any in app purchases (IAP) that are made through their billing solutions which is the trade-off for exposure. Getjar only accepts free apps and allows you to implement your own billing solutions if you use IAP. App stores are effectively risk free as a revenue share is given to the app store owner. 2.1 On market presence: you’d be surprised at the install rate at which apps are installed / clicked through etc based on their icon. It’s CRUCIAL, and it’s free for you to optimise. Trial a couple and see what works best. App name is also REALLY important. Make it easy to find, both in the app store but using Google. I know so many companies who’ve used an obscure name, or hyphenated name, and suffered from it. 2.2 Begging app store curators: This section is all about getting free promotion and putting your product in front of the people who curate the editorial sections of an app store is a great way to get yourself some free exposure. Find out who looks after the editorial sections of Google, Amazon, Getjar in your country, email them and tell them why your app offers such good value to the end user. Providers include: Google Android Market, Getjar, Amazon Appstore for Android 3. Mobile Affiliate networks: When reducing risk mobile affiliate networks are another good way to buy traffic for your application, they're middlemen who bring together publishers / affiliates (normally application developers or mobile website owners) who want to monetise their traffic and advertisers who want an audience for their traffic through technology. Affiliate networks revenue model is normally on an override of 30% of the revenue you pay out to an affiliate, so if you had a $1 app and gave $0.50 commission to an affiliate for providing that sale, then you'd pay $0.15 commission to the affiliate network. The same can work with IAP for free apps. The issue here is volume, there are very few affiliate networks that can provide any sort of scalability with this model because of the poor conversions from the traffic they monetise and there are normally set up fees. Providers include: Mobpartner, Commission Junction, Tradedoubler, Linkshare, Offermobi, Sponsormob, Moolah Media, Mobilclix 4. Pay per install providers: When you pay per install for an application you're normally paying for the user to download and open an application. If the application is paid for, and you're paying less for the install than you are to the provider then you're ROI positive. This isn't normally the case though and there are only scalable options for Pay Per Install when you have a free app and are making money on an in app transaction. Providers include: Getjar, Everbadge, Appbrain 5. Incentivised Pay per install: The end user who downloads your app still has to install your app but they got some sort of incentive for doing so (normally virtual currency in a game they were playing). In terms of volume this is the single biggest paid source of installs on Android but the fact that the incentivised installs are further up the conversion path means quality can suffer. Providers include: Tapjoy (disclaimer, I work for them), Flurry, mdotm 6. Incentivised Pay per action / acquisition: still using the incentivised model but incentivising the user to engage with an app rather than just download and open it. Providers include: At the moment Tapjoy are they only company to offer this. 7. Social SDK's: are mobile social network for gamers. This allows gamers to discover new apps through what their friends are doing and what's popular. Providers include: Openfeint, Scoreloop, Papaya, HeyZap 8. Adnetworks: Although adnetworks have massive scale, the metric an adnetwork will normally bill an advertiser on is CPC (cost per click), this can mean it's very difficult to see how your campaign is converting and if you can track this with their SDK it will often be higher than you'd like
[android-developers] Re: Help me to create my application(data to be edited real time)
GO thru SDK samples. They will give you generic idea of how that could be implemented. On Jul 15, 7:54 am, julious raj julious...@gmail.com wrote: I want to create an application which stores the given data such as name, DOB, address, mail, and etc., into sqlite database and then goes to another activity and that activity shows the data like tableview . i've done this by listing data in listview in column. But it is not aligned well. the address field is not synchronized with name. My aim is to edit the data in real time(means when i press long in a row it must be editable ) and update the edited data to sqlite database. Any one please help me. Give me ideas how to do it? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] undefined reference error! module in frameworks uses external/jpeg..
Hi, I have struggled with it for couple of days~~ we customized Android frameworks by adding a service component into $ANDROID/frameworks/base/ folder The service component needs to use $ANDROID/external/jpeg library, but we got link error: Our problem could be identified as: *Is it feasible to link $ANDROID/ external/jpeg in $ANDROID/frameworks/base/xyz module, as the $ANDROID/ external/skia module?* * * That is, *How could I link external/jpeg's libjpeg.a into frameworks/base/xxx ??* * * And, is it possible the namespace? We include *jpeglib.h* with *extern C* declaration, and call libjpeg functions in *android namespace*. Does anyone know how to call libjpeg functions in android namespace? The Android.mk is as follows: LOCAL_PATH:= $(call my-dir) # include $(CLEAR_VARS) ifeq ($(USE_CAMERA_STUB),) USE_CAMERA_STUB:= false ifneq ($(filter sooner generic sim,$(TARGET_DEVICE)),) USE_CAMERA_STUB:=true endif #libcamerastub endif ifeq ($(USE_CAMERA_STUB),true) # # libcamerastub # LOCAL_C_INCLUDES := external/jpeg LOCAL_STATIC_LIBRARIES := libjpeg LOCAL_SRC_FILES := ... ifeq ($(TARGET_SIMULATOR),true) LOCAL_CFLAGS += -DSINGLE_PROCESS endif LOCAL_MODULE:= libcamerastub include $(BUILD_STATIC_LIBRARY) endif # USE_CAMERA_STUB # # libcameraservice # include $(CLEAR_VARS) LOCAL_C_INCLUDES := external/jpeg LOCAL_SRC_FILES := ... LOCAL_MODULE:= libcameraservice LOCAL_SHARED_LIBRARIES:= \ libui \ libutils \ libbinder \ libcutils \ libmedia LOCAL_PRELINK_MODULE := false ifeq ($(TARGET_SIMULATOR),true) LOCAL_CFLAGS += -DSINGLE_PROCESS endif LOCAL_STATIC_LIBRARIES := libjpeg ifeq ($(USE_CAMERA_STUB), true) LOCAL_STATIC_LIBRARIES += libcamerastub else LOCAL_SHARED_LIBRARIES += libcamera endif include $(BUILD_SHARED_LIBRARY) And the errors are: out/target/product/devkit8000/obj/STATIC_LIBRARIES/libcamerastub_intermediates/libcamerastub.a(xxx.o): In function `android::xxx::fxn()': /work/0xdroid/frameworks/base/camera/libcameraservice/filexxx.cpp:314: undefined reference to `jpeg_std_error' /work/0xdroid/frameworks/base/camera/libcameraservice/filexxx.cpp:315: undefined reference to `jpeg_CreateCompress' /work/0xdroid/frameworks/base/camera/libcameraservice/filexxx.cpp:322: undefined reference to `jpeg_stdio_dest' /work/0xdroid/frameworks/base/camera/libcameraservice/filexxx.cpp:341: undefined reference to `jpeg_set_defaults' /work/0xdroid/frameworks/base/camera/libcameraservice/filexxx.cpp:351: undefined reference to `jpeg_set_quality' /work/0xdroid/frameworks/base/camera/libcameraservice/filexxx.cpp:354: undefined reference to `jpeg_set_quality' /work/0xdroid/frameworks/base/camera/libcameraservice/filexxx.cpp:355: undefined reference to `jpeg_simple_progression' /work/0xdroid/frameworks/base/camera/libcameraservice/filexxx.cpp:360: undefined reference to `jpeg_start_compress' /work/0xdroid/frameworks/base/camera/libcameraservice/filexxx.cpp:366: undefined reference to `jpeg_write_scanlines' /work/0xdroid/frameworks/base/camera/libcameraservice/filexxx.cpp:370: undefined reference to `jpeg_finish_compress' /work/0xdroid/frameworks/base/camera/libcameraservice/filexxx.cpp:372: undefined reference to `jpeg_destroy_compress' collect2: ld returned 1 exit status make: *** [out/target/product/devkit8000/obj/SHARED_LIBRARIES/libcamerastub_intermediates/LINKED/libcameraservice.so] Error 1 make: *** Waiting for unfinished jobs ~/work/0xdroid$ Best Regards, Paul Chu http://www.luke54.org/ http://www.luke54.org/耶和華我的磐石,我的救贖主阿,願我口中的言語,心裡的意念,在你面前蒙悅納。~詩1914 -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: GSM signal strength unknown returned in Gingerbread 2.3.3
b_t, which device are you using? I'd like to be able to specifically name the problematic devices until the issue is resolved. Alex, do you have a list of devices? The only device I've encountered with this problem is the Samsung Galaxy S II and I've posted an issue on Android here: http://code.google.com/p/android/issues/detail?id=18336 An HTC Desire HD with LeeDroid (2.3.3) does not exhibit this behavior. On May 17, 12:27 pm, Alex maroeb...@gmail.com wrote: I installed several apps and widgets from the Market that display signal strength and they all exhibited the same problem. This is serious for me, as my app Mobile Signal Widget is for displaying the signal strength! I am getting lots of negative comments from users who blame me for this. On May 17, 7:21 am, b_t bartata...@gmail.com wrote: Some of my users with2.3.3get always unknown signal strength too. So I'm interested in the answer too. On May 16, 2:12 am, Alex maroeb...@gmail.com wrote: I have registered a PhoneStateListener and I am listening to onSignalStrengthChanged(asu) and onSignalStrengthsChanged(SignalStrength signalStrength). On Eclair, these events correctly return the GSMsignalstrengthin asu, but on Gingerbread onSignalStrengthChanged always returns -1 and signalStrength.GetGsmSignalStrength() always returns -99 (UNKNOWN_RSSI). This means it is impossible to read thesignalstrengthon Gingerbread. I tried my app on a phone with Gingerbread version 2.3.4 and it worked fine. Is this a known issue with2.3.3? Is there a workaround?- 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: GridView with ToggleButton
You will have to supply Adapter for GridView in order to work. Consider setting CHOICE_MODE_MULTIPLE as I assume you can have multiple items toggled. On Jun 19, 6:21 pm, Vault lord.va...@gmail.com wrote: Hello, I'm trying to obtain something like:http://s4.appbrain.com/screen?id=-1118678252346788544i=2 but only with ToggleButtons in a Grid. I've googled around but found nothing, so here I am kindly asking for help. I thought something like: GridView ToggleButton ToggleButton ToggleButton /GridView could work, but it's not. What's the right way to do that? 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: Want to capture screenshot of current screen from phone
Your process will need permission to do that. ADB has it by default, but regular apps don't. Unless you're rooted, you can't do that. On Jun 2, 4:27 am, Bharathiraja R bharathiraja.andr...@gmail.com wrote: Hi All, Want sample code to capture screenshot of current screen from phone, same like ddms (screen capture). Please help me out. Regards, Bharathiraja R -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: a question of message hooking
What you mention here is a thread starving. Generally, there are 2 solutions you can think of: 1. Don't send message to UI thread until prevoius one was dispatched 2. Remove message from UI thread before sending a new one The mode you choose is up to implementation and depends on how important is message that is already in UI thread's queue. On May 30, 2:59 am, Xie Daniel jasic2...@gmail.com wrote: I have a scenario like this : A1 Thread(GUI thread) and A2 thread. A2 thread regularly sends msg to A1 to update GUI showing . But frequent msg sending might lead to the msg accumulation in A1 Queue because A1 might not handle these messages in a short manner. Then, some msgs like onDestroy come and is not handled in time ... Currently , I am going to peek msgs in A1 thread queue and dispatch some specified msgs with high priority. Therefor , I hope to hook all msgs in A1 thread , including system msg Based on this soution ,a handler is customized for hook.. .Unluckily , it only captures the msgs with handle directed to itself , excluding the so-called system message . Would you like to share some ideas to capture ALL messages , regardless of ones sent by A2 or system ... Thanks BRs 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
[android-developers] Re: Is there a walkthrough for extending View, especially for the XML layout files?
Mention full package name in your XML file. Like: com.mypackage.views.ResettableChronometer android:layout_width=fill_parent android:layout_height=fill_parent/ On May 15, 1:59 am, Brian Carmicle brian.carmi...@gmail.com wrote: Right now, I'm trying to extend Chronometer (1) with a class called ResettableChronometer. When I try to use it, however, my app crashes because it couldn't inflate ResettableChronometer from the XML layout file I was using for that Activity. I've found some general documentation on Views (2), which references LayoutInflater, but I'm having trouble understanding how this all works (I'm new to Android). Is there some sort of tutorial or walkthough that can help me understand how to do this? (1)http://developer.android.com/reference/android/widget/Chronometer.html (2)http://developer.android.com/reference/android/view/View.html (3)http://developer.android.com/reference/android/view/LayoutInflater.html -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Lag problem
Seriously? On Apr 30, 10:06 am, Fadil Kamal fadilkama...@gmail.com wrote: how to accelerate the performance of my phone? sometimes my phone lags how to fix it? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: how to accelerate the performance of my phone?
Why are you asking the same question all over the group? On Apr 30, 10:02 am, Fadil Kamal fadilkama...@gmail.com wrote: how to accelerate the performance of my phone? sometimes my phone lags even force close how to fix it? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to get the text height
decent()-acent() On Apr 30, 5:49 am, a a harvey.a...@gmail.com wrote: paint.measureText(text) return the width, how can i get the height of the 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] Keytool and Jarsigner - where are they?
I am using eclipse and cannot find Keytool or Jarsigner . Where are they accessed from? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] apk certificate
I tried to upload my apk file on android market and got the error message that says Market does not accept apks signed with the debug certificate. Create a new certificate that is valid for at least 50 years. Market reqires that the certificate used to sign the apk be valid until at least October 22, 2033. Create a new certificate. How do I do this? I used eclipse helios to write my code and it tested fine but I can't upload to the market. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Problem setting file permissions when filename has a space
That did it when it comes to my own call to: getContentResolver().openFileDescriptor(validUri, r); It is now calling openAssetFile() in my content provider. However, in the usage of the send functionality with the content://... uri: Intent share = new Intent(Intent.ACTION_SEND); share.setType(StylePad.DEFAULT_MIME_PNG); share.putExtra(Intent.EXTRA_STREAM, validUri); startActivity(Intent.createChooser(share, getString(R.string.activity_title_share))); I am now getting a IllegalArgumentException thrown, and my openFile/ openAssetFile never gets called (the Exception is hitting before it would get there I guess). Here is the Exception: 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): java.lang.IllegalArgumentException: column '_data' does not exist 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at android.database.AbstractCursor.getColumnIndexOrThrow(AbstractCursor.java: 314) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at android.database.CursorWrapper.getColumnIndexOrThrow(CursorWrapper.java: 99) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.UriImage.initFromContentUri(UriImage.java:160) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.UriImage.init(UriImage.java:90) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.MMSMessage.addImage(MMSMessage.java:1076) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.ConversationList.addMedia(ConversationList.java: 7095) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.ConversationList.addAttachment(ConversationList.java: 8370) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.ConversationList.handleIntent(ConversationList.java: 1860) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.ConversationList.access$2800(ConversationList.java: 180) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.ConversationList $ThreadListQueryHandler.onQueryComplete(ConversationList.java:2999) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at android.content.AsyncQueryHandler.handleMessage(AsyncQueryHandler.java: 344) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at android.os.Handler.dispatchMessage(Handler.java:99) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at android.os.Looper.loop(Looper.java:123) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at android.app.ActivityThread.main(ActivityThread.java:4627) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at java.lang.reflect.Method.invokeNative(Native Method) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at java.lang.reflect.Method.invoke(Method.java:521) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:871) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at dalvik.system.NativeStart.main(Native Method) Looking at the source: http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android-apps/2.0_r1/com/android/mms/ui/UriImage.java#UriImage.initFromContentUri%28android.content.Context%2Candroid.net.Uri%29 So the Send functionality is querying my Provider's query() method, which I can see, but it is looking for two columns that I simply don't have, Part.FILENAME (column fn) and then if not found, column Part._DATA (column _data). Any ideas how to respond to this? On Apr 26, 3:30 am, Kostya Vasilyev kmans...@gmail.com wrote: Paul, Don't know if this is a typo, but - you have Uri.fromFile in the code quoted below. That method makes a file:// Uri, which has nothing to do with your content provider (or any other) - and that's why you are not seeing a call to your openFile. You need to construct a content:// scheme Uri which points to your provider's authority. -- Kostya 26.04.2011 6:04, Paul пишет: provider android:name=.provider.MyProvider android:authorities=package.name.here android:exported=true / I am using it for all DB activity in my app, so it's working... and have tried the following, and no errors are generated: getContentResolver().openFileDescriptor(Uri.fromFile(shareFile), r); But... this does not trigger a call to openFile(). -- Kostya Vasilyev --http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Problem setting file permissions when filename has a space
That did it when it comes to my own call to: getContentResolver().openFileDescriptor(validUri, r); It is now calling openAssetFile() in my content provider. However, in the usage of the send functionality with the content://... uri: Intent share = new Intent(Intent.ACTION_SEND); share.setType(DEFAULT_MIME_PNG); share.putExtra(Intent.EXTRA_STREAM, validUri); startActivity(Intent.createChooser(share, getString(R.string.activity_title_share))); I am now getting a IllegalArgumentException thrown, and my openFile/ openAssetFile never gets called (the Exception is hitting before it would get there I guess). Here is the Exception: 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): java.lang.IllegalArgumentException: column '_data' does not exist 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at android.database.AbstractCursor.getColumnIndexOrThrow(AbstractCursor.java: 314) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at android.database.CursorWrapper.getColumnIndexOrThrow(CursorWrapper.java: 99) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.UriImage.initFromContentUri(UriImage.java:160) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.UriImage.init(UriImage.java:90) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.MMSMessage.addImage(MMSMessage.java:1076) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.ConversationList.addMedia(ConversationList.java: 7095) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.ConversationList.addAttachment(ConversationList.java: 8370) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.ConversationList.handleIntent(ConversationList.java: 1860) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.ConversationList.access$2800(ConversationList.java: 180) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.ConversationList $ThreadListQueryHandler.onQueryComplete(ConversationList.java:2999) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at android.content.AsyncQueryHandler.handleMessage(AsyncQueryHandler.java: 344) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at android.os.Handler.dispatchMessage(Handler.java:99) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at android.os.Looper.loop(Looper.java:123) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at android.app.ActivityThread.main(ActivityThread.java:4627) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at java.lang.reflect.Method.invokeNative(Native Method) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at java.lang.reflect.Method.invoke(Method.java:521) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:871) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at dalvik.system.NativeStart.main(Native Method) Looking at the source: http://grepcode.com/file/repository.grepcode.com/java/ext/com.google So the Send functionality is querying my Provider's query() method, which I can see, but it is looking for two columns that I simply don't have, Part.FILENAME (column fn) and then if not found, column Part._DATA (column _data). Any ideas how to respond to this? On Apr 26, 3:30 am, Kostya Vasilyev kmans...@gmail.com wrote: Paul, Don't know if this is a typo, but - you have Uri.fromFile in the code quoted below. That method makes a file:// Uri, which has nothing to do with your content provider (or any other) - and that's why you are not seeing a call to your openFile. You need to construct a content:// scheme Uri which points to your provider's authority. -- Kostya 26.04.2011 6:04, Paul пишет: provider android:name=.provider.MyProvider android:authorities=package.name.here android:exported=true / I am using it for all DB activity in my app, so it's working... and have tried the following, and no errors are generated: getContentResolver().openFileDescriptor(Uri.fromFile(shareFile), r); But... this does not trigger a call to openFile(). -- Kostya Vasilyev --http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Problem setting file permissions when filename has a space
Right, but in my case I am dealing with a physical file, not data stored in a database. I have physical .png files located in the applications /files directory that I want to be able to send/share. As I was originally copying the file over to the cache directory and making them world readable via .exec(), I asked about spaces in filenames. I was told not to use this method, but to use the content provider, but that only gets called if I move away from the file: uri to the content: uri... but using a content provider, the share/send seems to be expecting some kind of database implementation. Should I be looking for the file-specific uri in query() (those that end with .png), and if that hits, then create and return a cursor that contains the needed columns, fn, _data? Thanks, Paul On Apr 26, 11:42 am, Kostya Vasilyev kmans...@gmail.com wrote: Right. Any sane application dealing with a content:// URI will want to know the data item's title and size (at least). It would do that by querying the URI for columns, defined here: http://developer.android.com/reference/android/provider/MediaStore.Me... using ContentResolver, which will direct the query back to your ContentProvider's query method. Looks like the MMS application also wants to get the actual filename (the _data column). -- Kostya 26.04.2011 19:29, Paul пишет: That did it when it comes to my own call to: getContentResolver().openFileDescriptor(validUri, r); It is now calling openAssetFile() in my content provider. However, in the usage of the send functionality with the content://... uri: Intent share = new Intent(Intent.ACTION_SEND); share.setType(StylePad.DEFAULT_MIME_PNG); share.putExtra(Intent.EXTRA_STREAM, validUri); startActivity(Intent.createChooser(share, getString(R.string.activity_title_share))); I am now getting a IllegalArgumentException thrown, and my openFile/ openAssetFile never gets called (the Exception is hitting before it would get there I guess). Here is the Exception: 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): java.lang.IllegalArgumentException: column '_data' does not exist 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at android.database.AbstractCursor.getColumnIndexOrThrow(AbstractCursor.java: 314) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at android.database.CursorWrapper.getColumnIndexOrThrow(CursorWrapper.java: 99) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.UriImage.initFromContentUri(UriImage.java:160) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.UriImage.init(UriImage.java:90) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.MMSMessage.addImage(MMSMessage.java:1076) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.ConversationList.addMedia(ConversationList.java: 7095) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.ConversationList.addAttachment(ConversationList.java: 8370) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.ConversationList.handleIntent(ConversationList.java: 1860) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.ConversationList.access$2800(ConversationList.java: 180) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.ConversationList $ThreadListQueryHandler.onQueryComplete(ConversationList.java:2999) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at android.content.AsyncQueryHandler.handleMessage(AsyncQueryHandler.java: 344) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at android.os.Handler.dispatchMessage(Handler.java:99) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at android.os.Looper.loop(Looper.java:123) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at android.app.ActivityThread.main(ActivityThread.java:4627) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at java.lang.reflect.Method.invokeNative(Native Method) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at java.lang.reflect.Method.invoke(Method.java:521) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:871) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at dalvik.system.NativeStart.main(Native Method) Looking at the source: http://grepcode.com/file/repository.grepcode.com/java/ext/com.google So the Send functionality is querying my Provider's query() method, which I can see, but it is looking for two columns that I simply don't have, Part.FILENAME (column fn) and then if not found, column Part._DATA (column _data). Any ideas how to respond to this? On Apr 26, 3:30 am, Kostya Vasilyevkmans
[android-developers] Re: Problem setting file permissions when filename has a space
Thanks Kostya. My app actually DOES use a SQLite DB as well for other functionality that makes use of the content provider, but like you mention, with a custom Uri I can match against a known set and handle the file requests as needed. I am assuming that once I handle this query() issue, then openFile() will be called at some subsequent stage where I can then set the permissions as needed to give the send/share functionality access to the private file as needed. Will post back here once I have this implemented. Thanks, Paul On Apr 26, 4:13 pm, Kostya Vasilyev kmans...@gmail.com wrote: 26.04.2011 19:53, Paul пишет: Right, but in my case I am dealing with a physical file, not data stored in a database. I have physical .png files located in the applications /files directory that I want to be able to send/share. A ContentProvider doesn't have to be backed by a database. Since yours is not, you can use MatrixCursor to build one row of data in memory in your query(). http://developer.android.com/reference/android/database/MatrixCursor As I was originally copying the file over to the cache directory and making them world readable via .exec(), I asked about spaces in filenames. I was told not to use this method, but to use the content provider, but that only gets called if I move away from the file: uri to the content: uri... but using a content provider, the share/send seems to be expecting some kind of database implementation. There is no expectation of a database. Even though ContentProviders are often backed up by SQL databases, the abstraction is flexible enough to allow for non-database data (as is the case for your application). Should I be looking for the file-specific uri in query() (those that end with .png), and if that hits, then create and return a cursor that contains the needed columns, fn, _data? Remember that these URIs originate from your own code, and are opaque to all other applications. There is really no need to be cryptic (e.g. content://paulsapp/item/2349), you can make them more convenient for yourself, for example: content://paulsapp/cache/RealFileName.png Writing query() should be really simple then. Just for reference, Open Intents File Manager does something pretty close with its content URIs, so you are heading down a well trodden path. -- Kostya Thanks, Paul On Apr 26, 11:42 am, Kostya Vasilyevkmans...@gmail.com wrote: Right. Any sane application dealing with a content:// URI will want to know the data item's title and size (at least). It would do that by querying the URI for columns, defined here: http://developer.android.com/reference/android/provider/MediaStore.Me... using ContentResolver, which will direct the query back to your ContentProvider's query method. Looks like the MMS application also wants to get the actual filename (the _data column). -- Kostya 26.04.2011 19:29, Paul пишет: That did it when it comes to my own call to: getContentResolver().openFileDescriptor(validUri, r); It is now calling openAssetFile() in my content provider. However, in the usage of the send functionality with the content://... uri: Intent share = new Intent(Intent.ACTION_SEND); share.setType(StylePad.DEFAULT_MIME_PNG); share.putExtra(Intent.EXTRA_STREAM, validUri); startActivity(Intent.createChooser(share, getString(R.string.activity_title_share))); I am now getting a IllegalArgumentException thrown, and my openFile/ openAssetFile never gets called (the Exception is hitting before it would get there I guess). Here is the Exception: 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): java.lang.IllegalArgumentException: column '_data' does not exist 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at android.database.AbstractCursor.getColumnIndexOrThrow(AbstractCursor.java: 314) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at android.database.CursorWrapper.getColumnIndexOrThrow(CursorWrapper.java: 99) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.UriImage.initFromContentUri(UriImage.java:160) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.UriImage.init(UriImage.java:90) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.MMSMessage.addImage(MMSMessage.java:1076) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.ConversationList.addMedia(ConversationList.java: 7095) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.ConversationList.addAttachment(ConversationList.java: 8370) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.ConversationList.handleIntent(ConversationList.java
[android-developers] Re: Problem setting file permissions when filename has a space
Ok, so the UriImage code IS expecting a Cursor that contains two columns, _data and mime_type. Silly question maybe, but how do I create a Cursor containing these columns from a static PNG file without storing the corresponding data in a database? I am now handling the Uri for the image (content://package.name/#/png) in my ContentProvider.query(), and can fudge the values from the database if needed (SELECT name AS '_data', etc), but I am not, and can't really store mime type... as it is possible for the static file to be in any number of formats (png, svg, etc). Any pointers appreciated on how to handle this. Paul On Apr 26, 4:13 pm, Kostya Vasilyev kmans...@gmail.com wrote: 26.04.2011 19:53, Paul пишет: Right, but in my case I am dealing with a physical file, not data stored in a database. I have physical .png files located in the applications /files directory that I want to be able to send/share. A ContentProvider doesn't have to be backed by a database. Since yours is not, you can use MatrixCursor to build one row of data in memory in your query(). http://developer.android.com/reference/android/database/MatrixCursor As I was originally copying the file over to the cache directory and making them world readable via .exec(), I asked about spaces in filenames. I was told not to use this method, but to use the content provider, but that only gets called if I move away from the file: uri to the content: uri... but using a content provider, the share/send seems to be expecting some kind of database implementation. There is no expectation of a database. Even though ContentProviders are often backed up by SQL databases, the abstraction is flexible enough to allow for non-database data (as is the case for your application). Should I be looking for the file-specific uri in query() (those that end with .png), and if that hits, then create and return a cursor that contains the needed columns, fn, _data? Remember that these URIs originate from your own code, and are opaque to all other applications. There is really no need to be cryptic (e.g. content://paulsapp/item/2349), you can make them more convenient for yourself, for example: content://paulsapp/cache/RealFileName.png Writing query() should be really simple then. Just for reference, Open Intents File Manager does something pretty close with its content URIs, so you are heading down a well trodden path. -- Kostya Thanks, Paul On Apr 26, 11:42 am, Kostya Vasilyevkmans...@gmail.com wrote: Right. Any sane application dealing with a content:// URI will want to know the data item's title and size (at least). It would do that by querying the URI for columns, defined here: http://developer.android.com/reference/android/provider/MediaStore.Me... using ContentResolver, which will direct the query back to your ContentProvider's query method. Looks like the MMS application also wants to get the actual filename (the _data column). -- Kostya 26.04.2011 19:29, Paul пишет: That did it when it comes to my own call to: getContentResolver().openFileDescriptor(validUri, r); It is now calling openAssetFile() in my content provider. However, in the usage of the send functionality with the content://... uri: Intent share = new Intent(Intent.ACTION_SEND); share.setType(StylePad.DEFAULT_MIME_PNG); share.putExtra(Intent.EXTRA_STREAM, validUri); startActivity(Intent.createChooser(share, getString(R.string.activity_title_share))); I am now getting a IllegalArgumentException thrown, and my openFile/ openAssetFile never gets called (the Exception is hitting before it would get there I guess). Here is the Exception: 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): java.lang.IllegalArgumentException: column '_data' does not exist 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at android.database.AbstractCursor.getColumnIndexOrThrow(AbstractCursor.java: 314) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at android.database.CursorWrapper.getColumnIndexOrThrow(CursorWrapper.java: 99) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.UriImage.initFromContentUri(UriImage.java:160) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.UriImage.init(UriImage.java:90) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.MMSMessage.addImage(MMSMessage.java:1076) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.ConversationList.addMedia(ConversationList.java: 7095) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440): at com.android.mms.ui.ConversationList.addAttachment(ConversationList.java: 8370) 04-26 11:12:54.322: ERROR/AndroidRuntime(12440
[android-developers] Private Clipboard per Activity and/or App?
Hello List: Is it possible to define a private clipboard area per activity and/or application? I'm looking for a solution that is supported in 1.5+. Thanks, ..Paul.. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Problem setting file permissions when filename has a space
So just to clarify (as I have no access to the other app and what it calls, in this case the other app is the OS-standard 'share/send' functionality), I override the openFile() method in my app's content provider, and then when I trigger the 'share' functionality and pass it in the Uri to the file, the share functionality will then make a call to openFileDescriptor() which will call my overridden openFile()... correct? Anything special I need to do to trigger this workflow, other than the standard: Intent share = new Intent(Intent.ACTION_SEND); share.setType(getString(R.string.note_default_mime_png)); share.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(shareFileCopy)); startActivityForResult(Intent.createChooser(share, Share), ACTIVITY_SHARE); Thanks, Paul On Apr 23, 12:47 pm, Dianne Hackborn hack...@android.com wrote: No shell commands are part of the SDK. Using shell commands is likely to result in your app breaking randomly across devices and platform versions. The recommended way to do this is to write a content provider, which the other app can call ContentResolver.openFileDescriptor() etc. It is actually really easy to write such a content provider -- it doesn't need a database or anything, just to implement ContentProvider.openFile(). Every situation I have seen where MODE_WORLD_* is used it causes more troubles than just writing a content provider. I regret having made that. On Sat, Apr 23, 2011 at 8:43 AM, Paul pmmen...@gmail.com wrote: I have a question over at StackOverflow that's been sitting there for over a month, and wondered if maybe someone here (or a Googlite) could answer it. http://stackoverflow.com/questions/5149739/android-problem-setting-fi... I have an app where I store .png images in the app's cache directory, and as I am sharing these files via messaging, etc, I need to make the files readable temporarily by everyone (i.e. chmod 755). As suggested in another thread, I am running Runtime.getRuntime.exec() to do this: Runtime.getRuntime().exec(setperm chmod 755 /path/to/filename.png); This works fine, and as I am filtering / and \, any name works... except a name with a space, unsurpisingly. This fails: Runtime.getRuntime().exec(setperm chmod 755 /path/to/file name.png); So, coming from linux, I try wrapping the file path in quotes, which works on linux, but still fails to change the file perms on Android: Runtime.getRuntime().exec(setperm chmod 755 \/path/to/file name.png \); or Runtime.getRuntime().exec(setperm chmod 755 '/path/to/file name.png'); Any ideas? Thanks, Paul -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Re: Problem setting file permissions when filename has a space
Ah I see, thanks. A few notes in-line below: On Apr 25, 6:31 pm, Dianne Hackborn hack...@android.com wrote: On Mon, Apr 25, 2011 at 2:27 PM, Paul pmmen...@gmail.com wrote: So just to clarify (as I have no access to the other app and what it calls, in this case the other app is the OS-standard 'share/send' functionality), Share/send is not an app. It is a convention for applications to interact with each other, that is *designed* around the approach I suggest. I override the openFile() method in my app's content provider, and then when I trigger the 'share' functionality and pass it in the Uri to the file, the share functionality will then make a call to openFileDescriptor() which will call my overridden openFile()... correct? Yes. Anything special I need to do to trigger this workflow, other than the standard: No that is the standard way it works. Intent share = new Intent(Intent.ACTION_SEND); share.setType(getString(R.string.note_default_mime_png)); There is no reason for this string to come from a resource; it is not something that gets localized, it is just a constant. I am storing it in the XML as a way of storing the value... any other standard conventions that are recommended? Store this as a static constant in a static 'settings' class maybe? share.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(shareFileCopy)); startActivityForResult(Intent.createChooser(share, Share), ACTIVITY_SHARE); ACTION_SEND is not specified to return anything, so if you are getting any result at all you can't count on what you get back being useful. I'm not counting on it returning anything useful, just having the functionality indicate that it has finished is enough, I am then setting a boolean field to true when it does, so that I know I that the app has created a temporary copy of the file in the app's cache directory. On exiting the program, if the field is true, I then empty the cache directory. Obviously don't need to do this if I am no longer copying the file if/when I get the method you suggest using onFile() to work. On that front, I have overriden the onFile() method in my content provider, but it is not being triggered by the above code, any suggestions? @Override public ParcelFileDescriptor openFile(Uri uri, String mode) { Log.d(LOG_TAG, openFile() called); return null; } Paul -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Problem setting file permissions when filename has a space
On Apr 25, 8:55 pm, Dianne Hackborn hack...@android.com wrote: On Tue, Apr 26, 2011 at 12:46 AM, Paul pmmen...@gmail.com wrote: share.setType(getString(R.string.note_default_mime_png)); There is no reason for this string to come from a resource; it is not something that gets localized, it is just a constant. I am storing it in the XML as a way of storing the value... any other standard conventions that are recommended? Store this as a static constant in a static 'settings' class maybe? Just a static constant is fine. For example:http://developer.android.com/reference/android/provider/MediaStore.Au... Ok, thanks ACTION_SEND is not specified to return anything, so if you are getting any result at all you can't count on what you get back being useful. I'm not counting on it returning anything useful, just having the functionality indicate that it has finished is enough, I am then setting a boolean field to true when it does, so that I know I that the app has created a temporary copy of the file in the app's cache directory. On exiting the program, if the field is true, I then empty the cache directory. Obviously don't need to do this if I am no longer copying the file if/when I get the method you suggest using onFile() to work. This may not be a safe assumption. For example the send will often take a while, so an implementation may very likely exit once the send has been confirmed and execute the operation in a background service. Well if I can get the openFile override working, I won't need to use the cache directory and won't need this at all, so this shouldn't be an issue moving forward. On that front, I have overriden the onFile() method in my content provider, but it is not being triggered by the above code, any suggestions? @Override public ParcelFileDescriptor openFile(Uri uri, String mode) { Log.d(LOG_TAG, openFile() called); return null; } Have you published the content provider in your manifest and ensured you have set the authority correctly there in and the Intent's URI? Have you tried opening it yourself to see if it works? Is anything interested printed in the log? The content provider is published in my manifest: provider android:name=.provider.MyProvider android:authorities=package.name.here android:exported=true / I am using it for all DB activity in my app, so it's working... and have tried the following, and no errors are generated: getContentResolver().openFileDescriptor(Uri.fromFile(shareFile), r); But... this does not trigger a call to openFile(). As I've switched over to passing the SEND the path directly to my file in the app's file directory, versus the path to the one I was copying to my cache directoy, the Uri for this is now: /data/data/package.name/files/1.png I get a permissions error now (as expected), but again, no call to openFile(). -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Problem setting file permissions when filename has a space
Thanks - my implementation looks correct, so no idea why it's not being called. Tried tracing the call to getContentResolver().openFileDescriptor() and it seemed to be invoking openAssetFileDescriptor(), so intercepted openAssetFile() in my content provider, but it too isn't being called. On Apr 25, 10:36 pm, Dianne Hackborn hack...@android.com wrote: I don't know if it will help, but here is the source to the media provider which implements openFile: http://android.git.kernel.org/?p=platform/packages/providers/MediaPro... This allows for example sharing of pictures in Gallery to work. On Tue, Apr 26, 2011 at 2:04 AM, Paul pmmen...@gmail.com wrote: On Apr 25, 8:55 pm, Dianne Hackborn hack...@android.com wrote: On Tue, Apr 26, 2011 at 12:46 AM, Paul pmmen...@gmail.com wrote: share.setType(getString(R.string.note_default_mime_png)); There is no reason for this string to come from a resource; it is not something that gets localized, it is just a constant. I am storing it in the XML as a way of storing the value... any other standard conventions that are recommended? Store this as a static constant in a static 'settings' class maybe? Just a static constant is fine. For example: http://developer.android.com/reference/android/provider/MediaStore.Au... Ok, thanks ACTION_SEND is not specified to return anything, so if you are getting any result at all you can't count on what you get back being useful. I'm not counting on it returning anything useful, just having the functionality indicate that it has finished is enough, I am then setting a boolean field to true when it does, so that I know I that the app has created a temporary copy of the file in the app's cache directory. On exiting the program, if the field is true, I then empty the cache directory. Obviously don't need to do this if I am no longer copying the file if/when I get the method you suggest using onFile() to work. This may not be a safe assumption. For example the send will often take a while, so an implementation may very likely exit once the send has been confirmed and execute the operation in a background service. Well if I can get the openFile override working, I won't need to use the cache directory and won't need this at all, so this shouldn't be an issue moving forward. On that front, I have overriden the onFile() method in my content provider, but it is not being triggered by the above code, any suggestions? @Override public ParcelFileDescriptor openFile(Uri uri, String mode) { Log.d(LOG_TAG, openFile() called); return null; } Have you published the content provider in your manifest and ensured you have set the authority correctly there in and the Intent's URI? Have you tried opening it yourself to see if it works? Is anything interested printed in the log? The content provider is published in my manifest: provider android:name=.provider.MyProvider android:authorities=package.name.here android:exported=true / I am using it for all DB activity in my app, so it's working... and have tried the following, and no errors are generated: getContentResolver().openFileDescriptor(Uri.fromFile(shareFile), r); But... this does not trigger a call to openFile(). As I've switched over to passing the SEND the path directly to my file in the app's file directory, versus the path to the one I was copying to my cache directoy, the Uri for this is now: /data/data/package.name/files/1.png I get a permissions error now (as expected), but again, no call to openFile(). -- 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 -- 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
[android-developers] Re: How to install Sense UI into my HTC Magic
What you are asking for is custom firmware. It IS possible to have HTC Sense on your device (I had HTC Magic 32B before and it was running Sense). You should spend couple days making yourself familiar with rooting, flashing, changing bootloader or/and SPL. Good place to start is xda dev. forum. These guys rock. Firmware procedures will void your warranty so be careful. Honestly, this forum is a bad place to ask questions like that. Go to xda and read-read-read. Paul. On Apr 24, 12:41 am, Nicholas Key nicholaskeythole...@gmail.com wrote: Hi Android Dev group members, I've been searching high and low about installing Sense UI into my HTC Magic (the one that is loaded with Google ION) but couldn't find any relevant search results. This is the closest I could find:http://developer.htc.com/google-io-device.html There are several terms that I do not understand, namely - root, flash, wipe. My question would be, is it even remotely possible to install Sense UI into my HTC Magic (I got that Magic phone from Google IO conference). Nicholas -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 setting file permissions when filename has a space
I have a question over at StackOverflow that's been sitting there for over a month, and wondered if maybe someone here (or a Googlite) could answer it. http://stackoverflow.com/questions/5149739/android-problem-setting-file-permissions-when-filename-has-a-space I have an app where I store .png images in the app's cache directory, and as I am sharing these files via messaging, etc, I need to make the files readable temporarily by everyone (i.e. chmod 755). As suggested in another thread, I am running Runtime.getRuntime.exec() to do this: Runtime.getRuntime().exec(setperm chmod 755 /path/to/filename.png); This works fine, and as I am filtering / and \, any name works... except a name with a space, unsurpisingly. This fails: Runtime.getRuntime().exec(setperm chmod 755 /path/to/file name.png); So, coming from linux, I try wrapping the file path in quotes, which works on linux, but still fails to change the file perms on Android: Runtime.getRuntime().exec(setperm chmod 755 \/path/to/file name.png \); or Runtime.getRuntime().exec(setperm chmod 755 '/path/to/file name.png'); Any ideas? Thanks, Paul -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Ant and Android
$your_sdk_dir$/Android/platforms/android-8/ant On Apr 14, 6:58 am, luiX_ lui...@gmail.com wrote: please, can you provide a link? thx :D 2011/4/14 Paul Turchenko paul.turche...@gmail.com see sdk. They have all ant scripts implemented there. On Apr 12, 9:14 pm, Sam samira_hi...@hotmail.com wrote: Hi, I'm setting up an automated build system using Ant, for our Android project. As a starting point, I've simply exported the required build.xml through Eclipse. If I clean the project, and run ant in the command line at the root of the our Android project, I receive the following compile error: package R does not exist On the other hand, if I build the project through Eclipse, then the R.java is generated for me. How can I have my Ant build generate R.java for me? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Mouse events on table layout
Intercept onTouch event On Apr 21, 8:18 am, swetha akkina.swe...@gmail.com wrote: Hi, I am developing a sample application, in which I need to handle mouse events on table layout. Could you please let me know how to proceed further. Thanks in advance. Regards, Swetha -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: C2DM notification delivery is unpredictable
Update your radio firmware On Apr 20, 4:06 pm, JohnC fayv...@gmail.com wrote: I have been researching for a long while and getting nowhere. Many have asked along the lines of: What is the sanity behind the C2DM message delivery delay? The delay, as slows as 30 minutes, is always attributed to the first message, because once it's received then subsequent messages are delivered within seconds. I'm always using 2G/ 3G mode (never on WiFi) so I wouldn't expect the radio to go to sleep. Or, does it? Even after I open the browser to wake up the radio, I still wouldn't get the notification until 20 minutes later. So, the million dollar question is: Why is the first message taking so long to get delivered from my server to the phone? This delay issue seems to affect other apps too, like Chrome to Phone. I'm testing on the G2 HTC phone. Anyone with any insight is really appreciated. Thanks in advance! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Increment field Via Content Values?
I have an app that as the user opens 'things' from the ListView, I want to update their view count as they are opened. Currently doing this via raw SQL (...SET views = views + 1...), but would like to run this operation through my content provider's 'update' method, if possible. Does anyone now if it's possible to pass in increment values via the .update() method's ContentValues parameter without having to first run a query to find out the current (in my case, view) value? Thanks for any pointers, Paul -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Increment field Via Content Values?
Yeah, I had thought of creating a unique URi, as I am already handling a few different ones in my overridden update method. Thanks for the input! On Apr 16, 1:06 pm, Kostya Vasilyev kmans...@gmail.com wrote: ContentProviders are somewhat more abstract than SQL... You could have a special URI that means increment this item's view count, e.g.: authority/item/# - for operations on the entire item authority/item/#/viewcount - updating would increment the view count by one It might also be possible with a batch operation, but I haven't used those and can't say if there is support for an N+1 type backreference. 16.04.2011 20:59 пользователь Paul pmmen...@gmail.com написал: I have an app that as the user opens 'things' from the ListView, I want to update their view count as they are opened. Currently doing this via raw SQL (...SET views = views + 1...), but would like to run this operation through my content provider's 'update' method, if possible. Does anyone now if it's possible to pass in increment values via the .update() method's ContentValues parameter without having to first run a query to find out the current (in my case, view) value? Thanks for any pointers, Paul -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Unable to start a service from a Broadcast Receiver
Are you starting activity that starts the service? Your logcat shows that having activity thread. If it's not true, try sending pending intent to start a service. That might be a workaround, but that should get you moving. On Apr 12, 2:14 pm, Te-Yuan Huang huan...@gmail.com wrote: Hi all, I am trying to start a service when the system boots up (no activity involved). I have a BroadcastReceiver listening to the ACTION_BOOT_COMPLETE intent, then start a service inside the onReceive function. From the log, I can see the BroadcastReceiver received the intent properly. However, when it tries to start a service through context.startService(); The system complains cannot initiate the service: D/dalvikvm( 1393): newInstance failed: Lnet/startup/DispatchService; not accessible to Landroid/app/ActivityThread; D/AndroidRuntime( 1393): Shutting down VM W/dalvikvm( 1393): threadid=1: thread exiting with uncaught exception (group=0x4001d7e0) E/AndroidRuntime( 1393): FATAL EXCEPTION: main E/AndroidRuntime( 1393): java.lang.RuntimeException: Unable to instantiate service net.startup.DispatchService: java.lang.IllegalAccessException: access to class not allowed E/AndroidRuntime( 1393): at android.app.ActivityThread.handleCreateService(ActivityThread.java: 2943) I have been googling all night and this morning, but still couldn't understand where went wrong. Is there any other permission I should set, so that the BroadcastReceiver can start the service? Note: the BroadcastReceiver and the Service is under the same package. Great thanks for any help. -Te-Yuan -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 android application connect with the pc connected by usb
Use adb to do that On Apr 11, 10:12 pm, beeleo qf8@gmail.com wrote: I want to send message from my android applications to application on pc (like android as client, pc as server) , how can I connect the pc actively? the android doesn‘t know the pc's ip, isn't it? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] String to Float Performance Ideas
I've got a bit of code in an app that reads XML String input (from the SD Card), and creates Android Paths using this information. This requires converting String values to float values so they can be fed into the Path methods. For extremely large files, such as those containing several thousand entries, with each entry requiring potentially several dozen of these individual conversions, the process can really be expensive and I'd love to find a way to improve the performance, even incrementally. I've profiled this operation (it uses Float.valueOf(String)) and it is eating up a huge portion of the processing time, unsurprisingly. As I am stuck with the String XML source data, and have to get floats so I can create Paths, I am looking for any suggestions for alternatives to this expensive conversion. I have no experience with the NDK, but would it be worth investigating to see if a NDK-coded conversion routine would be more efficient, or is this the wrong tree to be barking up? Any suggestions welcome! Paul -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: String to Float Performance Ideas
The XML is the storage venue - Paths are drawn to the screen from the XML, and users can add new Paths (written back to the XML) or delete existing Paths (data is deleted from XML). On Apr 14, 12:11 pm, Marcin Orlowski webnet.andr...@gmail.com wrote: Any suggestions welcome! How often the source data changes? Do you reuse it later? If so and source data changes not too often, cache it (write down processed data for further reuse). If changes more frequently does it change totally or just is small portion? If the latter, process only what's new. And cache it again. 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] Re: String to Float Performance Ideas
Ah, I see, create a kind of mapping from String - float, and first check the mapping before performing the conversion? Here is what traceview is telling me for the calls to Float.valueOf(): java/lang/Float.valueOf (Ljava/lang/String;)Ljava/lang/Float; * self = 1.9% * java/lang/Float.parseFloat (Ljava/lang/String;)F = 94.3% ** self = 1.3% ** org/apache/harmony/luni/util/FloatingPointParser.parseFloat (Ljava/ lang/String;)F = 98.7% *** self = 6.5% *** org/a.../h.../luni/util/FloatingPointParser.initialParse (Ljava/ lang/String;I)Lorg/a.../h.../luni/util/FloatingPointParser $StringExponentPair = 58.7% self = 29.9% a bunch of StringBuilder calls ~= 60% *** java/lang/String.toLowerCase ()Ljava/lang/String = 26.8% * java/lang/Float.valueOf (F)Ljava/lang/Float; = 3.8% ** self = 48.4% ** java/lang/Float.init (F)V = 51.2% *** self = 69.7% *** java/lang/Number.init ()V = 30.3% Paul On Apr 14, 2:20 pm, Dianne Hackborn hack...@android.com wrote: I think this may be what Marcin was suggesting -- if the same float value tends to appear multiple times, then when you parse a new one put it into a cache. When you read strings, first see if the string is already in the cache to retrieve the previously parsed float value for it. Also can you get profiling data for where most of the time is spent inside of Float.parseFloat()? In at least the current code base, the bulk of the work for that is already done in native code. It would be interesting to know if most of your time is spent in that native function or the glue around it. It would also be useful to know what kind of CPU and what OS version you are testing this on. For example, the JIT in newer platforms may significantly improve performance here; CPUs that don't have hardware floating point support may have significantly worse performance. On Thu, Apr 14, 2011 at 9:17 AM, Paul pmmen...@gmail.com wrote: The XML is the storage venue - Paths are drawn to the screen from the XML, and users can add new Paths (written back to the XML) or delete existing Paths (data is deleted from XML). On Apr 14, 12:11 pm, Marcin Orlowski webnet.andr...@gmail.com wrote: Any suggestions welcome! How often the source data changes? Do you reuse it later? If so and source data changes not too often, cache it (write down processed data for further reuse). If changes more frequently does it change totally or just is small portion? If the latter, process only what's new. And cache it again. 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 -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: String to Float Performance Ideas
I think Diane clarified what you were suggesting Marcin, thanks for the input. Any suggestions as to the caching structure? I'd need something with inexpensive lookups, yet can grow as I add pairings to the cache. Thanks, Paul On Apr 14, 12:11 pm, Marcin Orlowski webnet.andr...@gmail.com wrote: Any suggestions welcome! How often the source data changes? Do you reuse it later? If so and source data changes not too often, cache it (write down processed data for further reuse). If changes more frequently does it change totally or just is small portion? If the latter, process only what's new. And cache it again. 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] Re: String to Float Performance Ideas
Well, here is what I am dealing with, The XML file is actually an XML- defines SVG file that represents a vector drawing. It is a requirement that the files remain in SVG, as the user will be loading and unloading these files on and off of the device, editing and viewing them with my app. So we are stuck with SVG/XML as the data source and destination (I have conversion performance issue on both sides of this equation, both from String - float coming in, and from float - String going back out). A mapping from String - float would be a really novel solution here, just trying to figure out now how to implement it. In answer to some of your other questions, no, I have to read the entire XML file in at 'load' time (as the user needs to see all of their drawing). I'm not sure about the need for a timestamp in this case, wouldn't any mappings created be, essentially, permanent? If I create a mapping in a volitile data structure that is created at run-time, I'll need to seed it somehow, either with entries as they are read, or create some 'smart' routine that does this work in the background. Just thinking out loud here, thanks for any input. On Apr 14, 3:14 pm, Marcin Orlowski webnet.andr...@gmail.com wrote: On 14 April 2011 20:43, Paul pmmen...@gmail.com wrote: Ah, I see, create a kind of mapping from String - float, and first check the mapping before performing the conversion? Try to go as simple as possible. The less logic the faster is would possibly go. How is your data modified? By just adding new entries in time? In portions? Can you separate each portion? Can you try to use timestamp to find out when previous conversion ended? Can you have more smaller files instead of one big? And finally? Can't you drop XML and have your sorce data in other format so you could drop the need of conversion completely? 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] Re: String to Float Performance Ideas
That was my thinking exactly - from the trace, a HUGE portion (~80%!) of the conversion time is spent on string operations that wouldn't seem to be needed. I couldn't find any link to a native routine via the traceview. On Apr 14, 3:26 pm, Kostya Vasilyev kmans...@gmail.com wrote: What do String.toLowerCase(String) and StringBuilder have to do with parsing a floating point number? -- Kostya 14.04.2011 22:43, Paul пишет: Ah, I see, create a kind of mapping from String - float, and first check the mapping before performing the conversion? Here is what traceview is telling me for the calls to Float.valueOf(): java/lang/Float.valueOf (Ljava/lang/String;)Ljava/lang/Float; * self = 1.9% * java/lang/Float.parseFloat (Ljava/lang/String;)F = 94.3% ** self = 1.3% ** org/apache/harmony/luni/util/FloatingPointParser.parseFloat (Ljava/ lang/String;)F = 98.7% *** self = 6.5% *** org/a.../h.../luni/util/FloatingPointParser.initialParse (Ljava/ lang/String;I)Lorg/a.../h.../luni/util/FloatingPointParser $StringExponentPair = 58.7% self = 29.9% a bunch of StringBuilder calls ~= 60% *** java/lang/String.toLowerCase ()Ljava/lang/String = 26.8% * java/lang/Float.valueOf (F)Ljava/lang/Float; = 3.8% ** self = 48.4% ** java/lang/Float.init (F)V = 51.2% *** self = 69.7% *** java/lang/Number.init ()V = 30.3% Paul On Apr 14, 2:20 pm, Dianne Hackbornhack...@android.com wrote: I think this may be what Marcin was suggesting -- if the same float value tends to appear multiple times, then when you parse a new one put it into a cache. When you read strings, first see if the string is already in the cache to retrieve the previously parsed float value for it. Also can you get profiling data for where most of the time is spent inside of Float.parseFloat()? In at least the current code base, the bulk of the work for that is already done in native code. It would be interesting to know if most of your time is spent in that native function or the glue around it. It would also be useful to know what kind of CPU and what OS version you are testing this on. For example, the JIT in newer platforms may significantly improve performance here; CPUs that don't have hardware floating point support may have significantly worse performance. On Thu, Apr 14, 2011 at 9:17 AM, Paulpmmen...@gmail.com wrote: The XML is the storage venue - Paths are drawn to the screen from the XML, and users can add new Paths (written back to the XML) or delete existing Paths (data is deleted from XML). On Apr 14, 12:11 pm, Marcin Orlowskiwebnet.andr...@gmail.com wrote: Any suggestions welcome! How often the source data changes? Do you reuse it later? If so and source data changes not too often, cache it (write down processed data for further reuse). If changes more frequently does it change totally or just is small portion? If the latter, process only what's new. And cache it again. Regards, Marcin Orlowski *Tray Agendahttp://bit.ly/trayagenda* - keep you daily schedule handy... *Date In Tray*http://bit.ly/dateintraypro - current date at glance... WebnetMobile on *Facebookhttp://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 -- 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. -- Kostya Vasilyev --http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: String to Float Performance Ideas
Sorry, should have mentioned this, this is 2.2 running on a Galaxy Tab. Based on Mark and Kostya's suggestions, I might just try to trim the source and see what I can come up with - might be easier than managing a mapping structure and will surely be lighter memory wise. Will post back here with results as I have them! Paul On Apr 14, 4:26 pm, Dianne Hackborn hack...@android.com wrote: What version of the platform are you running on? It looks like in the current source most of the function is written in native code, but there is no native code in your profiling. I don't work on Dalvik, so I don't know when the native impl appeared. If this is the original Harmony implementation, it is probably way over-engineered and inefficient. :) If your numbers are normally of the form x.yyy you could try writing your own parser that parses that form as efficiently as possible, and bail to the generic impl if it finds something it can't handle. You certainly should be able to write something that doesn't have a $#^%!! StringBuilder involved (good ghod!). On Thu, Apr 14, 2011 at 11:43 AM, Paul pmmen...@gmail.com wrote: Ah, I see, create a kind of mapping from String - float, and first check the mapping before performing the conversion? Here is what traceview is telling me for the calls to Float.valueOf(): java/lang/Float.valueOf (Ljava/lang/String;)Ljava/lang/Float; * self = 1.9% * java/lang/Float.parseFloat (Ljava/lang/String;)F = 94.3% ** self = 1.3% ** org/apache/harmony/luni/util/FloatingPointParser.parseFloat (Ljava/ lang/String;)F = 98.7% *** self = 6.5% *** org/a.../h.../luni/util/FloatingPointParser.initialParse (Ljava/ lang/String;I)Lorg/a.../h.../luni/util/FloatingPointParser $StringExponentPair = 58.7% self = 29.9% a bunch of StringBuilder calls ~= 60% *** java/lang/String.toLowerCase ()Ljava/lang/String = 26.8% * java/lang/Float.valueOf (F)Ljava/lang/Float; = 3.8% ** self = 48.4% ** java/lang/Float.init (F)V = 51.2% *** self = 69.7% *** java/lang/Number.init ()V = 30.3% Paul On Apr 14, 2:20 pm, Dianne Hackborn hack...@android.com wrote: I think this may be what Marcin was suggesting -- if the same float value tends to appear multiple times, then when you parse a new one put it into a cache. When you read strings, first see if the string is already in the cache to retrieve the previously parsed float value for it. Also can you get profiling data for where most of the time is spent inside of Float.parseFloat()? In at least the current code base, the bulk of the work for that is already done in native code. It would be interesting to know if most of your time is spent in that native function or the glue around it. It would also be useful to know what kind of CPU and what OS version you are testing this on. For example, the JIT in newer platforms may significantly improve performance here; CPUs that don't have hardware floating point support may have significantly worse performance. On Thu, Apr 14, 2011 at 9:17 AM, Paul pmmen...@gmail.com wrote: The XML is the storage venue - Paths are drawn to the screen from the XML, and users can add new Paths (written back to the XML) or delete existing Paths (data is deleted from XML). On Apr 14, 12:11 pm, Marcin Orlowski webnet.andr...@gmail.com wrote: Any suggestions welcome! How often the source data changes? Do you reuse it later? If so and source data changes not too often, cache it (write down processed data for further reuse). If changes more frequently does it change totally or just is small portion? If the latter, process only what's new. And cache it again. 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 -- 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
[android-developers] Re: String to Float Performance Ideas
OK, have stripped the FloatingPointParser bare, but can't run it as the native method, parseFltImpl() is throwing an UnsatisfiedLinkError... Maybe a silly question, but any ideas what to do from here? On Apr 14, 4:57 pm, Paul pmmen...@gmail.com wrote: Sorry, should have mentioned this, this is 2.2 running on a Galaxy Tab. Based on Mark and Kostya's suggestions, I might just try to trim the source and see what I can come up with - might be easier than managing a mapping structure and will surely be lighter memory wise. Will post back here with results as I have them! Paul On Apr 14, 4:26 pm, Dianne Hackborn hack...@android.com wrote: What version of the platform are you running on? It looks like in the current source most of the function is written in native code, but there is no native code in your profiling. I don't work on Dalvik, so I don't know when the native impl appeared. If this is the original Harmony implementation, it is probably way over-engineered and inefficient. :) If your numbers are normally of the form x.yyy you could try writing your own parser that parses that form as efficiently as possible, and bail to the generic impl if it finds something it can't handle. You certainly should be able to write something that doesn't have a $#^%!! StringBuilder involved (good ghod!). On Thu, Apr 14, 2011 at 11:43 AM, Paul pmmen...@gmail.com wrote: Ah, I see, create a kind of mapping from String - float, and first check the mapping before performing the conversion? Here is what traceview is telling me for the calls to Float.valueOf(): java/lang/Float.valueOf (Ljava/lang/String;)Ljava/lang/Float; * self = 1.9% * java/lang/Float.parseFloat (Ljava/lang/String;)F = 94.3% ** self = 1.3% ** org/apache/harmony/luni/util/FloatingPointParser.parseFloat (Ljava/ lang/String;)F = 98.7% *** self = 6.5% *** org/a.../h.../luni/util/FloatingPointParser.initialParse (Ljava/ lang/String;I)Lorg/a.../h.../luni/util/FloatingPointParser $StringExponentPair = 58.7% self = 29.9% a bunch of StringBuilder calls ~= 60% *** java/lang/String.toLowerCase ()Ljava/lang/String = 26.8% * java/lang/Float.valueOf (F)Ljava/lang/Float; = 3.8% ** self = 48.4% ** java/lang/Float.init (F)V = 51.2% *** self = 69.7% *** java/lang/Number.init ()V = 30.3% Paul On Apr 14, 2:20 pm, Dianne Hackborn hack...@android.com wrote: I think this may be what Marcin was suggesting -- if the same float value tends to appear multiple times, then when you parse a new one put it into a cache. When you read strings, first see if the string is already in the cache to retrieve the previously parsed float value for it. Also can you get profiling data for where most of the time is spent inside of Float.parseFloat()? In at least the current code base, the bulk of the work for that is already done in native code. It would be interesting to know if most of your time is spent in that native function or the glue around it. It would also be useful to know what kind of CPU and what OS version you are testing this on. For example, the JIT in newer platforms may significantly improve performance here; CPUs that don't have hardware floating point support may have significantly worse performance. On Thu, Apr 14, 2011 at 9:17 AM, Paul pmmen...@gmail.com wrote: The XML is the storage venue - Paths are drawn to the screen from the XML, and users can add new Paths (written back to the XML) or delete existing Paths (data is deleted from XML). On Apr 14, 12:11 pm, Marcin Orlowski webnet.andr...@gmail.com wrote: Any suggestions welcome! How often the source data changes? Do you reuse it later? If so and source data changes not too often, cache it (write down processed data for further reuse). If changes more frequently does it change totally or just is small portion? If the latter, process only what's new. And cache it again. 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 -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me
[android-developers] Re: String to Float Performance Ideas
I'd be interested to see how an SQLite implementation could work - you could define each SVG document in a table, and then each shape from that document in a second table, but where it would start to get complicated would be that each shape each shape type has unique properties. For instance, for the SVG Path shape, it can be made up of any number of instructions, along with other meta data. For the SVG Circle shape, there are no instructions, but different meta data fields. Essentially you'd need to have something like: Document (1toM) - Shapes (1to1) - (Path (1toM) - Instructions | Circle | Line | etc etc for all shapes) A simpler layout would be just: Document (1toM) - Shapes Where you store the raw XML that defines each shape in the Shapes table, but then you still need to parse that XML, leaving the same issue. Any suggestions? On Apr 14, 8:22 pm, lbendlin l...@bendlin.us wrote: Is a SQLite database not appropriate in such a scenario? You'd get the conversion for free... -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: MotionEvent.getEdgeFlags() never reports non-zero value
Hi Dianne. My app defines the individual swipes of the user on the drawing canvas as 'gestures', in that each has a start on finger down, an end on finger up, and is in progress in between those two events. When the user is drawing close to the edge of the screen, and touches it, the break in MotionEvents to the gesture detector results in the end of the gesture event being fired off and when their finger is brought back onto the screen, still in the continuous motion, this is registered as an onDown and a new, second stroke is started. So for example, if the user is drawing a stroke in an arc that is meant to go close to the edge but not touch it, but they touch it by accident, there will be two unique strokes that are discontinuous and would not represent the user's intent. If I can determine that I have an edge case while the gesture is in progress, I am thinking that I may be able to handle this case in a more intuitive or expected manor, for instance signaling my app to not register the second stroke. It's not the end of the world if this is 'the way it is', but was just going to try to play around and see what I could do with the edgeFlags to improve this behavior. Thanks, Paul On Mar 22, 5:06 pm, Dianne Hackborn hack...@android.com wrote: Why do you want this? It is used for some subtle event dispatching in the view hierarchy to better select target views when touching near the edge of the screen. I strongly recommend you not rely on it yourself. On Tue, Mar 22, 2011 at 5:59 AM, Paul pmmen...@gmail.com wrote: Looking over older posts, I found this: http://groups.google.com/group/android-developers/browse_thread/threa... So it's 2011 now, and I am using the emulator and a Galaxy Tab both running 2.2, and I can't for the life of me get the MotionEvent's passed from a simple full-screen drawing app to report a getEdgeFlags() value of anything other than 0. Anyone else have this issue, or a workaround for it? Thanks, Paul -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Re: MotionEvent.getEdgeFlags() never reports non-zero value
Thanks for the response. In this case, the View is full-screen, and is handling all MotionEvents the digitizer is sending. Just tested again and yes, the edgeflags are being reported, but only for the ACTION_DOWN as you mention (I had only really tested during ACTION_MOVE) - I guess I was counting on them being reported when they happen in ACTION_MOVE. Thanks so much for the clarification. My impetus for wanting to make use of the edge flags was to save the manual calcs, but that indeed should work and is what I'tt implement. Thanks, Paul On Apr 6, 1:47 pm, Dianne Hackborn hack...@android.com wrote: The edge flags won't tell you this happened, they are just set when the down event is at the edge of the screen. You can do the same thing yourself just by looking at the coordinates of the event and seeing if it is at your edge. I don't think there is any information coming from the touch driver to help you determine what you want. Note that once a down happens, the platform continues to deliver movement events to your view until an up occurs, even if those events go out of your view or even off the visible area of the screen but still seen by the digitizer. You will see these as coordinates extending outside of your view. The point where you get the up event is whenever as far as everyone is concerned that finger is actually no longer touching the screen. On Wed, Apr 6, 2011 at 9:41 AM, Paul pmmen...@gmail.com wrote: Hi Dianne. My app defines the individual swipes of the user on the drawing canvas as 'gestures', in that each has a start on finger down, an end on finger up, and is in progress in between those two events. When the user is drawing close to the edge of the screen, and touches it, the break in MotionEvents to the gesture detector results in the end of the gesture event being fired off and when their finger is brought back onto the screen, still in the continuous motion, this is registered as an onDown and a new, second stroke is started. So for example, if the user is drawing a stroke in an arc that is meant to go close to the edge but not touch it, but they touch it by accident, there will be two unique strokes that are discontinuous and would not represent the user's intent. If I can determine that I have an edge case while the gesture is in progress, I am thinking that I may be able to handle this case in a more intuitive or expected manor, for instance signaling my app to not register the second stroke. It's not the end of the world if this is 'the way it is', but was just going to try to play around and see what I could do with the edgeFlags to improve this behavior. Thanks, Paul On Mar 22, 5:06 pm, Dianne Hackborn hack...@android.com wrote: Why do you want this? It is used for some subtle event dispatching in the view hierarchy to better select target views when touching near the edge of the screen. I strongly recommend you not rely on it yourself. On Tue, Mar 22, 2011 at 5:59 AM, Paul pmmen...@gmail.com wrote: Looking over older posts, I found this: http://groups.google.com/group/android-developers/browse_thread/threa. .. So it's 2011 now, and I am using the emulator and a Galaxy Tab both running 2.2, and I can't for the life of me get the MotionEvent's passed from a simple full-screen drawing app to report a getEdgeFlags() value of anything other than 0. Anyone else have this issue, or a workaround for it? Thanks, Paul -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 -- 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
[android-developers] Re: Media Scanner failing on
That got it, thanks! On Apr 4, 4:00 pm, Robin Talwar r.o.b.i.n.abhis...@gmail.com wrote: http://stackoverflow.com/questions/5250515/how-to-update-the-android-... the link says about media scanning so you can relate to your problem also, its almost the same On Sun, Apr 3, 2011 at 9:56 AM, Chinmay S cvs...@gmail.com wrote: Hi Paul, As you suspect, the gallery depends on the mediascanner to update the list of files. The samsung MyFiles app will rescan/refresh the contents of a directory every time you re-open the app. To force a mediascanner update on a directory, you might want to use * scanFile*. http://developer.android.com/reference/android/media/MediaScannerConn... public static void *scanFile* (Context *context*, String[] *paths*, String[] *mimeTypes*, MediaScannerConnection.OnScanCompletedListener *callback*) Alternately u can use a broadcast intent for the same purpose: http://developer.android.com/reference/android/content/Intent.html#AC... Also note that by default, internal data of any app is considered private, and mediascanner won't scan the app's private directory for media files: http://developer.android.com/guide/topics/data/data-storage.html#file... regards CVS -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Media Scanner failing on
I posted this over on StackOverflow weeks ago, but not even a nibble - hoping someone here has seen this or has any suggestions. http://stackoverflow.com/questions/5207221/android-problem-with-media-scanner-not-running I have an app that user's can draw with, and then 'export' that drawing as a .png file to external storage, if present. Generating the PNG, copying the file to external all work like a charm, but a rather unique problem happens; after the export, if the user navigates to the image via My files (Samsung Tab running 2.2 in this case), they can see the .png file, but when they open it, the screen is black for about 10 seconds... then they see the image, Additionally, the images don't show up in the user's 'Gallery' app either. Now, if the user connects the device to the computer via USB, or reboots the device, they can access the images no problem from My files, and they appear in 'Gallery' from that point forward, but again, any newly esported files experience the same problems until they cycle/connect the device again. My thinking was that this had to be related to the Media Scanner (at least in the case of the 'Gallery' problem, it most certainly is). So, as I am targetting Api 8+, I am trying to use the static MediaScannerConnection.scanFile() method to have the OS re-scan and add my images into the Gallery, etc. Also hoping this solves the issue of the strange delay in opening the images. Looking at LogCat, I have this related to the MediaScanner: DEBUG/MediaScannerService(2567): IMediaScannerService.scanFile: /mnt/ sdcard/MyApp mimeType: null DEBUG/MediaScannerService(2567): onStartCommand : intent - Intent { cmp=com.android.providers.media/.MediaScannerService (has extras) } DEBUG/MediaScannerService(2567): onStartCommand : flags [0], startId [1] DEBUG/MediaScannerService(2567): ServiceHandler:handleMessage volume[null], filePath[/mnt/sdcard/MyApp] DEBUG/MediaProvider(2567): getSdSerial() sd state = removed INFO/Database(2567): sqlite returned: error code = 17, msg = prepared statement aborts at 43: [SELECT DISTINCT sd_serial FROM images WHERE sd_serial LIKE 'external_0x%'] ERROR/MediaProvider(2567): removeMediaDBData called DEBUG/MediaScanner(2567): prescan enter: path - /mnt/sdcard/MyApp DEBUG/MediaScanner(2567): prescan return So, it looks like the MediaScanner is getting the correct location, but is failing to find the SD card, which is correct, and failing. The Samsung Tab has built-in non-SD external storage, which Android gives access to via Environment.getExternalStorageDirectory(). How do I tell it to scan the non-SD storage? Note that I also get this exact error on the emulator, and manually invoking the media scanner from the Dev Tools solves the issues of the exported images being properly recognized. Any ideas how to proceed? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Can the WebView contains another view?
Nope. On Mar 31, 3:13 am, ydm jordanmiladi...@gmail.com wrote: Hello, all! Is there a way to add another view inside a WebView? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Removing/Blocking keys from virtual keyboard possible?
I have an EditText that allows the user to enter a filename, and I am restricting certain characters being used, such as / \ ?, etc. Currently, I allow the user to enter anything they want, then before committing the filename, run it through a regexp checking for invalid characters. If any are found, the EditText remains active, and the user is shown a Toast with a message about using only valid characters, and a list of invalid characters. Since I know ahead of time which characters I will accept, a better solution would be to simply remove or disable them on the virtual keyboard (an continue to do a final regexp in case the characters were generated from an external keyboard). I've searched, but can't find anything specific to removing/disabling specific virtual keyboard characters. Is this possible? I found this post on StackOverflow that metions using one of a TextWatcher or InputFilter, but those seem to largely operate AFTER input, rather than preventing it in the first place, which is really what I am after. Thanks for any pointers, or a quick 'not possible' if that is the case. Paul -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: HID iCLASS
I was hoping to hear something by now, but since nothing, I'll clarify. HID iClass card transmits a public UID over 13.56MHz using the ISO 15693 standard. All I want to do is read that public UID from an HID iClass. Since I can read the UID of an ISO 15693 it stands to reason that I should be able to read the UID from an HID iClass, but so far I have had no luck. Is this something that the Nexus S is unable to do, or is it a situation where I just have to position the HID iClass card correctly to be able to read it? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] MotionEvent.getEdgeFlags() never reports non-zero value
Looking over older posts, I found this: http://groups.google.com/group/android-developers/browse_thread/thread/a55db4c49b12248d So it's 2011 now, and I am using the emulator and a Galaxy Tab both running 2.2, and I can't for the life of me get the MotionEvent's passed from a simple full-screen drawing app to report a getEdgeFlags() value of anything other than 0. Anyone else have this issue, or a workaround for it? Thanks, Paul -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: BubbleTextView.java from launcher package
getScrollX() and getScrollY() methods should work for you (they have other methods to access mLeft, mRight, etc.) On Mar 22, 11:13 am, argongold argongol...@gmail.com wrote: Hi, I want to format my text for shortcuts as done in launcher application. I've tried to copy BubbleTextView.java class directly to my sdk project. but following parameters couldn't resolved mLeft,mRight,mTop,mBottom and I could find in launcher package where these parameters are initialized Beside this mScrollX also not found. Below link says I should be able to compile this class under sdk . but how?http://stackoverflow.com/questions/4649597/android-format-textview Is any body faced such issue previously and resolved? regards, argon -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 activities in one window
On Mar 3, 1:05 pm, David Caunt dca...@gmail.com wrote: Hi Mika, In my case the GiffGaffAPN app actually doesn't seem to have added an APN successfully, though other users report success in reviews. I'm running a HTC Desire with a Sense ROM (rooted) so perhaps it requires a stock Google-experience or AOSP. I'd be interested to know what you find. Unless you have a giffgaff SIM in the phone it won't show the APN entries or let you select them. There's no hacking required, give yourself the APN permissions then manipulate the db at Uri.parse(content://telephony/carriers) with a ContentResolver. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 auto answer call programmatically
Hi, I was working on something similar for the last few days. You may find happiness there, thanks to aidl : http://code.google.com/p/auto-answer/source/browse/trunk/src/com/everysoft/autoanswer/AutoAnswerIntentService.java and more in the android doc : http://developer.android.com/guide/developing/tools/aidl.html Best Regards, On 14 mar, 11:14, zameer zameer...@gmail.com wrote: I am working on app that will auto answer the call programatically, but the API for this is not working in Android2.3, by some initial investigation came to know that it was removed due to some security issue.. but it is allowed if we can do modification in Phone application of android, but I want to achieve it through my app only.. so just want to know that if its allowing through bulit in then why its not allowing from my app ?? and want to know what are the measures that it will take that perticular API call is from built in or third party APP... and please let me know if there is any alternative to achieve this form third party application. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 auto answer call programmatically
Hi, I've been working for a few days on something similar. Most forums said it was impossible, however I managed to find my happiness in google codes. You should take a look at this example, with aidl interfaces : http://code.google.com/p/auto-answer/source/browse/trunk/src/com/everysoft/autoanswer/AutoAnswerIntentService.java And the dev doc on aidl : http://developer.android.com/guide/developing/tools/aidl.html This should solve your problems. Best regards, Achess. On 15 mar, 10:51, Gergely Juhász jg.sv...@gmail.com wrote: What API did you used than previously worked? On 14 March 2011 11:14, zameer zameer...@gmail.com wrote: I am working on app that will auto answer the call programatically, but the API for this is not working in Android2.3, by some initial investigation came to know that it was removed due to some security issue.. but it is allowed if we can do modification in Phone application of android, but I want to achieve it through my app only.. so just want to know that if its allowing through bulit in then why its not allowing from my app ?? and want to know what are the measures that it will take that perticular API call is from built in or third party APP... and please let me know if there is any alternative to achieve this form third party application. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: ANN: Mock Objects on Android with Borachio
On 15 Mar 2011, at 02:15, A. Elk wrote: Good work. I have a couple of comments: Glad you like it :-) If you have POJOs in your code, you can test them with JUnit using a standard mocking framework of your choice. The only limitations on mocking are imposed by the Android system. That's true, of course. In our particular case, however, all of our non-Android-specific code is C++, so we have no Java code that doesn't talk to Android APIs. Our C++ code has extensive fully-automated unit and functional tests. We've found achieving the same level of test coverage for our Java code to be *extremely* difficult. Hopefully the techniques outlined on my blog will remedy that somewhat. Without getting into too much detail, most of the objects in the Android API can't be mocked. This is known. It's not meant to be test- hostile, and it's not accidental. I always think that to get anything useful in a finite amount of time, one has to make tradeoffs. That's clearly true, and I'm sure that the Android developers weren't deliberately trying to make Android test-hostile. Even if it *feels* like it sometimes :-) I think the key thing is that you've produced something useful for Android developers. I hope so! I'd be very interested to hear your, and others, feedback if/when you've had a chance to play with Borachio. It's still very young and I'm sure that there is much that could be improved. -- paul.butcher-msgCount++ Snetterton, Castle Combe, Cadwell Park... Who says I have a one track mind? http://www.paulbutcher.com/ LinkedIn: http://www.linkedin.com/in/paulbutcher MSN: p...@paulbutcher.com AIM: paulrabutcher Skype: paulrabutcher -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Can't communicate with NfcB tag
Sweet! I found me a real live Android bug! Do I win a hat? :) I'm a little out of my element here, and was hoping to be able to work from code in an existing application, but in light of this, it looks like that will not be possible. Can you tell me, will communicating through IsoDep still allow me to retrieve data like the track2 data from credit cards, assuming I know the protocols to use? -- Paul Christensen On Fri, Mar 11, 2011 at 6:04 PM, Nick Pelly n...@android.com wrote: Sorry for the late reply, We have looked into this, and it is indeed a bug. On 2.3.3, NfcA.connect() and NfcB.connect() fail if the tag also enumerates IsoDep. The good news is that most of the time IsoDep.connect() is what you want :) We will address this issue in a future release. It's a little tricky since we need to actually reconnect to the tag to drop back to NfcA/NfcB from IsoDep. Thanks for bringing this to our attention, Nick On Mon, Mar 7, 2011 at 10:14 AM, Paul Christensen p.ellischristen...@gmail.com wrote: Thanks. I appreciate you looking in to this. To verify, yes, I am only trying to connect to one tech at a time. I am not connecting to IsoDep, and then attempting to connect to NfcB/NfcA. I only know about IsoDep working because after failing to connect to NfcB, I swapped out my objects and attempted to connect to the same cards using IsoDep, which was successful. -- Paul Christensen On Mon, Mar 7, 2011 at 11:04 AM, Nick Pelly n...@android.com wrote: I'll try and reproduce. But I just want to make sure, are you only connecting NfcB / NfcA, and never connecting IsoDep first? Because you can only connect one tech at a time. Nick On Mon, Mar 7, 2011 at 7:57 AM, Paul Christensen p.ellischristen...@gmail.com wrote: Ok, for #1 I'll just keep trying the card and see if I can manage to talk to it. For the additional issues, the sequence of events and relevant code is as follows: I scan a card with my app set to receive the scans. The appropriate Activity opens, retrieves a Tag object, and executes an AsyncTask. The AsyncTask determines the card technology and based on the card technology, attempts to open a connection to that card as follows: private static NfcB getNfcBTag(Tag tag) throws Exception { NfcB myTag = NfcB.get(tag); try { if(!myTag.isConnected()) { myTag.connect(); } } catch(Exception e) { Log.e(TAG, e.getMessage()); } return myTag; } The above method throws an exception on myTag.connect(). The exception is a java.IOException, but the message and source are both null, so I have no idea why it's happening. Now, if I change this method to be IsoDep instead of NfcB (or NfcA, for that matter), I am able to successfully connect to the card, send a message to the card, and retrieve a response from that card. -- Paul Christensen On Sun, Mar 6, 2011 at 10:06 PM, Nick Pelly n...@android.com wrote: Hi Paul, For (1), it is very hard to discover NfcB credit card on the Nexus S. Many NfcB credit cards only work well with high powered readers. That said, if you play with the credit card orientation against the back of the Nexus S (where the NFC antenna is) you should be able to eventually scan it. For (2), (3) and (4), can you provide some sample code, and tell us exactly where it is failing. Nick On Fri, Mar 4, 2011 at 10:30 AM, Paul Christensen p.ellischristen...@gmail.com wrote: Ok, so I've learned additional, somewhat less than encouraging things. 1. I have a Discover Zip card, no idea what the ISO technology is, all I do know is the Nexus S does not respond at all to this card. 2. I have a Visa NfcB card that will connect as IsoDep, but not as NfcB. 3. I have an Amex NfcB card that will connect as IsoDep, but not as NfcB. 4. I have a MasterCard NfcA card that will connect as IsoDep, but not as NfcA. Any thoughts would be greatly appreciated. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Can't communicate with NfcB tag
A mailing list for this would be awesome for me. I'm in a similar situation to yours, and figuring out how to talk to these cards is going to be quite the adventure, to say the least. -- Paul Christensen On Fri, Mar 11, 2011 at 10:25 PM, Brill Pappin br...@pappin.ca wrote: laugh! I just got a client wanting to talk to PayPass, which I'm now going to have to figure out how to do. I bet 90% of the people in this forum working on NFC are trying to connect to PayPass! We should set up our own mailing list ;) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Can't communicate with NfcB tag
Any information you can share would be very much appreciated, and I'm more than happy to do the same. The potential for these things is very cool, and based on what I've been working with for the last couple of months, there are alternatives, but not many good ones, so I'm very excited about the Android possibilities. On a side note, you're going to love the Nexus S. I got one for myself as soon as I was able, and the phone is awesome. -- Paul Christensen On Mon, Mar 14, 2011 at 9:47 AM, Brill Pappin br...@pappin.ca wrote: indeed! It's actually kind of worrying me :) I do have external support in the industry for this one, I'm just not sure how much. I think a lot will depend on how easily we can implement the security features built into the hardware; that is going to be a pain. I'm actually going to take a few weeks to ramp up (we don't even had Nexus S phones up here in Canada yet, but should by beginning of April) but I'd be perfectly willing to share the how so we can both keep our clients happy :) I'll ping you again when I get down to the nitty-gritty. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Can't communicate with NfcB tag
Very helpful. Thank you. -- Paul Christensen On Mon, Mar 14, 2011 at 11:22 AM, Michael Roland mi.rol...@gmail.comwrote: Hallo, seems as if my previous message never arrived in this thread... Can you tell me, will communicating through IsoDep still allow me to retrieve data like the track2 data from credit cards, assuming I know the protocols to use? Current PayPass cards are EMV-compliant. Therefore, you will want to use IsoDep and not NFcA/NfcB. The EMV protocol is based on APDUs (smartcard commands according to ISO/IEC 7816-4) IsoDep (although the name would suggest the Data Exchange Protocol according to ISO/IEC 18092) provides APDU-based access to the contactless smartcard (i.e. access on top of ISO/IEC 14443-4 protocol). NfcB (and NfcA) provide access to contactless cards that do not support ISO/IEC 14443-4 (i.e. cards that use proprietary protocols according to ISO/IEC 14443-3). br, Michael -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] HID iCLASS
Can anyone tell me, does the nexus s support reading HID iCLASS cards? I have not been able to scan them, but I don't know if this is due to the antenna, or that they're simply not supported. 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: Can't communicate with NfcB tag
Based on what I'm seeing, I tend to agree. It's looking like I should be able to accomplish most what I'm after without too much trouble. -- Paul Christensen On Mon, Mar 14, 2011 at 2:53 PM, Nick Pelly n...@android.com wrote: Hi Paul, My understanding is that those types of transactions always happen at the ISO14443-4 (ISO-DEP) layer, or more accurately ISO7817-4 (APDU) which is built on top of ISO-DEP. It's a really crappy bug, but should not get in the way of any real use-cases. Nick On Mon, Mar 14, 2011 at 8:12 AM, Paul Christensen p.ellischristen...@gmail.com wrote: Sweet! I found me a real live Android bug! Do I win a hat? :) I'm a little out of my element here, and was hoping to be able to work from code in an existing application, but in light of this, it looks like that will not be possible. Can you tell me, will communicating through IsoDep still allow me to retrieve data like the track2 data from credit cards, assuming I know the protocols to use? -- Paul Christensen On Fri, Mar 11, 2011 at 6:04 PM, Nick Pelly n...@android.com wrote: Sorry for the late reply, We have looked into this, and it is indeed a bug. On 2.3.3, NfcA.connect() and NfcB.connect() fail if the tag also enumerates IsoDep. The good news is that most of the time IsoDep.connect() is what you want :) We will address this issue in a future release. It's a little tricky since we need to actually reconnect to the tag to drop back to NfcA/NfcB from IsoDep. Thanks for bringing this to our attention, Nick On Mon, Mar 7, 2011 at 10:14 AM, Paul Christensen p.ellischristen...@gmail.com wrote: Thanks. I appreciate you looking in to this. To verify, yes, I am only trying to connect to one tech at a time. I am not connecting to IsoDep, and then attempting to connect to NfcB/NfcA. I only know about IsoDep working because after failing to connect to NfcB, I swapped out my objects and attempted to connect to the same cards using IsoDep, which was successful. -- Paul Christensen On Mon, Mar 7, 2011 at 11:04 AM, Nick Pelly n...@android.com wrote: I'll try and reproduce. But I just want to make sure, are you only connecting NfcB / NfcA, and never connecting IsoDep first? Because you can only connect one tech at a time. Nick On Mon, Mar 7, 2011 at 7:57 AM, Paul Christensen p.ellischristen...@gmail.com wrote: Ok, for #1 I'll just keep trying the card and see if I can manage to talk to it. For the additional issues, the sequence of events and relevant code is as follows: I scan a card with my app set to receive the scans. The appropriate Activity opens, retrieves a Tag object, and executes an AsyncTask. The AsyncTask determines the card technology and based on the card technology, attempts to open a connection to that card as follows: private static NfcB getNfcBTag(Tag tag) throws Exception { NfcB myTag = NfcB.get(tag); try { if(!myTag.isConnected()) { myTag.connect(); } } catch(Exception e) { Log.e(TAG, e.getMessage()); } return myTag; } The above method throws an exception on myTag.connect(). The exception is a java.IOException, but the message and source are both null, so I have no idea why it's happening. Now, if I change this method to be IsoDep instead of NfcB (or NfcA, for that matter), I am able to successfully connect to the card, send a message to the card, and retrieve a response from that card. -- Paul Christensen On Sun, Mar 6, 2011 at 10:06 PM, Nick Pelly n...@android.com wrote: Hi Paul, For (1), it is very hard to discover NfcB credit card on the Nexus S. Many NfcB credit cards only work well with high powered readers. That said, if you play with the credit card orientation against the back of the Nexus S (where the NFC antenna is) you should be able to eventually scan it. For (2), (3) and (4), can you provide some sample code, and tell us exactly where it is failing. Nick On Fri, Mar 4, 2011 at 10:30 AM, Paul Christensen p.ellischristen...@gmail.com wrote: Ok, so I've learned additional, somewhat less than encouraging things. 1. I have a Discover Zip card, no idea what the ISO technology is, all I do know is the Nexus S does not respond at all to this card. 2. I have a Visa NfcB card that will connect as IsoDep, but not as NfcB. 3. I have an Amex NfcB card that will connect as IsoDep, but not as NfcB. 4. I have a MasterCard NfcA card that will connect as IsoDep, but not as NfcA. Any thoughts would be greatly appreciated. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers
Re: [android-developers] Re: Can't communicate with NfcB tag
Ok, for #1 I'll just keep trying the card and see if I can manage to talk to it. For the additional issues, the sequence of events and relevant code is as follows: I scan a card with my app set to receive the scans. The appropriate Activity opens, retrieves a Tag object, and executes an AsyncTask. The AsyncTask determines the card technology and based on the card technology, attempts to open a connection to that card as follows: private static NfcB getNfcBTag(Tag tag) throws Exception { NfcB myTag = NfcB.get(tag); try { if(!myTag.isConnected()) { myTag.connect(); } } catch(Exception e) { Log.e(TAG, e.getMessage()); } return myTag; } The above method throws an exception on myTag.connect(). The exception is a java.IOException, but the message and source are both null, so I have no idea why it's happening. Now, if I change this method to be IsoDep instead of NfcB (or NfcA, for that matter), I am able to successfully connect to the card, send a message to the card, and retrieve a response from that card. -- Paul Christensen On Sun, Mar 6, 2011 at 10:06 PM, Nick Pelly n...@android.com wrote: Hi Paul, For (1), it is very hard to discover NfcB credit card on the Nexus S. Many NfcB credit cards only work well with high powered readers. That said, if you play with the credit card orientation against the back of the Nexus S (where the NFC antenna is) you should be able to eventually scan it. For (2), (3) and (4), can you provide some sample code, and tell us exactly where it is failing. Nick On Fri, Mar 4, 2011 at 10:30 AM, Paul Christensen p.ellischristen...@gmail.com wrote: Ok, so I've learned additional, somewhat less than encouraging things. 1. I have a Discover Zip card, no idea what the ISO technology is, all I do know is the Nexus S does not respond at all to this card. 2. I have a Visa NfcB card that will connect as IsoDep, but not as NfcB. 3. I have an Amex NfcB card that will connect as IsoDep, but not as NfcB. 4. I have a MasterCard NfcA card that will connect as IsoDep, but not as NfcA. Any thoughts would be greatly appreciated. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Can't communicate with NfcB tag
Thanks. I appreciate you looking in to this. To verify, yes, I am only trying to connect to one tech at a time. I am not connecting to IsoDep, and then attempting to connect to NfcB/NfcA. I only know about IsoDep working because after failing to connect to NfcB, I swapped out my objects and attempted to connect to the same cards using IsoDep, which was successful. -- Paul Christensen On Mon, Mar 7, 2011 at 11:04 AM, Nick Pelly n...@android.com wrote: I'll try and reproduce. But I just want to make sure, are you only connecting NfcB / NfcA, and never connecting IsoDep first? Because you can only connect one tech at a time. Nick On Mon, Mar 7, 2011 at 7:57 AM, Paul Christensen p.ellischristen...@gmail.com wrote: Ok, for #1 I'll just keep trying the card and see if I can manage to talk to it. For the additional issues, the sequence of events and relevant code is as follows: I scan a card with my app set to receive the scans. The appropriate Activity opens, retrieves a Tag object, and executes an AsyncTask. The AsyncTask determines the card technology and based on the card technology, attempts to open a connection to that card as follows: private static NfcB getNfcBTag(Tag tag) throws Exception { NfcB myTag = NfcB.get(tag); try { if(!myTag.isConnected()) { myTag.connect(); } } catch(Exception e) { Log.e(TAG, e.getMessage()); } return myTag; } The above method throws an exception on myTag.connect(). The exception is a java.IOException, but the message and source are both null, so I have no idea why it's happening. Now, if I change this method to be IsoDep instead of NfcB (or NfcA, for that matter), I am able to successfully connect to the card, send a message to the card, and retrieve a response from that card. -- Paul Christensen On Sun, Mar 6, 2011 at 10:06 PM, Nick Pelly n...@android.com wrote: Hi Paul, For (1), it is very hard to discover NfcB credit card on the Nexus S. Many NfcB credit cards only work well with high powered readers. That said, if you play with the credit card orientation against the back of the Nexus S (where the NFC antenna is) you should be able to eventually scan it. For (2), (3) and (4), can you provide some sample code, and tell us exactly where it is failing. Nick On Fri, Mar 4, 2011 at 10:30 AM, Paul Christensen p.ellischristen...@gmail.com wrote: Ok, so I've learned additional, somewhat less than encouraging things. 1. I have a Discover Zip card, no idea what the ISO technology is, all I do know is the Nexus S does not respond at all to this card. 2. I have a Visa NfcB card that will connect as IsoDep, but not as NfcB. 3. I have an Amex NfcB card that will connect as IsoDep, but not as NfcB. 4. I have a MasterCard NfcA card that will connect as IsoDep, but not as NfcA. Any thoughts would be greatly appreciated. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 we set the Nexus S Tag Id?
I am experimenting with an NFC tag reader, and I've found that when I have NFC turned on on my Nexus S, the tag reader is able to read my phone. The problem is that when the reader reads my phone it is detecting a 4 byte Id that changes on each read. I'm investigating the possibility of an application for my organization that requires that the Id be static. What exactly is going on here with the Id that's being read from my phone, and is it possible to make that Id static, or even set it to a specified value? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Can we set the Nexus S Tag Id?
Thanks. -- Paul Christensen On Mon, Mar 7, 2011 at 1:04 PM, Nick Pelly n...@android.com wrote: On Mon, Mar 7, 2011 at 10:23 AM, Paul Christensen p.ellischristen...@gmail.com wrote: I am experimenting with an NFC tag reader, and I've found that when I have NFC turned on on my Nexus S, the tag reader is able to read my phone. The problem is that when the reader reads my phone it is detecting a 4 byte Id that changes on each read. I'm investigating the possibility of an application for my organization that requires that the Id be static. What exactly is going on here with the Id that's being read from my phone, and is it possible to make that Id static, or even set it to a specified value? That ID is randomly generated by the NFC Controller. There is no SDK API to make it static, or to set it. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Can't communicate with NfcB tag
Ok, so I've learned additional, somewhat less than encouraging things. 1. I have a Discover Zip card, no idea what the ISO technology is, all I do know is the Nexus S does not respond at all to this card. 2. I have a Visa NfcB card that will connect as IsoDep, but not as NfcB. 3. I have an Amex NfcB card that will connect as IsoDep, but not as NfcB. 4. I have a MasterCard NfcA card that will connect as IsoDep, but not as NfcA. Any thoughts would be greatly appreciated. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Can't communicate with NfcB tag
I'm hoping someone can give me an idea of what's going wrong here. I am trying to read an NfcB tag, but when I call NfcB.connect(tag) I'm getting an IOException with a message of null. When the card is scanned, I'm retrieving the Tag object. Once I determine that I'm working with an NfcB tag, I do the following: NfcB myTag = NfcB.getTag(tag); if(!myTag.isConnected()) { myTag.connect(); } The myTag.connect() is throwing the exception. I'm stumped. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Can't communicate with NfcB tag
I guess I should add that I am using API Level 10, and my Nexus S is at 2.3.3. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Can't communicate with NfcB tag
good thought, but that's not it. I can actually connect as an IsoDep tag on this card, but I need to access it as IsoB. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Can't communicate with NfcB tag
it's a PayPass MasterCard. Pretty old one, at that, so I'm hoping it has a damaged chip or something. I'm going to try to read some of the newer samples we have in the office tomorrow, hopefully with better results. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Notepad Sample App and Screen Rotation
Question about the lifecycle of the Notepad example app... it appears that when a user is 'inserting' a new note, they've typed in some text and then they rotate the screen, the orientation change causes onCreate to be fired off again, inserting a second note into the database. This can be repeated any number of times by simply changing the orientation while still in this initial 'insert' state. Any suggestions/best practices on how an Activity that has multiple states can deal with screen rotation? My thought was to store the Uri of the note in the savedInstance Bundle, then check it in onCreate... is this typically how this would/could be handled? Thanks, Paul -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Changing the sort order for Live Folders
Basing my Live Folder implementation on the Notepad example, I am wondering where the default sort order for the live folders is getting set. In my content provider, the query method is being fed name ASC as the value for sortOrder... I can intercept it in the Content Provider and change it fine, but I'd like to change this BEFORE it gets to the provider, so that I can use the sort order set by the user and stored in a SharedPreference. Any idea where the live folder query is implemented and where the default name ASC sort order is coming from? Thanks, Paul -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] Set Options Menu Position Programmatically?
I have a full screen Activity in my app that due ot the nature of the way the user interacts with it, is locked to the portrait orientation. This of course means that the Options Menu, when activated, is always in the same location, regardless of orientation. A perfect solution would be the Activity's views, etc remain locked, but the options menu rotates as needed, but not sure this is possible. One possible solution involves listening to the orientation sensor and then programatically moving the options menu to the 'bottom', but I don't think that is possible... can anyone confirm? Any other suggestions? Thanks forany info, Paul -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: App with usb connectivity
Bumping this message, as I too would be very interested in this... On Feb 13, 10:16 am, neohacker arunscari...@gmail.com wrote: Hi all, I'm in the middle of an android app that need to check whether the device is connected to another system or pendrive through usb and if it is connected i need to send a copy of my database file through usb port. This sis for backing up my database. I have no idea how to prompt for usb connections. I searched the net. But no results!.Can anyone please help. Because i'm stuck here at my project. 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] AlphabetIndexer Letter 'Toast' Question
I have created a DateIndexer class that mimics the AlphabetIndexer class, except I can pass it an ArrayList of unique dates, and it will generate the section prompts to a ListView when implemented. I'd be happy to share this code once I have it finished... which brings me to this question: The prompts being generated, February 14th, February 12th, etc as you scroll down the ListView, are shown properly, but the box that surrounds the date is still the same size as that used by the AlphabetIndexer, in that it is square and only large enough to contain a single letter, not the full date. The end result is the date is shown, but it spills way beyondthe edges fo this fixed box. There is no code in AlphabetIndexer (and thus my DateIndexer) that directly generates these toast-like prompts, and looking at the SectionIndexer class that AlphabetIndexer implements, there is nothing there either (that is just an abstract class). Can anyone point me at where the Toast is being generated? I've tried tracing it, but no luck so far. 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: AlphabetIndexer Letter 'Toast' Question
Gah... it's a hardcoded value, and as you said, is instantiated directly from AbsListView so I can't extend it and have it used by the ListView... looks like a dead-end. Any suggestions on getting around this, or is my DateIndexer dead in the water? Thanks for any insight, Paul On Feb 14, 1:16 pm, Kostya Vasilyev kmans...@gmail.com wrote: Paul, Looks like the index popup is drawn here: http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;... Now sure how useful this is, since this is a class that's directly instantiated by AbsListView here: http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;... -- Kostya 14.02.2011 21:05, Paul пишет: I have created a DateIndexer class that mimics the AlphabetIndexer class, except I can pass it an ArrayList of unique dates, and it will generate the section prompts to a ListView when implemented. I'd be happy to share this code once I have it finished... which brings me to this question: The prompts being generated, February 14th, February 12th, etc as you scroll down the ListView, are shown properly, but the box that surrounds the date is still the same size as that used by the AlphabetIndexer, in that it is square and only large enough to contain a single letter, not the full date. The end result is the date is shown, but it spills way beyondthe edges fo this fixed box. There is no code in AlphabetIndexer (and thus my DateIndexer) that directly generates these toast-like prompts, and looking at the SectionIndexer class that AlphabetIndexer implements, there is nothing there either (that is just an abstract class). Can anyone point me at where the Toast is being generated? I've tried tracing it, but no luck so far. Thanks. -- Kostya Vasilyev --http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: AlphabetIndexer Letter 'Toast' Question
Looks like there might be a solution here, disabling the FastScroller then rolling your own: http://stackoverflow.com/questions/3531398/resize-fastscroll-alert-dialog So much work for such a simple feature... On Feb 14, 1:30 pm, Paul pmmen...@gmail.com wrote: Gah... it's a hardcoded value, and as you said, is instantiated directly from AbsListView so I can't extend it and have it used by the ListView... looks like a dead-end. Any suggestions on getting around this, or is my DateIndexer dead in the water? Thanks for any insight, Paul On Feb 14, 1:16 pm, Kostya Vasilyev kmans...@gmail.com wrote: Paul, Looks like the index popup is drawn here: http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;... Now sure how useful this is, since this is a class that's directly instantiated by AbsListView here: http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;... -- Kostya 14.02.2011 21:05, Paul пишет: I have created a DateIndexer class that mimics the AlphabetIndexer class, except I can pass it an ArrayList of unique dates, and it will generate the section prompts to a ListView when implemented. I'd be happy to share this code once I have it finished... which brings me to this question: The prompts being generated, February 14th, February 12th, etc as you scroll down the ListView, are shown properly, but the box that surrounds the date is still the same size as that used by the AlphabetIndexer, in that it is square and only large enough to contain a single letter, not the full date. The end result is the date is shown, but it spills way beyondthe edges fo this fixed box. There is no code in AlphabetIndexer (and thus my DateIndexer) that directly generates these toast-like prompts, and looking at the SectionIndexer class that AlphabetIndexer implements, there is nothing there either (that is just an abstract class). Can anyone point me at where the Toast is being generated? I've tried tracing it, but no luck so far. Thanks. -- Kostya Vasilyev --http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Properly Attaching Bitmap to Canvas
I have a drawing app I'd like to have the ability to: 1) in onDraw, display a 'thumbnail' view of the current screen to to user (thumbnail will be in bottom corner, so the user can see where they are if they zoom in) 2) save the Screen to the SD card as an image file. So I am trying to figure out how to set up my View properly such that I can access the Bitmap that the onDraw is drawing too as I need it from anywhere (I will need to save the Bitmap when the calling Activity is being shutdown, etc). I have two fields in my custom View class, mCanvas, mBitmap. In onSizeChanged(), when the View is expanded, I instatiate the objects like so: mCanvas = new Canvas(); mBitmap = Bitmap.createBitmap(getWidth(), getHeight(), Bitmap.Config.ARGB_); mCanvas.setBitmap(mBitmap); draw(mCanvas); My understanding is that calling draw(mCanvas) sets the canvas to use in subsequent onDraw() calls so that all drawing in onDraw will be sent via mCanvas to mBitmap. Is this correct? I ask because I have been trying to tackle #1 above, and when I get a scaled version of the bitmap in onDraw when I try to draw the thumbnail, the scaled version is not showing the elements that are being added to the canvas. For instance, if I draw lines to the canvas, via onDraw, I see those on the screen. If I draw more lines, those show up. If I then zoom in and at the time of zooming, scale the bitmap, it is blank. Here is how I am scaling the bitmap, thumbnailRectF is a rectangle that I draw to the screen prior to this call, using it as a border for the thumbnail: Bitmap out = Bitmap.createScaledBitmap(mBitmap, 100, 100, false); canvas.drawBitmap(out, null, thumbnailRectF, thumbCanvasPaint); Am I doing something obviously incorrect in how I am attaching the View's built-in canvas to my mBitmap? Can anyone suggest a better way to do this? Thanks, Paul -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: In app billing...
I'm not really crazy about the whole In App Billing thing. I'm selling a paid app pretty successfully (so I guess kind of biased). Now here comes in App billing, so everybody and their brother can offer a free version of anything, then get people to buy up or unlock features through In App Billing. I wasn't really a fan of the lite/pro versions of apps either. I guess I'm too old school. I just want to offer my customers a good price for an app and give them everything I can for that price. I'm sure I'll have to wise up soon to stay competitive though. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Trouble Adding Arc to Path
I am trying to add an arc to a path, but nthing gets drawn with each call. I have ensured that the passed RectF oval is dimensioned properly, and calls to Path.addOval(oval, Path.Direction.CW) work perfectly, but calls to either of Path.addArc(oval, 0, 180) and Path.arcTo(oval, 0, 180) fail (nothing gets drawn). Any suggestions on what I might be 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
[android-developers] Re: Trouble Adding Arc to Path
Also, have tested this in both the emulator for Froyo, as well as on Froyo hardware and the arcs are not being displayed. Looked through the source for arcTo, which calls a native function in Path.cpp, and there doesn't appear to be a reason the above input would fail, given that the Path.cpp can draw the exact same oval using addOval(). Paul On Feb 3, 10:19 am, Paul pmmen...@gmail.com wrote: I am trying to add an arc to a path, but nthing gets drawn with each call. I have ensured that the passed RectF oval is dimensioned properly, and calls to Path.addOval(oval, Path.Direction.CW) work perfectly, but calls to either of Path.addArc(oval, 0, 180) and Path.arcTo(oval, 0, 180) fail (nothing gets drawn). Any suggestions on what I might be 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
[android-developers] D
I have an app that allows the user to scale in for a closer view of a custom View using the ScaleGestureDetector. What I would like to do is show the user a thumbnail of the larger screen when they are zoomed in. I'd like to show the thumbnail anchored to the bottom left corner of the visible area of the View, such that as the user scales in, the thumbnail stays visible and in the same location. My problem is that while I am able to determine when I should be showing the thumbnail in my View's onDraw() method, and while I can scale the thumbnail as well so that it remains the same size, I can't figure out how to anchor the shape I wish to draw (a translucent Rect) in the visible corner. No problem drawing it to the canvas using absolute coordinates, but as soon as I scale in, it stays at the absolute coordinates of course. I do track the current scaling factor as well as the scaling center (x,y), so I could likely do some calculations relating to the known window size, and these values to determine the corner, but just wondering if there are any routines or better ways to handle this. Thanks for any info, Paul -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Trouble Adding Arc to Path
Tried, no difference... On Feb 3, 11:21 am, Kostya Vasilyev kmans...@gmail.com wrote: Paul, Perhaps you could try path.arcTo(oval, 0, 180, *true*); ? 03.02.2011 19:03, Paul ?: Also, have tested this in both the emulator for Froyo, as well as on Froyo hardware and the arcs are not being displayed. Looked through the source for arcTo, which calls a native function in Path.cpp, and there doesn't appear to be a reason the above input would fail, given that the Path.cpp can draw the exact same oval using addOval(). Paul On Feb 3, 10:19 am, Paulpmmen...@gmail.com wrote: I am trying to add an arc to a path, but nthing gets drawn with each call. I have ensured that the passed RectF oval is dimensioned properly, and calls to Path.addOval(oval, Path.Direction.CW) work perfectly, but calls to either of Path.addArc(oval, 0, 180) and Path.arcTo(oval, 0, 180) fail (nothing gets drawn). Any suggestions on what I might be doing wrong? Thanks! -- Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Trouble Adding Arc to Path
I've tried a bunch of different combinations... here is what I have in onDraw, just trying to get this working: Path androidPath = new Path(); Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); paint.setStyle(Paint.Style.STROKE); paint.setColor(Color.BLACK); paint.setStrokeWidth(3); androidPath.moveTo(0, 0); androidPath.arcTo(new RectF(10, 10, 110, 110), 0, 360, true); canvas.drawPath(androidPath, paint); Nothing is shown. On Feb 3, 11:49 am, Kostya Vasilyev kmans...@gmail.com wrote: How about making the arc the only item in the path, and also trying different ops: fill vs. stroke? 03.02.2011 19:41, Paul пишет: Tried, no difference... On Feb 3, 11:21 am, Kostya Vasilyevkmans...@gmail.com wrote: Paul, Perhaps you could try path.arcTo(oval, 0, 180, *true*); ? 03.02.2011 19:03, Paul ?: Also, have tested this in both the emulator for Froyo, as well as on Froyo hardware and the arcs are not being displayed. Looked through the source for arcTo, which calls a native function in Path.cpp, and there doesn't appear to be a reason the above input would fail, given that the Path.cpp can draw the exact same oval using addOval(). Paul On Feb 3, 10:19 am, Paulpmmen...@gmail.com wrote: I am trying to add an arc to a path, but nthing gets drawn with each call. I have ensured that the passed RectF oval is dimensioned properly, and calls to Path.addOval(oval, Path.Direction.CW) work perfectly, but calls to either of Path.addArc(oval, 0, 180) and Path.arcTo(oval, 0, 180) fail (nothing gets drawn). Any suggestions on what I might be doing wrong? Thanks! -- Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com -- Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Trouble Adding Arc to Path
The following draws the quadratic curve, no problems... very strange! Path androidPath = new Path(); Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); paint.setStyle(Paint.Style.STROKE); paint.setColor(Color.BLACK); paint.setStrokeWidth(3); androidPath.moveTo(0, 0); //androidPath.arcTo(new RectF(10, 10, 110, 110), 0, 360, true); androidPath.quadTo(150, 100, 200, 200); canvas.drawPath(androidPath, paint); I've tried changing the constructor flags from the Paint (by removing the Paint.ANTI_ALIAS_FLAG), changing the stroke width, changing the paint style... On Feb 3, 3:40 pm, Paul pmmen...@gmail.com wrote: I've tried a bunch of different combinations... here is what I have in onDraw, just trying to get this working: Path androidPath = new Path(); Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); paint.setStyle(Paint.Style.STROKE); paint.setColor(Color.BLACK); paint.setStrokeWidth(3); androidPath.moveTo(0, 0); androidPath.arcTo(new RectF(10, 10, 110, 110), 0, 360, true); canvas.drawPath(androidPath, paint); Nothing is shown. On Feb 3, 11:49 am, Kostya Vasilyev kmans...@gmail.com wrote: How about making the arc the only item in the path, and also trying different ops: fill vs. stroke? 03.02.2011 19:41, Paul пишет: Tried, no difference... On Feb 3, 11:21 am, Kostya Vasilyevkmans...@gmail.com wrote: Paul, Perhaps you could try path.arcTo(oval, 0, 180, *true*); ? 03.02.2011 19:03, Paul ?: Also, have tested this in both the emulator for Froyo, as well as on Froyo hardware and the arcs are not being displayed. Looked through the source for arcTo, which calls a native function in Path.cpp, and there doesn't appear to be a reason the above input would fail, given that the Path.cpp can draw the exact same oval using addOval(). Paul On Feb 3, 10:19 am, Paulpmmen...@gmail.com wrote: I am trying to add an arc to a path, but nthing gets drawn with each call. I have ensured that the passed RectF oval is dimensioned properly, and calls to Path.addOval(oval, Path.Direction.CW) work perfectly, but calls to either of Path.addArc(oval, 0, 180) and Path.arcTo(oval, 0, 180) fail (nothing gets drawn). Any suggestions on what I might be doing wrong? Thanks! -- Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com -- Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Trouble Adding Arc to Path
Yes, that got it... mode 360 is 0 and a sweep of 0 means nothing is drawn... Thanks! On Feb 3, 4:03 pm, Kostya Vasilyev kmans...@gmail.com wrote: Paul, Tried it out (Motorola Milestone). The following works: // - Path androidPath = new Path(); Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); paint.setStyle(Paint.Style.STROKE); paint.setColor(Color.RED); paint.setStrokeWidth(5); androidPath.moveTo(0, 0); androidPath.lineTo(110, 110); androidPath.arcTo(new RectF(10, 10, 210, 210), 0, 180); canvas.drawPath(androidPath, paint); // - The following does not draw the oval, but does draw the line segment to its first point: androidPath.arcTo(new RectF(10, 10, 210, 210), 0, 360); This makes sense, since the docs do say that the sweep angle is treated modulo 360 - but it only says that for one of the three arc-related methods: http://developer.android.com/reference/android/graphics/Path.html#arc..., float, float, boolean) Looks like a documentation bug to me. This works too and I really can't tell the difference compared to a full 360: androidPath.arcTo(new RectF(10, 10, 210, 210), 15, 359.9f); Just for kicks, being short by one tenth of a degree produces a positioning error of 0,0017 pixels for each radius pixel. -- Kostya 03.02.2011 23:40, Paul пишет: I've tried a bunch of different combinations... here is what I have in onDraw, just trying to get this working: Path androidPath = new Path(); Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); paint.setStyle(Paint.Style.STROKE); paint.setColor(Color.BLACK); paint.setStrokeWidth(3); androidPath.moveTo(0, 0); androidPath.arcTo(new RectF(10, 10, 110, 110), 0, 360, true); canvas.drawPath(androidPath, paint); Nothing is shown. On Feb 3, 11:49 am, Kostya Vasilyevkmans...@gmail.com wrote: How about making the arc the only item in the path, and also trying different ops: fill vs. stroke? 03.02.2011 19:41, Paul пишет: Tried, no difference... On Feb 3, 11:21 am, Kostya Vasilyevkmans...@gmail.com wrote: Paul, Perhaps you could try path.arcTo(oval, 0, 180, *true*); ? 03.02.2011 19:03, Paul ?: Also, have tested this in both the emulator for Froyo, as well as on Froyo hardware and the arcs are not being displayed. Looked through the source for arcTo, which calls a native function in Path.cpp, and there doesn't appear to be a reason the above input would fail, given that the Path.cpp can draw the exact same oval using addOval(). Paul On Feb 3, 10:19 am, Paulpmmen...@gmail.com wrote: I am trying to add an arc to a path, but nthing gets drawn with each call. I have ensured that the passed RectF oval is dimensioned properly, and calls to Path.addOval(oval, Path.Direction.CW) work perfectly, but calls to either of Path.addArc(oval, 0, 180) and Path.arcTo(oval, 0, 180) fail (nothing gets drawn). Any suggestions on what I might be doing wrong? Thanks! -- Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com -- Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com -- Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: TextView - how to make appended text visible?
You might also be able to scroll the text by restricting the ellipsize the text by setting properties of the TextView to: android:maxLines=1 android:scrollHorizontally=true I do this with an EditText and it works perfectly. Paul On Jan 28, 7:54 pm, John Lussmyer johnlussm...@gmail.com wrote: I wrapped the TextView in a ScrollView (even though TextView is documented as handling it's own scrolling and doesn't need a ScrollView). This let me call the fullScroll( View.FOCUS_DOWN) method in the ScrollView to make the newest text visible. On Fri, Jan 28, 2011 at 11:35 AM, Tobiah t...@tobiah.org wrote: On 01/28/2011 09:50 AM, John Lussmyer wrote: I have a TextView that frequently has text appended from a service. I can append the text just fine, but how do I make the TextView scroll so the newly appended text is visible? Once the view fills, the new text is below the bottom edge. I haven't used it for Android, but usually there is a Scrollable container that lets you put things into it that are larger than the screen. There must be such a widget... check the methods. I imagine that you can set the scroll position programmatically. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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: Strange orange background color when custom 9 patch button is pressed...
It looks like Android is still using the default color state list for the button. I've never used a state list for a button, but maybe capturing the android:state_selected state might help? Paul On Jan 28, 6:01 pm, Jarrette jarrette.sch...@gmail.com wrote: *thanks for the reply, doug. Here's the code, I'm having the same issue with every button in the listview.* * * *main_menu.xml* ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/android; android:orientation=vertical style=@style/body ImageView android:layout_width=fill_parent android:layout_height=wrap_content android:scaleType=center android:src=@drawable/logo_small / ListView android:id=@+id/ListView_Menu android:layout_width=fill_parent android:layout_height=fill_parent android:contentDescription=Main Menu android:scrollbarAlwaysDrawVerticalTrack=true android:divider=# / /LinearLayout * * *menu_item.xml* TextView xmlns:android=http://schemas.android.com/apk/res/android; android:textColor=@color/btn_blue_text android:textSize=14px android:layout_width=fill_parent android:layout_height=wrap_content android:paddingTop=5px android:paddingBottom=5px android:text=test string android:layout_gravity=center_horizontal android:gravity=center android:background=@drawable/btn_blue / *this is the method that populates the listview* public void PopulateGrid(final String strPersonID) { ListView menuList = (ListView) findViewById(R.id.ListView_Menu); String[] items = {getResources().getString(R.string.menu_Vitals_My), getResources().getString(R.string.menu_Vital_Add), getResources().getString(R.string.menu_Resources), getResources().getString(R.string.menu_Log_Out)}; ArrayAdapterString adapt = new ArrayAdapterString(this, R.layout.menu_item, items); menuList.setAdapter(adapt); menuList.setOnItemClickListener(new AdapterView.OnItemClickListener() { public void onItemClick(AdapterView? parent, View itemClicked, int position, long id) { TextView textView = (TextView) itemClicked; String strText = textView.getText().toString(); if (strText.equalsIgnoreCase(getResources().getString(R.string.menu_Vitals_My))) { // MY VITALS Intent myIntent = new Intent(MainMenuActivity.this, VitalsMyActivity.class); myIntent.putExtra(PersonID, strPersonID); startActivityForResult(myIntent, 0); } else if (strText.equalsIgnoreCase(getResources().getString(R.string.menu_Vital_Add))) { // ADD VITAL startActivity(new Intent(MainMenuActivity.this, VitalAddActivity.class)); } else if (strText.equalsIgnoreCase(getResources().getString(R.string.menu_Resources))) { // RESOURCES startActivity(new Intent(MainMenuActivity.this, ResourcesActivity.class)); } else if (strText.equalsIgnoreCase(getResources().getString(R.string.menu_Support))) { // SUPPORT startActivity(new Intent(MainMenuActivity.this, SupportActivity.class)); }else if (strText.equalsIgnoreCase(getResources().getString(R.string.menu_Log_Out))) { // LOG OUT //delete user info SharedPreferences prefs = getSharedPreferences(UserInfo,0); SharedPreferences.Editor prefsEditor = prefs.edit(); prefsEditor.remove(PersonID); prefsEditor.commit(); startActivity(new Intent(MainMenuActivity.this, MainActivity.class)); } } }); } -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to add a text file as part of the apk
Store and access it from /res/raw should work, I have a text file in that folder for an app of mine and no problem with the app accessing that file after installation to devices. Paul On Jan 28, 7:51 am, Marcin Orlowski webnet.andr...@gmail.com wrote: On 28 January 2011 11:34, Kumar Bibek coomar@gmail.com wrote: You canot write/change the txt file if you put it in the assets. So, on first run of app, make a copy to SD card or the data directory, and then, you can proceed. I was writting mine in a hurry so I now see my post looks bit misleading. I meant using assets to have .txt file in APK for distribution or reading but write require copying it first as you cleared. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en