Re: [android-developers] To Unlock it not to Unlock
Well thanks for that. I'm trying to avoid breaking Android Pay. Does an unlocked bootloader make Pay's checks fail. If so, does relocking fix it. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. To post to this group, send email to android-developers@googlegroups.com. Visit this group at https://groups.google.com/group/android-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/android-developers/80359085-45dd-4a88-9468-9c23a3c7b344%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [android-developers] To Unlock it not to Unlock
Well thanks for that. I'm trying to avoid breaking Android Pay. Does an unlocked bootloader make Pay's checks fail. If so, does relocking fix it. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. To post to this group, send email to android-developers@googlegroups.com. Visit this group at https://groups.google.com/group/android-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/android-developers/e719306f-5354-43ee-8dcf-0380de5f927c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[android-developers] To Unlock it not to Unlock
Is it necessary to unlock the bootloader, on my Nexus 6p, in order to manually flash the latest Android OS? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. To post to this group, send email to android-developers@googlegroups.com. Visit this group at https://groups.google.com/group/android-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/android-developers/358a78f0-b883-4aac-8909-74859e8e1307%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[android-developers] To Unlock or not to Unlock
Is it necessary to unlock the bootloader in order to manually update to the latest Android OS. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. To post to this group, send email to android-developers@googlegroups.com. Visit this group at https://groups.google.com/group/android-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/android-developers/91f45cb8-50f2-4ddc-819b-36a2cdbbf2e5%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[android-developers] (beginner question) variables reset when I change device orientation?
I am new to Android development. I am experimenting with making a simple app that displays a number that increases by one when the Up button is pressed and decreases by one when the Down button is pressed. It works correctly, except when I rotate the device from landscape to portrait or vice versa, the number is reset to 0. Here is the code: package com.example.jz.counter; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.TextView; public class MainActivity extends Activity implements View.OnClickListener { private int counter = 0; private TextView OutputViewObject; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); OutputViewObject = (TextView)findViewById(R.id.outputView); OutputViewObject.setText("" + counter); final Button buttonUp = (Button)findViewById(R.id.up_button); final Button buttonDown = (Button)findViewById(R.id.down_button); buttonUp.setOnClickListener(this); buttonDown.setOnClickListener(this); } @Override public void onClick(View view) { switch (view.getId()) { case R.id.up_button: counter++; OutputViewObject.setText("" + counter); break; case R.id.down_button: counter--; OutputViewObject.setText("" + counter); break; } } } -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. To post to this group, send email to android-developers@googlegroups.com. Visit this group at https://groups.google.com/group/android-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/android-developers/b3914417-fcc4-4e3d-99d2-e7f92a939c40%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[android-developers] Placing files and folders inside Assets or resolving the path from within the code?
I created Assets folder by right click App > New > Folder > Assets Folder. I also created a working webpage in another editor which created index.html along with css folder with index.css and js folder with index.js and subfolders for both for some css and js libraries. I wish to bring those over to Android Studio so that I can load the index.html in a webView. What is the correct way to do it? Here is the absolute path of both index.html and MainActivity.java files from my Mac: /Users/fred/Documents/a/mobileWebApps/r/index.htm /Users/fred/Documents/App1wv/app/src/main/java/com/example/fred/app1wv/MainActivity.java Thanks MainActivity.java public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); WebView wv = (WebView)findViewById(R.id.main_WV); wv.setWebViewClient(new WebViewClient()); WebSettings ws = wv.getSettings(); ws.setJavaScriptEnabled(true); ws.setAllowFileAccess(true); String text = null; String path = "file:///android_asset/"; try { text = convertStreamToString(this.getAssets().open("index.html")); } catch (Exception e) { e.printStackTrace(); } wv.loadDataWithBaseURL(path, text, "text/html", "utf-8", null); } public static String convertStreamToString(InputStream is) throws Exception{ BufferedReader reader = new BufferedReader(new InputStreamReader(is)); StringBuilder sb = new StringBuilder(); String line; while ((line = reader.readLine()) != null) { sb.append(line).append("\n"); } reader.close(); return sb.toString(); } -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. To post to this group, send email to android-developers@googlegroups.com. Visit this group at https://groups.google.com/group/android-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/android-developers/5c653eed-1a5c-4298-91f0-626bfdfdba6c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[android-developers] Special Accommodations for Non-Profits?
Hi all, I have not been able to find much documentation online so I figured I'd turn to the forum. Does anyone know about any special cases that are in places for Apps built by and for non-profits? Does the 70/30 transaction fee still apply? Thanks, Jesse -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: More on Fragment inflation
I know its been a long time, but do you still have that working example? I'm getting this same problem and can't figure out how to make it go away... On Monday, April 4, 2011 2:21:08 PM UTC-7, G. Blake Meike wrote: > > I believe I now have mostly working code. I've posted it here: > > http://callmeike.net/blake/android/contact-viewer-acp-fixed.tgz > > It turns out that you don't have to sacrifice static layout in order > to avoid using statically laid out fragments. The fix -- at least it > seems to be working -- is to replace the fragment elements with > FrameLayout elements. That's all there is to it. > > I still think it is some kind of gottcha, that layout fragments are > such different beasts than programmatically created fragments. My > take-away is that one should never mix them. Until I get information > to the contrary, in fact, I'm just never going to put a fragment in a > layout. > > -blake -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Web App
Sorry if this is a rehash, but I cannot find a previous post on this topic. I have a website that I want to open exclusively with my app. I would like to redirect all other traffic to Google Play, inviting them to purchase the app. Can this be done, or am I completely missing something? I don't want to detect mobile devices, I need the website linked to my app, regardless of device type, or dpi. Thank you. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Question about android ICS touchscreen framework change.
Hi all, Back in android2.3 there is such code in InputReader.cpp: MultiTouchInputMapper::sync(): if (inPointer.absMTPressure <= 0) { // Some devices send sync packets with X / Y but with a 0 pressure to indicate // a pointer going up. Drop this finger. continue; } and if (inPointer.absMTTouchMajor <= 0) { // Some devices send sync packets with X / Y but with a 0 touch major to indicate // a pointer going up. Drop this finger. continue; } so that means when you move your finger away from the screen,driver send up a ABS_MT_TOUCH_MAJOR with absMTTouchMajor==0, this point is dropped,through MultiTouchInputMapper::sync()>TouchInputMapper::syncTouch>calculatePointerIds(): currentPointerCount == 0 and mCurrentTouch.idBits.clear(); then in dispatchTouches() currentIdBits <> lastIdBits and interpreted as a UP movement. BUT Android4.0 seems don't consider this ,in InputReader.cpp: when driver send up ABS_MT_TOUCH_MAJOR: MultiTouchMotionAccumulator::process(); case ABS_MT_TOUCH_MAJOR: slot->mInUse = true; slot->mAbsMTTouchMajor = rawEvent->value; break; mInUse is set to true no matter if rawEvent->value equals 0,and this point is not dropped,in MultiTouchInputMapper::syncTouch(): if (!inSlot->isInUse()) { continue; } and mCurrentRawPointerData.markIdBit(id, isHovering); called. Then in dispatchTouches(),because currentIdBits == lastIdBits,this action is interpreted as a MOVE action,not UP! Where am I wrong? Plz help,thanks in advance! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Question about android 4.0 touchscreen framework change.
Hi all, Back in android2.3 there is such code in InputReader.cpp: MultiTouchInputMapper::sync(): if (inPointer.absMTPressure <= 0) { // Some devices send sync packets with X / Y but with a 0 pressure to indicate // a pointer going up. Drop this finger. continue; } and if (inPointer.absMTTouchMajor <= 0) { // Some devices send sync packets with X / Y but with a 0 touch major to indicate // a pointer going up. Drop this finger. continue; } so that means when you move your finger away from the screen,driver send up a ABS_MT_TOUCH_MAJOR with absMTTouchMajor==0, this point is dropped,through MultiTouchInputMapper::sync()>TouchInputMapper::syncTouch>calculatePointerIds(): currentPointerCount == 0 and mCurrentTouch.idBits.clear(); then in dispatchTouches() currentIdBits <> lastIdBits and interpreted as a UP movement. BUT Android4.0 seems don't consider this ,in InputReader.cpp: when driver send up ABS_MT_TOUCH_MAJOR: MultiTouchMotionAccumulator::process(); case ABS_MT_TOUCH_MAJOR: slot->mInUse = true; slot->mAbsMTTouchMajor = rawEvent->value; break; mInUse is set to true no matter if rawEvent->value equals 0,and this point is not dropped,in MultiTouchInputMapper::syncTouch(): if (!inSlot->isInUse()) { continue; } and mCurrentRawPointerData.markIdBit(id, isHovering); called. Then in dispatchTouches(),because currentIdBits == lastIdBits,this action is interpreted as a MOVE action,not UP! Where am I wrong? Plz help,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: Android and OSGi/Apache Felix
I have looked at that, but the EZDroid community hasn't been updated since 2009 and there is practically no content on their site. This makes me think it is completely abandoned. They do link to some code which was presented at a conference a few years back: https://opensource.luminis.net/wiki/display/SITE/Apache+Felix+on+Androids The code is extremely basic though and it doesn't address any of my concerns. In their example projects, they create all views through code. They don't reference any Android resources, such as layout files. There is no discussion on what happens to the view created by the bundle if the bundle needs to be updated or removed. Also, there is the fact that it is impossible to add an activity or service to an application without modifying the Android manifest. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Android and OSGi/Apache Felix
Your link also demonstrates another worry of mine: nearly all discussions of OSGi on Android are from several years ago. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Android and OSGi/Apache Felix
My company is working on an app that will be distributed outside of the Android Market. We plan to preinstall our app on devices and then loan the devices out to customers. We really want the ability to update our app completely automatically, without the customer having to do anything. I can see two options: 1) Use a custom ROM and give our app root permissions 2) Use OSGi Does anyone have experience using OSGi in an Android app? All of the discussions I've found are several years old. My main worries center around possible conflicts between the Android lifecycle and OSGi lifecycle. For example, would there be issues unloading a bundle that contained a layout and replacing it with a different layout? What happens if that layout is currently being used by an activity? I can see similar issues arising around Strings. Android is designed to update an application's components on app version changes; I just don't know if it's wise to use something like OSGi to bypass this process. I can see all sorts of potential for conflicts and memory leaks. What I'd really like to know is if anyone has successfully used OSGi to update Android specific things, like layout files and strings. Thanks for any help, Jesse -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Television effect when screen turned off.
Dear all, Nexus S has a television effect when screen turned off ,I want to know if this feature is an Android2.3 feature or a samsung added feature? If it's a Android2.3 feature, please help me locate the corresponding codes , I can't find these codes in Android2.3 source code! Many 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: Authenticate Non-AppEngine Webservice using Google Account
I feel it is Android specific because the main unknown is what type of authtoken does the Android AccountManager API give us for google accounts (ClientLogin, OAuth, something else?). But, I'll try asking elsewhere. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Authenticate Non-AppEngine Webservice using Google Account
I really need to find an answer to this question. Anyone? Bueller? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Authenticate Non-AppEngine Webservice using Google Account
Does anyone know why this thread no longer appears in the list of topics? The only reason I was able to get back to it was because I had it bookmarked. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Authenticate Non-AppEngine Webservice using Google Account
Hello everyone, I have an Android application that requires a secure webservice. What I would like to do is: 1) Have the user select a Google account already logged in on the Android device. I know how to accomplish this using the AccountManager API. 2) Using AccountManager, get an authtoken for the selected Google Account 3) Pass the authtoken to my webservice, which would then validate the authtoken with google. Step 3 is where I'm lost. How do I validate the authtoken with Google? All the examples I've found use Google's AppEngine which handles the authentication for you. How can I validate the authtoken if I'm not using AppEngine? Thanks for any help, Jesse -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Global Search replacement app
I would like my app to replace the Google Quick Search Box. Basically, I want my app to be the default app for when the user presses (not long press) the hardware search button. Is this possible? If you are wondering why: my app is an alternative to QSB which I think works much faster and is much more practical. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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] SMS application
you are right, It seems so, Someone came up with a solution that deletes the sms from system inbox once SMS is received. but sms notification still be displayed. The best solution will be creating a customized ROM. On Fri, Jan 14, 2011 at 9:19 PM, Kumar Bibek wrote: > You cannot block the system inbox to get new messages. > > Kumar Bibek > http://techdroid.kbeanie.com > http://www.kbeanie.com > > > > On Sat, Jan 15, 2011 at 4:05 AM, jesse wrote: >> >> hi: >> >> I want to build a SMS application that can intercept certain SMS >> messages so that they won't be available to system inbox >> or other SMS applications. >> >> is there any special API to achieve this? >> >> thanks! >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Android Developers" group. >> To post to this group, send email to android-developers@googlegroups.com >> To unsubscribe from this group, send email to >> android-developers+unsubscr...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/android-developers?hl=en > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, 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] SMS application
hi: I want to build a SMS application that can intercept certain SMS messages so that they won't be available to system inbox or other SMS applications. is there any special API to achieve this? thanks! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] why metaData in providerInfo is always null?
hmm, so I need to make explicit call to get ProviderInfo in the MyProvider: context.getPackageManager(). resolveContentProvider(MyProvider.class.getName(), PackageManager.GET_META_DATA); even though Override function public void attachInfo(Context context, ProviderInfo info) already has a ProviderInfo info variable passed in. I understand the limitation is because it is possible to have multiple providers defined in manifest file. when attachInfo() is called in base class, it has no information of the actual provider class name. Can we improve the design like : abstract class ContentProvider { public void attachInfo(Context context) { ProviderInfo info = context.getPackageManager(). resolveContentProvider(getClass().getName(), // <--- getClass() will automatically resolve to the derived class name. PackageManager.GET_META_DATA); attachInfo(context, info); } public abstract void attachInfo(Context context, ProviderInfo info); } MyProvider extends ContentProvider { public abstract void attachInfo(Context context, ProviderInfo info) { // now info.metaData should have value, is not null. assertNotNull(info.metaData); } } android platform parses the manifest.xml file new instance of MyProvider and then initializes it via attachInfo(...) so the design will be more clean. please correct me if i am wrong. regards! On Wed, Jan 5, 2011 at 10:04 PM, Dianne Hackborn wrote: > You need to request the ProviderInfo from the package manager, setting the > flag to tell it to return the meta data. > > On Wed, Jan 5, 2011 at 12:20 AM, jesse wrote: >> >> According to this page: >> http://developer.android.com/guide/topics/manifest/manifest-intro.html, >> provider can have meta-data. >> however, when I check providerInfo.metaData in attachInfo() function >> of a derived provider class, it is always null? >> >> is this a bug is android SDK 7? >> >> public class MyProvider extends ContentProvider { >> .. >> >> public void attachInfo(Context context, ProviderInfo info) { >> super.attachInfo(context, info); >> >> Bundle bundle2 = info.metaData; >> >> However, bundle2 is always null here. >> >> >> here is my manifest xml file: >> >> > android:authorities="com...MyProvider"> >> >> >> >> thanks! >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Android Developers" group. >> To post to this group, send email to android-developers@googlegroups.com >> To unsubscribe from this group, send email to >> android-developers+unsubscr...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/android-developers?hl=en > > > > -- > Dianne Hackborn > Android framework engineer > hack...@android.com > > Note: please don't send private questions to me, as I don't have time to > provide private support, and so won't reply to such e-mails. All such > questions should be posted on public forums, where I and others can see and > answer them. > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: why metaData in providerInfo is always null?
bump! any one has similar experience? On Wed, Jan 5, 2011 at 12:20 AM, jesse wrote: > According to this page: > http://developer.android.com/guide/topics/manifest/manifest-intro.html, > provider can have meta-data. > however, when I check providerInfo.metaData in attachInfo() function > of a derived provider class, it is always null? > > is this a bug is android SDK 7? > > public class MyProvider extends ContentProvider { > .. > > public void attachInfo(Context context, ProviderInfo info) { > super.attachInfo(context, info); > > Bundle bundle2 = info.metaData; > > However, bundle2 is always null here. > > > here is my manifest xml file: > > android:authorities="com...MyProvider"> > > > > 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] why metaData in providerInfo is always null?
According to this page: http://developer.android.com/guide/topics/manifest/manifest-intro.html, provider can have meta-data. however, when I check providerInfo.metaData in attachInfo() function of a derived provider class, it is always null? is this a bug is android SDK 7? public class MyProvider extends ContentProvider { .. public void attachInfo(Context context, ProviderInfo info) { super.attachInfo(context, info); Bundle bundle2 = info.metaData; However, bundle2 is always null here. here is my manifest xml file: 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: Java 6 in Gingerbread?
Peter, Android's class library has been updated in Gingerbread. The update intends to be interoperable with Java SE 6. Cheers, Jesse -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Google maps api update
Any one have any information on whether or not there will be an update to the google maps api for android? Its woefully limited compared to the JavaScript version. No support for custom tile overlays, polygons or polylines etc. But it would seem that those features are all available in the official android google maps app. It would be nice if those features were available to developers -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Android 2.2 cutting off MediaPlayer?
Yeah I'm seeing the same issue myself, hopefully this turns out to be a bug not a 'feature' :) On May 22, 8:04 am, rofl newb creations wrote: > Hello, > > Suddenly, when playing audio usingMediaPlayerin an Android 2.2 > emulator, the audio seems to be getting the last 5-10%cutoff. I'm > using the exact same code from previous API's, with just what is below > formp3playback. I changed the API level of my app to 2.2 for > external storage, but the app still runs perfectly on any emulator > using <=2.1 and on my Moto Droid. > > MediaPlayermp =MediaPlayer.create(this, playMe); > mp.start(); > > Thanks for any input! > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group > athttp://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] Drawing KML using the MapView API
Hi, I'd like to draw KML on top of a MapView in my app. From searching around, I've that it is possible to have the Google Maps app draw KML by doing something like this: Intent mapIntent = new Intent(Intent.ACTION_VIEW); Uri uri1 = Uri.parse("geo:0,0?q=http://code.google.com/apis/kml/ documentation/KML_Samples.kml"); mapIntent.setData(uri1); startActivity(Intent.createChooser(mapIntent, "Sample")); This will start a separate activity, however, which isn't what I want. Instead, I want to have a MapView in my app that has the KML in it. Any ideas? If there isn't a way to do this, it looks like I may have to write my own Overlay? Thanks, Jesse -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: High performance access on static data: What is your approach?
Marc, I've filed an internal issue for us to investigate our serialization performance problems. On Nov 24, 12:09 am, Marc Reichelt wrote: > 2. Reading the data by parsing a CSV file is faster than loading an > XML, but again is too slow. How are you parsing the CSV? Are you buffering the input? Any mechanism that generates many intermediate Strings will be inefficient on a device. > 4. Reading in the data using serialization is slow. The funny thing > here is: It takes a bit longer than loading the XML file. This is unfortunate, but not too unreasonable. Depending on what parser you use, XML might need to do as much work as serialization - reflectively inspecting types and doing proper serialization lifecycle requires a lot of complex code. I suspect there are still many opportunities to improve Java serialization here (caching reflected fields?); I'll investigate. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] how to import R?
hi, I have an android project X that has package org.xyz, the generated R.java also has package name org.xyz... now I need to integrate another android project(A) that has package name com.abc with the poject X. after I put project A's src code into X project, eclipse always compain R cant be resolved in tons of places. I tried to add statement import org.xyz.R in those files in project A. but it seems not help. do you have any suggestion to quick integrate these two projects together? -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: Update: new ADT Eclipse plugin 0.9.1 available
Hi Raphael, Is the source code available for the 0.9.1 plugin? I was looking at the platform/development project, and it looks like it's still calling itself 0.9.0. I also tried building it and it doesn't seem to have the latest features/change. Does there need need to be another automated import before the latest changes will be available? Thanks, Jesse On May 7, 2:42 pm, Raphael wrote: > Hi all, > > We just updated the ADT Eclipse plugin to0.9.1. > > The new plugin provides the following changes: > - Added an AVD creation wizard to ADT. It is automatically displayed > during a launch if no compatible AVDs are found. > - Fixed issue with libs/ folder where files with no extension would > prevent the build from finishing. > - Improved error handling during the final steps of the build to mark > the project if an unexpected error prevent the build from finishing. > - Fixed issue when launching ADT on a clean install would trigger > "org.eclipse.swt.SWTError: Not implemented [multiple displays]." > - Improved error handling when parsing manifest when the > node is present with no (valid) minSdkVersion attribute (error shown > would say "null") > > To update from Eclipse, simply use Help > Software Update as usual or > visit the download page at > http://developer.android.com/sdk/adt_download.html > > Hope this helps, > Raphael. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Uninstall reason survey - where are the results?
(No response on android-discuss, trying here instead.) I've noticed that when I uninstall applications from my G1, I'm asked to give a reason. I have an application on the market. Is there any way to see the reasons people have given for uninstalling? There's no mention of this in the developer console. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 return non-table-oriented data from a content provider
Is there a limit to the number of columns a content provider can return? I see SQLite has a default limit of 2000 columns per table, which is more than enough, but my phony summary table wouldn't be backed by SQLite. Jesse On Mar 27, 1:40 pm, Stoyan Damov wrote: > With 5 you can have unlimited # of columns. With 3, well, you can't. > > On Fri, Mar 27, 2009 at 10:35 PM, Jesse McGrew wrote: > > > On Mar 27, 7:43 am, Stoyan Damov wrote: > >> Possible Approach 5, similar to 3 - a phony table with 3 columns: > > >> 1. Name/Key/Whatever > >> 2. Type ("enumeration") > >> 3. Data (string) > > >> The client would only need to convert the data from string to the > >> appropriate type. > > > Hmm. I'm not sure what the benefit of this is over #3. This basically > > turns the result set on end, requiring extra complexity in the client > > (looping over rows) without simplifying the server implementation. > > > It does get rid of the "single row" objection, I suppose. Come to > > think of it, if that's my only objection to #3, maybe the answer is > > clear... > > > Jesse --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 return non-table-oriented data from a content provider
On Mar 27, 7:43 am, Stoyan Damov wrote: > Possible Approach 5, similar to 3 - a phony table with 3 columns: > > 1. Name/Key/Whatever > 2. Type ("enumeration") > 3. Data (string) > > The client would only need to convert the data from string to the > appropriate type. Hmm. I'm not sure what the benefit of this is over #3. This basically turns the result set on end, requiring extra complexity in the client (looping over rows) without simplifying the server implementation. It does get rid of the "single row" objection, I suppose. Come to think of it, if that's my only objection to #3, maybe the answer is clear... Jesse --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] How to return non-table-oriented data from a content provider
I'm writing a content provider that returns data about game sessions. This data comes from an SQLite table. However, the client that consumes it will also want summary data: total wins, current/best winning streak, and so on. I'm not sure which approach to use. * Possible Approach 1: Do nothing, let the client calculate what it needs. The client could step through the whole table and calculate statistics itself. However, it's inefficient to send the entire database over the content provider link if the client only wants the summaries; this may also be prone to bugs because each client has to reimplement the summary calculations. * Possible Approach 2: Separate content URIs for summary data. The client could ask for a URI like content://myapp/summary/totalwins and get back a text/plain stream containing the number of wins. This seems like a big hassle to implement on both ends, though. Or it could ask for a URI like content://myapp/summary and get back an XML stream containing all the summary data, but this isn't much simpler. * Possible Approach 3: A phony table. The client could ask for a URI like content://myapp/summary and get back a cursor over a single row, with each summary value having its own column. This would not be an SQLite cursor but a custom in-memory cursor. It seems a little unnatural to use a table metaphor when there's always exactly one row, though. * Possible Approach 4: The extras bundle. Cursor has a getExtras() method that returns a bundle. The client could make a request for the main URI, content://myapp/sessions, and then just look at the extras bundle instead of reading any rows. However, there's no setExtras() method, so I'm stuck with whatever bundle object SQLite puts in there - and if it's Bundle.EMPTY, I'm out of luck. What do you recommend? Jesse --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Extra Icons in Menu
On Mar 19, 7:12 pm, Grant Kimm wrote: > Hi, > > Thanks for the reply. > > Here is my code sample. > > > > > > > > > > > > > > > > What do I need for the intent information for activities that are within the > main app, but not the root activity? Education is an activity that a user can > launch after getting into the mainApp activity. Just leave out the section for that activity. You only need an intent filter if your activity is going to respond to intents from other apps, like if you're replacing the standard picture chooser and want your activity to handle any request to choose a picture. If you're just using the activity for navigating within your app, you can omit the intent filter, and start the activity with its class name: Intent intent = new Intent(this, Education.class); startActivity(intent); Jesse --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Extra Icons in Menu
On Mar 19, 4:44 am, Grant Kimm wrote: > Hi, > > When I run my app, I see about 8 or 9 icons in the main phone menu. One > is to run the app, and the others actually run activities within the > app. > > I want there to only be one icon for users. Any ideas as to why this is > happening? > > My code is structured similar to examples from the book "Android - A > Programmers Guide" by JF DiMarzio. > > How do I hide the other icons so users have to start at the main menu screen? Check your manifest for these lines: Make sure you *only* have those under your main activity, the one you want to appear in the launcher. Jesse --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Merchant account signup down?
Still down for me too, by the way. This isn't something we're doing wrong, the system is just broken. Jesse On Mar 12, 8:09 am, jsdf wrote: > Weeks! Wow, that's truly a testament to how little Google cares about > customer support. As an example of how things could be done better, > look at Authorize.net. A webstore I help maintain went down. I got > on the phone and was talking to a human within 2 minutes. Turned out > the problem was on my end, but boy it was nice to be able to establish > that up front without wasting a lot of time. (And, I'm sure people > will have issue with Authorize.net as an example, but my point is that > it is still way waaay better than Google). > > The biggest problem I have always had with Google is the seeming > attitude of "since customer support doesn't scale, we don't bother > doing it. You are on your own." This is reflected in all of their > help and community pages. On EVERY help page they indicate something > to the effect of "sorry, we don't answer help requests.". No other > company in the world could get away with this level of customer > support, and it's incredible to me that Google can and routinely does. > > Let's be clear, this isn't for something Google is providing for free. > I, and everyone else on this list, PAID to be an Android Market > developer. That includes the customer support that should go with it. > > Oh, and in case you are keeping score, 36 hours later, still down. > [/venting] > > On Mar 12, 9:13 am, madcoder wrote: > > > Wait for it. That's all. I couldn't get my account verified, and had > > to send emails to support for a few weeks to get it all straight, but > > in the end, to Google's credit, they worked it all out. > > > On Mar 12, 10:02 am,jsdf wrote: > > > > Unfortunately, 24 hours later, it is still down. > > > And, I check with a friend who works at Google, but he's in Adwords > > > and is unable to do anything. Even he said I'm at the mercy of > > > support, while acknowledging that Google is terrible at support. > > > > Now what? Suggestions? > > > > On Mar 11, 10:03 am, "keith_hi...@yahoo.com" > > > wrote: > > > > > I am having the same issue. Been trying since yesterday to get this > > > > resolved. Google as of yet has not responded to my tech support > > > > request. > > > > > On Mar 10, 9:16 pm,jsdf wrote: > > > > > > I am trying to sign up for a merchant account but it seems to be down: > > > > > "Sorry, we could not setup your merchant account. > > > > > Please try again later." > > > > > > Can anyone else confirm this, or is it just my login? > > > > > > 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: Trackball doesn't give me click events, but touch screen does
Aha! Adding a call to that method fixes both the context menu problem and the click handler problem. Thanks. Jesse On Mar 11, 7:03 pm, Romain Guy wrote: > BTW did you call setItemsCanFocus(true) on your ListView? > > > > On Wed, Mar 11, 2009 at 7:01 PM, Jesse McGrew wrote: > > > On Mar 11, 6:28 pm, Jesse McGrew wrote: > >> On Mar 11, 6:04 pm, Romain Guy wrote: > > >> > > I'm trying to get the same behavior as Alarm Clock, where tapping on a > >> > > list row brings up an activity to edit the row, and the check box can > >> > > only be selected by tapping on the check box itself. I think that > >> > > precludes using multiple-choice mode for the list view, correct? > > >> > Indeed it does. ListView is not ready to do things like this really > >> > but a way to do it (much better than how it was done in AlarmClock) is > >> > to use a TouchDelegate for the checkbox. > > >> Interesting. Unfortunately I can't find any examples of TouchDelegate, > >> and the class documentation is confusing. > > >> I gather that I need to pass the bounds of the check box (relative to > >> its container) into the TouchDelegate constructor. Once I have a > >> TouchDelegate instance, what do I do with it? I see a method called > >> setTouchDelegate() - do I call that on the check box, the list row, or > >> the view group that directly contains the check box? And is that > >> method enough to get the touch events relayed to the delegate, or do I > >> need to listen for touch events and forward them myself? > > > Also: would it still be possible to focus the check box using the > > trackball? I assumed TouchDelegates were only for touch, and so the > > trackball would only be able to move between list rows. In AlarmClock, > > the trackball can move horizontally between the clock view and check > > box inside a row, as well as moving vertically between rows. > > > Jesse > > -- > Romain Guy > Android framework engineer > romain...@android.com > > Note: please don't send private questions to me, as I don't have time > to provide private support. 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: Trackball doesn't give me click events, but touch screen does
On Mar 11, 6:28 pm, Jesse McGrew wrote: > On Mar 11, 6:04 pm, Romain Guy wrote: > > > > I'm trying to get the same behavior as Alarm Clock, where tapping on a > > > list row brings up an activity to edit the row, and the check box can > > > only be selected by tapping on the check box itself. I think that > > > precludes using multiple-choice mode for the list view, correct? > > > Indeed it does. ListView is not ready to do things like this really > > but a way to do it (much better than how it was done in AlarmClock) is > > to use a TouchDelegate for the checkbox. > > Interesting. Unfortunately I can't find any examples of TouchDelegate, > and the class documentation is confusing. > > I gather that I need to pass the bounds of the check box (relative to > its container) into the TouchDelegate constructor. Once I have a > TouchDelegate instance, what do I do with it? I see a method called > setTouchDelegate() - do I call that on the check box, the list row, or > the view group that directly contains the check box? And is that > method enough to get the touch events relayed to the delegate, or do I > need to listen for touch events and forward them myself? Also: would it still be possible to focus the check box using the trackball? I assumed TouchDelegates were only for touch, and so the trackball would only be able to move between list rows. In AlarmClock, the trackball can move horizontally between the clock view and check box inside a row, as well as moving vertically between rows. Jesse --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Trackball doesn't give me click events, but touch screen does
On Mar 11, 6:04 pm, Romain Guy wrote: > > I'm trying to get the same behavior as Alarm Clock, where tapping on a > > list row brings up an activity to edit the row, and the check box can > > only be selected by tapping on the check box itself. I think that > > precludes using multiple-choice mode for the list view, correct? > > Indeed it does. ListView is not ready to do things like this really > but a way to do it (much better than how it was done in AlarmClock) is > to use a TouchDelegate for the checkbox. Interesting. Unfortunately I can't find any examples of TouchDelegate, and the class documentation is confusing. I gather that I need to pass the bounds of the check box (relative to its container) into the TouchDelegate constructor. Once I have a TouchDelegate instance, what do I do with it? I see a method called setTouchDelegate() - do I call that on the check box, the list row, or the view group that directly contains the check box? And is that method enough to get the touch events relayed to the delegate, or do I need to listen for touch events and forward them myself? Jesse --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Trackball doesn't give me click events, but touch screen does
On Mar 11, 5:57 pm, Jesse McGrew wrote: > Thanks for your response. I'm not sure if that approach will work, > though. My ListActivity's onListItemClick() method is called when I > click on an item with the trackball, but *not* when I touch it. It looks like I can handle both cases by setting a click listener on the row *and* responding to onListItemClick(). Now I wonder if there's a way to make the context menu only appear for data rows, not the list header row. (This works as expected with touch, but with the trackball, I still get a context menu on the header row.) Jesse --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Trackball doesn't give me click events, but touch screen does
Romain, Thanks for your response. I'm not sure if that approach will work, though. My ListActivity's onListItemClick() method is called when I click on an item with the trackball, but *not* when I touch it. Perhaps the root problem is that my list rows have focusable items in them (check boxes). The built-in Alarm Clock application has something similar, though, and I can see from the source code that Alarm Clock sets individual click listeners on the check boxes and the clock views. I'm trying to get the same behavior as Alarm Clock, where tapping on a list row brings up an activity to edit the row, and the check box can only be selected by tapping on the check box itself. I think that precludes using multiple-choice mode for the list view, correct? Jesse On Mar 11, 4:38 pm, "Romain Guy (Google)" wrote: > Hi Jesse, > > You should **not** set individual click listeners on the list items. > This will cause all sort of problems, like the ones you're seeing. The > main reason behind that is that ListView handles clicks/long clicks on > the items already. Instead you should use > ListView.setOnItemClickListener(). > > On Mar 5, 6:54 pm, Jesse McGrew wrote: > > > I have a list activity that creates a header row above the data rows > > from the adapter. I want to receive click events when the user selects > > the header or a data row (but my data rows have check boxes in them, > > so this part is tricky). When I use the touch screen, I get this > > expected behavior: > > > 1. Tapping on any row causes a click event and a dialog appears. > > 2. Long-pressing on a data row causes a context menu to appear. > > 3. Long-pressing on the header row does *not* show the context menu. > > > However, when I use the arrow keys (emulator) or trackball (G1), I get > > this unexpected behavior: > > > 1. Selecting any row fails to cause any click events, even though the > > row's appearance changes like it's being clicked. > > 2. Long-pressing on the header row *does* show the context menu, which > > I don't want. > > 3. Occasionally, it doesn't focus the correct row when I move up or > > down (e.g. it skips from the header to the last data row). > > > What am I doing wrong? > > > Jesse > > > (Complete project:http://hansprestige.com/android/DpadBug.zip) > > > // DpadActivity.java // > > > package com.hansprestige.DpadBug; > > > import android.app.AlertDialog; > > import android.app.Dialog; > > import android.app.ListActivity; > > import android.os.Bundle; > > import android.view.ContextMenu; > > import android.view.View; > > import android.view.ViewGroup; > > import android.view.ContextMenu.ContextMenuInfo; > > import android.view.View.OnClickListener; > > import android.widget.ArrayAdapter; > > import android.widget.ListView; > > > public class DpadBugActivity extends ListActivity { > > private static final int DIALOG_TEST = 1; > > > private OnClickListener testListener = new OnClickListener() { > > public void onClick(View v) { > > showDialog(DIALOG_TEST); > > } > > }; > > > @Override > > public void onCreate(Bundle savedInstanceState) { > > super.onCreate(savedInstanceState); > > setContentView(R.layout.main); > > > ListView lv = getListView(); > > registerForContextMenu(lv); > > > findViewById(android.R.id.empty).setOnClickListener > > (testListener); > > > View addItem = getLayoutInflater().inflate > > (R.layout.list_header, > > null, false); > > addItem.setOnClickListener(testListener); > > lv.addHeaderView(addItem); > > > fillData(); > > > } > > > private void fillData() > > { > > String[] items = new String[] { "Item A", "Item B", "Item C" }; > > ArrayAdapter adapter = new ArrayAdapter(this, > > R.layout.list_row, R.id.TextView01, items) { > > @Override > > public View getView(int position, View convertView, > > ViewGroup > > parent) { > > View v = super.getView(position, convertView, > > parent); > > v.setOnClickListener(testListener); > > v.setLongClickable(true); > > return v; > > } > > }; > > setListAdapter(adapter); > > } > > > @Override &g
[android-developers] Re: Trackball doesn't give me click events, but touch screen does
Anybody? On Mar 5, 6:54 pm, Jesse McGrew wrote: > I have a list activity that creates a header row above the data rows > from the adapter. I want to receive click events when the user selects > the header or a data row (but my data rows have check boxes in them, > so this part is tricky). When I use the touch screen, I get this > expected behavior: > > 1. Tapping on any row causes a click event and a dialog appears. > 2. Long-pressing on a data row causes a context menu to appear. > 3. Long-pressing on the header row does *not* show the context menu. > > However, when I use the arrow keys (emulator) or trackball (G1), I get > this unexpected behavior: > > 1. Selecting any row fails to cause any click events, even though the > row's appearance changes like it's being clicked. > 2. Long-pressing on the header row *does* show the context menu, which > I don't want. > 3. Occasionally, it doesn't focus the correct row when I move up or > down (e.g. it skips from the header to the last data row). > > What am I doing wrong? > > Jesse > > (Complete project:http://hansprestige.com/android/DpadBug.zip) > > // DpadActivity.java // > > package com.hansprestige.DpadBug; > > import android.app.AlertDialog; > import android.app.Dialog; > import android.app.ListActivity; > import android.os.Bundle; > import android.view.ContextMenu; > import android.view.View; > import android.view.ViewGroup; > import android.view.ContextMenu.ContextMenuInfo; > import android.view.View.OnClickListener; > import android.widget.ArrayAdapter; > import android.widget.ListView; > > public class DpadBugActivity extends ListActivity { > private static final int DIALOG_TEST = 1; > > private OnClickListener testListener = new OnClickListener() { > public void onClick(View v) { > showDialog(DIALOG_TEST); > } > }; > > @Override > public void onCreate(Bundle savedInstanceState) { > super.onCreate(savedInstanceState); > setContentView(R.layout.main); > > ListView lv = getListView(); > registerForContextMenu(lv); > > findViewById(android.R.id.empty).setOnClickListener > (testListener); > > View addItem = getLayoutInflater().inflate > (R.layout.list_header, > null, false); > addItem.setOnClickListener(testListener); > lv.addHeaderView(addItem); > > fillData(); > > } > > private void fillData() > { > String[] items = new String[] { "Item A", "Item B", "Item C" }; > ArrayAdapter adapter = new ArrayAdapter(this, > R.layout.list_row, R.id.TextView01, items) { > @Override > public View getView(int position, View convertView, ViewGroup > parent) { > View v = super.getView(position, convertView, parent); > v.setOnClickListener(testListener); > v.setLongClickable(true); > return v; > } > }; > setListAdapter(adapter); > } > > @Override > protected Dialog onCreateDialog(int id) { > switch (id) { > case DIALOG_TEST: > return new AlertDialog.Builder(this) > .setTitle("Hello!") > .setPositiveButton("Close", null) > .create(); > } > return super.onCreateDialog(id); > } > > @Override > public void onCreateContextMenu(ContextMenu menu, View v, > ContextMenuInfo menuInfo) { > super.onCreateContextMenu(menu, v, menuInfo); > menu.add("Context item"); > } > > } > > // main.xml // > > > http://schemas.android.com/apk/res/ > android" > android:layout_width="fill_parent" > android:layout_height="fill_parent"> > > android:layout_width="fill_parent" > android:layout_height="fill_parent" > android:focusable="false" /> > > > > // list_header.xml // > > > > http://schemas.android.com/apk/res/ > android" > android:layout_width="wrap_content" > android:layout_height="wrap_content" > android:background="@android:drawable/menuitem_background" > android:focusable="true" > android:descendantFocusability="blocksDescendants"
[android-developers] Re: Initial database population from large data files, several problems
On Mar 4, 11:49 pm, Justin Allen Jaynes wrote: > I'm building a dictionary application with 135,000 word entries (words > only). My raw file must have been too large (1.5 meg), because I got > this error: > > D/asset (909): Data exceeds UNCOMPRESS_DATA_MAX (1424000 vs 1048576) > > I've searched for this error with very few relevant hits. It seemed to > mean I could not open an uncompressed file over a meg. So I then split > the file into two smaller files and ran my code on both of them. It > worked out fine. My total application size is 3 meg installed. > > My code is: > public void onCreate(SQLiteDatabase database) { > database.execSQL("CREATE TABLE " + DATABASE_TABLE + " (wordid > INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, word VARCHAR);"); > > Scanner fileScanner = new > Scanner(myContext.getResources().openRawResource(R.raw.wordlist)); > while ( fileScanner.hasNextLine() ) { > String wordFromFile = fileScanner.nextLine(); > database.execSQL("INSERT INTO words (word) VALUES ('" + > wordFromFile + "');"); > } > fileScanner = new > Scanner(myContext.getResources().openRawResource(R.raw.wordlist2)); > while ( fileScanner.hasNextLine() ) { > String wordFromFile = fileScanner.nextLine(); > database.execSQL("INSERT INTO words (word) VALUES ('" + > wordFromFile + "');"); > } > > } > > However, when the application is first run, it takes several MINUTES to > initialize the database in this way. Is there a way (like a copy > command, as found in, say, postgresql, or a restore of a database file) > to copy data from a raw file, and can such a method be accessed from the > SDK so that standard first-run procedures can correctly set up the > database? I have been unable to locate such a luxury. I am seeking to > speed up this data populating process. > > First question: how can I speed up my database population? Pre-populating it and building the database file into your app, as the other response suggested, is probably the best way to do it. However, if you decide to populate the database when your app is first run, you might still be able to speed it up by wrapping the whole process inside an SQLite transaction. Otherwise, it creates a separate transaction for each query, which is slow. That's according to the SQLite Optimization FAQ (http://web.utk.edu/~jplyon/sqlite/ SQLite_optimization_FAQ.html), although that FAQ is out of date by now so maybe it's no longer true. Jesse --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Trackball doesn't give me click events, but touch screen does
I have a list activity that creates a header row above the data rows from the adapter. I want to receive click events when the user selects the header or a data row (but my data rows have check boxes in them, so this part is tricky). When I use the touch screen, I get this expected behavior: 1. Tapping on any row causes a click event and a dialog appears. 2. Long-pressing on a data row causes a context menu to appear. 3. Long-pressing on the header row does *not* show the context menu. However, when I use the arrow keys (emulator) or trackball (G1), I get this unexpected behavior: 1. Selecting any row fails to cause any click events, even though the row's appearance changes like it's being clicked. 2. Long-pressing on the header row *does* show the context menu, which I don't want. 3. Occasionally, it doesn't focus the correct row when I move up or down (e.g. it skips from the header to the last data row). What am I doing wrong? Jesse (Complete project: http://hansprestige.com/android/DpadBug.zip) // DpadActivity.java // package com.hansprestige.DpadBug; import android.app.AlertDialog; import android.app.Dialog; import android.app.ListActivity; import android.os.Bundle; import android.view.ContextMenu; import android.view.View; import android.view.ViewGroup; import android.view.ContextMenu.ContextMenuInfo; import android.view.View.OnClickListener; import android.widget.ArrayAdapter; import android.widget.ListView; public class DpadBugActivity extends ListActivity { private static final int DIALOG_TEST = 1; private OnClickListener testListener = new OnClickListener() { public void onClick(View v) { showDialog(DIALOG_TEST); } }; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ListView lv = getListView(); registerForContextMenu(lv); findViewById(android.R.id.empty).setOnClickListener (testListener); View addItem = getLayoutInflater().inflate (R.layout.list_header, null, false); addItem.setOnClickListener(testListener); lv.addHeaderView(addItem); fillData(); } private void fillData() { String[] items = new String[] { "Item A", "Item B", "Item C" }; ArrayAdapter adapter = new ArrayAdapter(this, R.layout.list_row, R.id.TextView01, items) { @Override public View getView(int position, View convertView, ViewGroup parent) { View v = super.getView(position, convertView, parent); v.setOnClickListener(testListener); v.setLongClickable(true); return v; } }; setListAdapter(adapter); } @Override protected Dialog onCreateDialog(int id) { switch (id) { case DIALOG_TEST: return new AlertDialog.Builder(this) .setTitle("Hello!") .setPositiveButton("Close", null) .create(); } return super.onCreateDialog(id); } @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); menu.add("Context item"); } } // main.xml // http://schemas.android.com/apk/res/ android" android:layout_width="fill_parent" android:layout_height="fill_parent"> // list_header.xml // http://schemas.android.com/apk/res/ android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@android:drawable/menuitem_background" android:focusable="true" android:descendantFocusability="blocksDescendants"> // list_row.xml // http://schemas.android.com/apk/res/android"; android:clickable="true" android:focusable="true" android:background="@drawable/ android:menuitem_background" android:layout_width="fill_parent" android:layout_height="wrap_content" android:descendantFocusability="blocksDescendants"> --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Pay app support?
If you absolutely must offer a trial, and the Market won't support it, you could offer a trial version of your app with some sort of kill switch (the application sets a flag and tells itself to stop working after 10 days) and a paid version that does not do this. It would not prevent a truly determined person from circumventing your terms, but given the nature of Android, why couldn't somebody just hack the Market app to ignore trial periods anyway? My 2c Jesse On Mon, Nov 10, 2008 at 7:10 PM, Christine <[EMAIL PROTECTED]>wrote: > > Hopefully, they will allow a trial period. iPhone market doesn't allow > that, so you're forced to either charge for the first download, or > make the app free. > > On Nov 10, 9:52 pm, Eric <[EMAIL PROTECTED]> wrote: > > It was announced that a 30% cut of the Market price will be paid to > > the carrier(s), and the remaining 70% will be paid to the developer. > > > > You can also sell apps through venues other than the Market, and avoid > > the 30% cut, but it seems likely that most phone owners will only look > > for apps in 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---