[android-developers] Re: Need to buy 15 Nexus One Unlocked
Thanks, a few wrote me with good suggestions. I'll contact Best Buy and find out what the unlocked price is. I have 3 N1's in use in the class right now running Cyanogen. Wireless AP only. Can't afford 15 plans. Thanks to all of you who responded or emailed with suggestions. Very helpful. Josh On Feb 4, 1:32 am, Brill Pappin wrote: > Note though that if your teaching a class, you don't need the SIM cards > installed to write applications (unless your specifically writing something > that uses it). > > I can just imagine what would happen in a class full of teenagers if there > were active SIMs in the phones :) > > - Brill Pappin > > > > > > > > Trevor Johns wrote: > >All Nexus S devices are unlocked. You can use any GSM SIM in them (though > >whether you get 3G depends on the carrier), sideload apps if you need, and > >you can unlock the bootloader by running 'fastboot oem unlock'. > > >(Note that unlocking the bootloader will void your warranty.) > > >-- > >Trevor Johns > >Developer Programs Engineer, Android > >http://developer.android.com > > >On Thu, Feb 3, 2011 at 9:08 PM, joshbeck wrote: > > >> Hello, > > >> I'm a developer and I recently got a grant approved to buy hardware > >> for an Android developer class. > >> I'd like to get my hands on 15 Nexus 1's. The limit listed is 10. Is > >> there anyone I can contact? > > >> Can I get the Nexus S unlocked at Best Buy does anyone know? > > >> Thanks for any assistance. > > >> Josh Beck > > >> -- > >> You received this message because you are subscribed to the Google > >> Groups "Android Developers" group. > >> To post to this group, send email to android-developers@googlegroups.com > >> To unsubscribe from this group, 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] Need to buy 15 Nexus One Unlocked
Hello, I'm a developer and I recently got a grant approved to buy hardware for an Android developer class. I'd like to get my hands on 15 Nexus 1's. The limit listed is 10. Is there anyone I can contact? Can I get the Nexus S unlocked at Best Buy does anyone know? Thanks for any assistance. Josh Beck -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Detect Default Camera Directory
Forgot to mention the CAMERA_IMAGE_BUCKET_ID string: It is defined as: public static final String CAMERA_IMAGE_BUCKET_ID = getBucketId(CAMERA_IMAGE_BUCKET_NAME); On Jan 28, 12:22 pm, joshbeck wrote: > Hello: > > I have an app that uses this standard code to get a list of pictures > stored on the phone: > (It seems to only works when the device in question utilizes /DCIM/ > camera) --Many use different folders for default picture storage. > > --My question: What might be the best way to detect what the default > camera storage directory is: > (I considered getting a directory list and having the code iterate > through what it finds.) > Is there a way to retrieve it exactly? > > public static final String CAMERA_IMAGE_BUCKET_NAME = > Environment.getExternalStorageDirectory().toString() > + "/DCIM/Camera"; > > //BEGIN CODE > final String[] projection = { MediaStore.Images.Media.DATA }; > final String selection = > MediaStore.Images.Media.BUCKET_ID + " > = ?"; > final String[] selectionArgs = { CAMERA_IMAGE_BUCKET_ID }; > final Cursor cursor = > context.getContentResolver().query(Images.Media.EXTERNAL_CONTENT_URI, > projection, > selection, > selectionArgs, > null); > ArrayList result = new > ArrayList(cursor.getCount()); > if (cursor.moveToFirst()) { > final int dataColumn = > cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA); > do { > final String data = cursor.getString(dataColumn); > result.add(data); > } while (cursor.moveToNext()); > } > > cursor.close(); > //END CODE > > Thanks for any help, > Josh Beck -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Detect Default Camera Directory
Hello: I have an app that uses this standard code to get a list of pictures stored on the phone: (It seems to only works when the device in question utilizes /DCIM/ camera) --Many use different folders for default picture storage. --My question: What might be the best way to detect what the default camera storage directory is: (I considered getting a directory list and having the code iterate through what it finds.) Is there a way to retrieve it exactly? public static final String CAMERA_IMAGE_BUCKET_NAME = Environment.getExternalStorageDirectory().toString() + "/DCIM/Camera"; //BEGIN CODE final String[] projection = { MediaStore.Images.Media.DATA }; final String selection = MediaStore.Images.Media.BUCKET_ID + " = ?"; final String[] selectionArgs = { CAMERA_IMAGE_BUCKET_ID }; final Cursor cursor = context.getContentResolver().query(Images.Media.EXTERNAL_CONTENT_URI, projection, selection, selectionArgs, null); ArrayList result = new ArrayList(cursor.getCount()); if (cursor.moveToFirst()) { final int dataColumn = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA); do { final String data = cursor.getString(dataColumn); result.add(data); } while (cursor.moveToNext()); } cursor.close(); //END CODE Thanks for any help, Josh Beck -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Middle School Android Programming Class
Hello all, My name is Josh Beck and I teach course to advanced eighth grade students. There are 26 students in the class and right now we only have 4 development devices to work with. (Everyone else uses the emulator right now, which can be limiting.) I've qualified as a finalist in a competition sponsored by Rackspace hosting. They have opened up a public 'survey monkey' based public ballot to help determine which project will receive the funds. Getting a 1-1 development handset-student ratio in that class would be a giant leap forward for our curriculum. So, if you like the idea of helping young Android developers get their hands on development tools, please go here: http://www.surveymonkey.com/s/V22YXLW and vote. Below is a list with descriptions of all the projects who have qualified to be $10,000 grant finalists. (They are all worthy, please read the descriptions.) Thanks everyone! “IF YOU CAN DREAM IT” Finalists Krueger MS http://www.surveymonkey.com/s/V22YXLW --Classroom Video Cameras-- There is a class set of Kodak Zi8 SD cameras in the technology wing, but every classroom that wants a camera should have one to document and share lessons, highlight excellent learning and to show off student work. It will engage the audience and allow teachers to show each other the best of what is happening in their classrooms. It also will help unify team efforts and inspire better learning. Students would also be able to film and edit video pieces. Metric: more than 30 teachers sign up for cameras; good classroom videos begin making it into the combined archive and made into relevant, entertaining and educational videos; posting (videos and comments) on KMSN.ORG. --Android Programming Phones-- Students do not have enough Google development handsets to test the programs they develop. Class would like a few netbooks preinstalled with development software so that students could check them out with a development phone to work on code at home or over the weekend. We currently have 3 dev phones but would like to have 15-20 devices in the classroom. Students have the option to declare a business with the IRS, set up a merchant account with Google, set up a business bank account and have direct deposit working from the Android market to their business accounts (with parental consent). Students last year made hundreds of dollars on the apps they developed. Metric: Increase in students setting up a business and generating revenue on the market; increase in the number of students making money from their apps --“You in SA” after school club-- Students meet once a week to research, plan and organize Saturday field trips to locations around San Antonio such as universities, museums and historical markers. Students will be able to engage with areas of SA that impact them economically, socially and politically. They will discover places that will open opportunities and impact their future decisions. Families will benefit from the exposure students receive as they discover opportunities for themselves in SA. Metric: fewer office referrals, improved academic performance, improved TAKS performance --4-Part Bullying Proposal-- Bullying is a huge problem that takes away from instructional time and focus. We would like to approach it in four parts: 1) Kick off bullying awareness week with coolassemblies.com (Cary Trovanovich) and continue character education throughout the year. 2) Motivate students by engaging them in high-energy assemblies by Patrick Perez. 3) Train staff and 50 student/grade level (select leaders of the pack) in ropes training (Fusion) to teach tolerance and proactively address suicide prevention. Fusion is through Region 20. 4) Safe School Ambassadors custom designed end-of-year retreat for 70 students who are part of the behind-the-scenes anti-bullying campaign at Krueger. Metric: survey students at end of each program part; teacher and administration program evaluation at end of the year -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Live Wallpaper Screen Orientation
Hello All, I have a series of live wallpapers out and one major sticking point I have with a certain set is that when devices switch to Landscape, the wallpaper, which in most cases is an image designed to fit the screen in portrait mode, appears off center. What is the conventional way to detect the shift from portrait to landscape? Any help is appreciated and thanks in advance! Josh Beck -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 Programming Class
Hello everyone: I've been developing a curriculum designed to teach middle school students Android programming this year. Here's an end of the year article that covers it really well. http://linuxclassroom.com Thanks to the dev community. Big support over the last few years! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: 14-year-old Android Developer:
Thanks for all the positive comments here! Josh On Apr 24, 1:11 am, Ivan Greene wrote: > yeah..wow..I really need to work harder in school. > I'm taking you guys' advice about this! > > On Apr 23, 3:39 pm, Bob Kerns wrote: > > > > > > > My grades weren't great, though a little better than yours by the time > > I graduated -- but I did well on the SAT's. And I ended up going to > > MIT. > > > So it can happen. But you will need to work on it -- you'll have to > > bring up your grades. But what you've already accomplished should be > > proof to yourself that you CAN do it. > > > Ask for as much help as you need. Carve out the time, and do whatever > > it takes to actually spend the time doing the things you need to do. > > Time management is a key to success in everything. Focus on what's > > important. I have some important things to do right now -- but I saw > > your message, and decided that encouraging YOU is the best use of my > > time right this moment. Give yourself the same priority and > > expectations. > > > Just because you don't have a teacher like Josh, doesn't mean you > > don't have teachers who will help. Teachers like to be asked, they > > really support students who show enough interest to ask questions, > > both in and out of class. If you can't find the help you need there, > > keep looking. When you get to college, keep up that habit. It's a bit > > more intimidating there, but it's key to getting the most out of your > > education. > > > You'll blow it. Over and over again. Each time, don't fret about it, > > don't beat yourself up or label yourself a failure. Pick yourself up > > and try again. Figure out how to do better. When something works -- > > keep on doing that. > > > Don't try to rely just on your smarts. Smart kids really have a hard > > time learning to work hard on learning, because sometimes they don't > > need to. But sometimes, you do. Sometimes, there are no shortcuts. > > > Always dive into what you don't understand first. Take a quick look > > around -- and then start building understanding, on a foundation of > > what you already know. Don't try to learn it all at once, learn a step > > at a time. But don't be afraid to take that first step in over your > > head -- or take it anyway. > > > Whatever you do -- don't feel you have to learn it alone. That's the > > hard way, and a lot less fun. I wish I'd learned that lesson earlier > > -- but in programming ESPECIALLY, the great ideas you have, aren't > > nearly as the great ideas you'll have after you see the great ideas > > others have. > > > Best of luck! > > > On Apr 22, 5:37 pm, Ivan Greene wrote: > > > > Miguel: Thanks for the encouragement! > > > I am working on an Android game right now. > > > I'm thinking about college, because I would really like to work for > > > Google. > > > But I'm not sure that will happen, my grades are quite bad (about 2.5 > > > GPA). > > > > On Apr 22, 6:48 pm, Miguel Morales wrote: > > > > > Congratulations guys! You're on your way to build some great stuff. > > > > I really wish I had a good computer teacher in High School, lucky! > > > > Keep it up and you might not even need to go to college (MIT or > > > > something would be cool though) to make good money. > > > > I wrote my first program at 15 and never finished High School, now I > > > > make more money than most college graduates, best of luck to you! > > > > > On Thu, Apr 22, 2010 at 4:36 PM, Eddie Ringle wrote: > > > > > Yeah, I'm 15 (will be 16 in May), and I haven't made much just yet, > > > > > but that is more due to the target audience of my app (GitHub users) > > > > > and the fact that a free version is available. I only make money if > > > > > someone chooses to buy the donate version (there are ads on the free > > > > > verison, but they aren't really effective). Good job though. :) > > > > > > On Apr 21, 8:26 pm, joshbeck wrote: > > > > >> Hello, > > > > > >> I'm writing a curriculum this year that is designed to get high- > > > > >> achieving 8th grade students to write and publish > > > > >> Android apps. One of my students broke the $50 this week. > > > > > >> Here's an article: > > > &
[android-developers] 14-year-old Android Developer:
Hello, I'm writing a curriculum this year that is designed to get high- achieving 8th grade students to write and publish Android apps. One of my students broke the $50 this week. Here's an article: http://www.neisd.net/ComRel/News/Krueger_PaidApp_10.htm He's basically spent the last 2 months camped out in my computer lab, but hard work pays off for sure. I'm doing my best to document my instruction through YouTube at http://linuxclassroom.com Thanks all, Josh Beck -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Creating Simple Serial Output:
Thanks for the response. I've got an arduino board that has serial output via 4 pins. Pin 1: ground Pin 2: transmit Pin 3: Receive Pin 4: reset I plug a usb adapter into it and that allows me to upload code to the microprocessor and monitor the output locally. To answer your question: -I'm looking to replace the arduino completely with a program running on the phone that somehow, someway generates a simple serial message 'as if' it were being transmitted via that simple pin configuration. (We're using a video overlay board that accepts serial data and creates a real time GPS text overlay for the students to watch locally and analyze later.) -Thanks for the advice. We've been using this Arduino for years now and I think it's time to replace it completely with Android. --It's a fun challenge. Josh On Mar 11, 1:17 am, Bob Kerns wrote: > I'm not clear on what you're trying to do. Are you trying to get a > phone to talk to an Arduino, or are you trying to replace the Arduino > with a phone? > > Phone USB ports aren't generally set up to act as hosts, but as > devices. Supposedly some phone USB ports are hardware capable of doing > so, but I don't know the magic, nor do I recall which phones. That may > not be a barrier; you may be able to set the Arduino up as host. > > At a minimum, you'll need to get root access on your phone, and > probably need to use the NDK to write some C++ code to bridge between > Java and actually talking to the hardware. > > I've got a couple different types of Arduinos around here with USB -- > one with it on the board, another, smaller one with it as an adapter > you can connect to the output pins. I don't know if that solves any > problems for you -- but at least the adapter would save you from > dealing with the electrical interface aspects, and the USB bus > protocol aspects. The latter would probably render your plan > unfeasible, I think. I note that the USB adapter board has a tiny > surface-mount chip on it that has about as many pins as the Arduino > chip! > > The USB adapter wasn't very expensive. I could dig up the specific > parts and sources, but you're probably better off googling and > choosing what best fits your needs. > > On Mar 10, 7:11 pm, joshbeck wrote: > > > > > I've got a fairly unique situation: > > -I'm a teacher with a magnet school that focuses on rocketry and > > technology. > > -I've got a rocket payload that has a video overlay board which > > does the following: > > -Takes input from a camera. > > -Takes input from a serial data line. > > -Overlays the text input to the video screen in > > real time and saves to avi. > > > -Right now we're using this antiquated device called an Arduino > > board which > > is cave man stuff compared to the developer phones we have on > > campus. > > (It's very educational making one work, but still old hardware.) > > > -The Arduino processor essentially outputs data to a 'transmit' > > pin that can > > be easily hooked up to a pc serial port. (Serial Data.) > > > -My present course of inquiry: (I'm a fairly proficient Android > > developer) > > > -- > > -Can I write a program that outputs a simple string like > > this directly to the usb data cable: > > String aString = "abc"; > > --- > > -From there, would it be possible to purchase a usb > > to serial converter and > > grab the associated data off the correct serial pin? > > > -I'm not an electrical engineer by any means, but I think that a > > serial > > converter would have to boost the voltage from the USB line > > in order to work because usb voltages are lower than what > > comes straight out the serial port. > > -Does this sound like a correct assumption? > > > -Any advice is appreciated. We'd love to launch a smart phone at > > our next competition. > > > Thanks in advance > > Josh Beck > > Northeast ISD > > KSAT/iMAK at Krueger Middle School > > (Launching Android in rockets is fun!) -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Creating Simple Serial Output:
I've got a fairly unique situation: -I'm a teacher with a magnet school that focuses on rocketry and technology. -I've got a rocket payload that has a video overlay board which does the following: -Takes input from a camera. -Takes input from a serial data line. -Overlays the text input to the video screen in real time and saves to avi. -Right now we're using this antiquated device called an Arduino board which is cave man stuff compared to the developer phones we have on campus. (It's very educational making one work, but still old hardware.) -The Arduino processor essentially outputs data to a 'transmit' pin that can be easily hooked up to a pc serial port. (Serial Data.) -My present course of inquiry: (I'm a fairly proficient Android developer) -- -Can I write a program that outputs a simple string like this directly to the usb data cable: String aString = "abc"; --- -From there, would it be possible to purchase a usb to serial converter and grab the associated data off the correct serial pin? -I'm not an electrical engineer by any means, but I think that a serial converter would have to boost the voltage from the USB line in order to work because usb voltages are lower than what comes straight out the serial port. -Does this sound like a correct assumption? -Any advice is appreciated. We'd love to launch a smart phone at our next competition. Thanks in advance Josh Beck Northeast ISD KSAT/iMAK at Krueger Middle School (Launching Android in rockets is fun!) -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Device Seeding Program for Top Android Market Developers
Pretty sweet deal if true. I'm teaching a middle school Android class. If Google sees fit to send me one, I'll donate it to the classroom! http://www.neisd.net/ComRel/News/Krueger_Smartphone_10.htm<-- Roman Look Please! On Mar 2, 5:53 pm, Larry wrote: > Dear all, > > I just received an email about Device Seeding Program for Top Android > Market Developers: > > Subject: Device Seeding Program for Top Android Market Developers > From: android-market-seed...@google.com > > Due to your contribution to the success of Android Market, we would > like to present you with a brand new Android device as part of our > developer device seeding program. You are receiving this message > because you're one of the top developers in Android Market with one or > more of your applications having a 3.5 star or higher rating and more > than 5,000 unique downloads. > > In order to receive this device, you must click through to this site, > read the terms and conditions of the offer and fill out the > registration form to give us your current mailing address so that we > can ship your device. > > You will receive either a Verizon Droid by Motorola or a Nexus One. > Developers with mailing addresses in the US will receive either a > Droid or Nexus one, based on random distribution. Developers from > Canada, EU, and the EEA states (Norway, Lichtenstein), Switzerland, > Hong Kong, Taiwan, and Singapore will receive a Nexus One. Developers > with mailing addresses in countries not listed above will not receive > a phone since these phones are not certified to be used in other > countries. > > We hope that you will enjoy your new device and continue to build more > insanely popular apps for Android! > > The email is from Google but I am still doubting somehow. Is this a > spam? Any other developers receive this emails before? > > 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: Advice on Swipe Direction and Velocity
Actually, I'm working with openGL. So, it looks like I'm supposed to set up a GestureListener and override onFling to increment Y or X. Then use Y and X from there to rotate my object and slow it down and stop it using a math function. On Feb 20, 1:28 pm, joshbeck wrote: > Ok, I've done some reading and I have a working theory: > > It's done using something this: > > @Override > public boolean onKeyDown(int keyCode, KeyEvent event) { > switch (keyCode) > { > > case KeyEvent.KEYCODE_DPAD_DOWN: > (increment static value X by Y ); > break; > > { > > This way a faster swipe results in a higher value? > > Sound logical or am I off? > > Thanks again, > Josh Beck > > On Feb 20, 12:52 pm, joshbeck wrote: > > > > > Hello all, > > > I'm looking for a starting point on this: > > > Here's a good example: > > -When you create a 'ListView', as the user swipes up or down the > > list scrolls > > in accordance with how fast the user swiped. Give it a fast swipe, and > > the list scrolls farther, faster. > > > Same thing is true within the web browser. > > > Now, I've downloaded the native source code for OS. So, I have that > > as a resource to > > poke around and see exactly how this is being accompished natively. > > > Question: > > > Is swipe direction/velocity documented anywhere. --Example code would > > be helpful. > > > I'd like to start by applying an OnTouchEvent(); to a 2D canvas and > > simply rotate > > the canvas based on swipe velocity. > > > Any tips are appreciated. > > > Thanks, > > Josh Beck -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Advice on Swipe Direction and Velocity
Ok, I've done some reading and I have a working theory: It's done using something this: @Override public boolean onKeyDown(int keyCode, KeyEvent event) { switch (keyCode) { case KeyEvent.KEYCODE_DPAD_DOWN: (increment static value X by Y ); break; { This way a faster swipe results in a higher value? Sound logical or am I off? Thanks again, Josh Beck On Feb 20, 12:52 pm, joshbeck wrote: > Hello all, > > I'm looking for a starting point on this: > > Here's a good example: > -When you create a 'ListView', as the user swipes up or down the > list scrolls > in accordance with how fast the user swiped. Give it a fast swipe, and > the list scrolls farther, faster. > > Same thing is true within the web browser. > > Now, I've downloaded the native source code for OS. So, I have that > as a resource to > poke around and see exactly how this is being accompished natively. > > Question: > > Is swipe direction/velocity documented anywhere. --Example code would > be helpful. > > I'd like to start by applying an OnTouchEvent(); to a 2D canvas and > simply rotate > the canvas based on swipe velocity. > > Any tips are appreciated. > > Thanks, > Josh Beck -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Advice on Swipe Direction and Velocity
Hello all, I'm looking for a starting point on this: Here's a good example: -When you create a 'ListView', as the user swipes up or down the list scrolls in accordance with how fast the user swiped. Give it a fast swipe, and the list scrolls farther, faster. Same thing is true within the web browser. Now, I've downloaded the native source code for OS. So, I have that as a resource to poke around and see exactly how this is being accompished natively. Question: Is swipe direction/velocity documented anywhere. --Example code would be helpful. I'd like to start by applying an OnTouchEvent(); to a 2D canvas and simply rotate the canvas based on swipe velocity. Any tips are appreciated. Thanks, Josh Beck -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: OpenGL Textures
I'm going to answer my question here: http://insanitydesign.com/wp/projects/nehe-android-ports/ Excellent resource for Android OpenGL On Feb 17, 2:36 pm, joshbeck wrote: > I meant to state I'm 'also' looking for suggestions on a good book on > JOGL as a general > study guide. > > On Feb 17, 2:35 pm, joshbeck wrote: > > > > > Hello All, > > > I'm learning OpenGL on my own atm and I have a question about > > texturing a surface: > > > I can create a simple polygon like this: > > > public class Square { > > // Our vertices. > > private FloatBuffer colorBuffer; > > float[] colors = { > > .5f, .5f, 0f, .2f, // vertex 0 red > > 0f, 1f, 0f, .2f, // vertex 1 green > > 0f, 0f, 1f, .2f, // vertex 2 blue > > 1f, 0f, 1f, .2f, // vertex 3 magenta > > }; > > private float vertices[] = { > > -.7f, .04f, -.5f, // 0, Top Left > > -.7f, -.04f, -0.5f, // 1, Bottom Left > > .7f, -.04f, 0.05f, // 2, Bottom Right > > .7f, .04f, 0.05f, // 3, Top Right > > }; > > private short[] indices = { 0, 1, 2, 0, 2, 3 }; > > > Then I load all of that info into the approriate buffers and draw it > > to the screen with a call to: > > > gl.glDrawElements(GL10.GL_TRIANGLES, indices.length, > > GL10.GL_UNSIGNED_SHORT, indexBuffer); > > > My question: > > > I'm looking for a good example of how to take an image and texture it > > to the surface. > > > (I'm looking for a good book on JOGL with examples.) > > > Any suggestions are appreciated. > > > Thanks, > > Josh Beck > > Northeast ISD -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: OpenGL Textures
I meant to state I'm 'also' looking for suggestions on a good book on JOGL as a general study guide. On Feb 17, 2:35 pm, joshbeck wrote: > Hello All, > > I'm learning OpenGL on my own atm and I have a question about > texturing a surface: > > I can create a simple polygon like this: > > public class Square { > // Our vertices. > private FloatBuffer colorBuffer; > float[] colors = { > .5f, .5f, 0f, .2f, // vertex 0 red > 0f, 1f, 0f, .2f, // vertex 1 green > 0f, 0f, 1f, .2f, // vertex 2 blue > 1f, 0f, 1f, .2f, // vertex 3 magenta > }; > private float vertices[] = { > -.7f, .04f, -.5f, // 0, Top Left > -.7f, -.04f, -0.5f, // 1, Bottom Left > .7f, -.04f, 0.05f, // 2, Bottom Right > .7f, .04f, 0.05f, // 3, Top Right > }; > private short[] indices = { 0, 1, 2, 0, 2, 3 }; > > Then I load all of that info into the approriate buffers and draw it > to the screen with a call to: > > gl.glDrawElements(GL10.GL_TRIANGLES, indices.length, > GL10.GL_UNSIGNED_SHORT, indexBuffer); > > My question: > > I'm looking for a good example of how to take an image and texture it > to the surface. > > (I'm looking for a good book on JOGL with examples.) > > Any suggestions are appreciated. > > Thanks, > Josh Beck > Northeast ISD -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] OpenGL Textures
Hello All, I'm learning OpenGL on my own atm and I have a question about texturing a surface: I can create a simple polygon like this: public class Square { // Our vertices. private FloatBuffer colorBuffer; float[] colors = { .5f, .5f, 0f, .2f, // vertex 0 red 0f, 1f, 0f, .2f, // vertex 1 green 0f, 0f, 1f, .2f, // vertex 2 blue 1f, 0f, 1f, .2f, // vertex 3 magenta }; private float vertices[] = { -.7f, .04f, -.5f, // 0, Top Left -.7f, -.04f, -0.5f, // 1, Bottom Left .7f, -.04f, 0.05f, // 2, Bottom Right .7f, .04f, 0.05f, // 3, Top Right }; private short[] indices = { 0, 1, 2, 0, 2, 3 }; Then I load all of that info into the approriate buffers and draw it to the screen with a call to: gl.glDrawElements(GL10.GL_TRIANGLES, indices.length, GL10.GL_UNSIGNED_SHORT, indexBuffer); My question: I'm looking for a good example of how to take an image and texture it to the surface. (I'm looking for a good book on JOGL with examples.) Any suggestions are appreciated. Thanks, Josh Beck Northeast ISD -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Live Wallpaper --OpenGL Help/Advice.
I can see that now and I thank you for the response. Really, your directions were very clear and your GL service is incredible. I hope to see it incorporated in the official 2.2 API. You deserve it, and I thank you! Nancy, thanks also. --Your directions are what I was able to follow in order to fix my setup. Very talented. I'm a hack at this stuff, and the information I gleaned from this fix was just what I needed. --Great knowledge! (Believe it or not, I'm actually trying to teach this stuff at the 8th grade level) http://www.neisd.net/ComRel/News/Krueger_Smartphone_10.htm (That's my class) I can fire off basic intents and work with the hardware on the phone fairly competently, but OpenGL is new. Now I can do a couple things: 1.) Play with polygons 2.) Teach the students pictured in that article to play with polygons based on the template I now have. They'll love it! Thanks again! Josh Beck Northeast ISD http://www.linuxclassroom.com On Feb 14, 3:25 pm, Robert Green wrote: > The problem that you were having is that you weren't creating the > engine in the right spot and then in the engine, you need to be > setting the renderer in the constructor. > > The big difference between this and GLSurfaceView is that all of your > traditional "Activity" or "View" code goes into your Engine, not into > the Service. All the service really needs to do is create engines. > Engines do everything else. Follow the structure I posted and you > should be golden. > > On Feb 14, 3:18 pm, Robert Green wrote: > > > > > I guess I really should have posted an example, huh? Here's the > > structure that works: > > > public class MyWallpaperService extends GLWallpaperService { > > public MyWallpaperService() { > > super(); > > } > > > public Engine onCreateEngine() { > > MyEngine engine = new MyEngine(); > > return engine; > > } > > > // prefs and sensor interface is optional, just showing that this is > > where you do all of that - everything that would normally be in an > > activity is in here. > > class MyEngine extends GLEngine implements > > SharedPreferences.OnSharedPreferenceChangeListener, > > SensorEventListener { > > MyRenderer renderer; > > public MyEngine() { > > super(); > > // handle prefs, other initialization > > renderer = new MyRenderer(); > > setRenderer(renderer); > > setRenderMode(RENDERMODE_WHEN_DIRTY); > > } > > > public void onDestroy() { > > super.onDestroy(); > > if (renderer != null) { > > renderer.release(); // assuming yours has this method - it > > should! > > } > > renderer = null; > > > } > > > On Feb 14, 11:52 am, Lance Nanek wrote: > > > > >public GLSurfaceView mGLSurfaceView; > > > ... > > > >mGLSurfaceView = new GLSurfaceView(this); > > > ... > > > >mGLSurfaceView = new GLSurfaceView(MyLiveWallpaper.this); > > > > Remove the lines above. Any use of GLSurfaceView in this is wrong. > > > > >public Engine onCreateEngine() { > > > >return new GLEngine(); > > > >} > > > > You are supposed to return an instance of your subclass of GLEngine > > > here, "new CubeEngine()" in your case. > > > > >public class OpenGLRenderer implements GLSurfaceView.Renderer { > > > > You should be implementing GLWallpaperService.Renderer, not > > > GLSurfaceView.Renderer. > > > > >private final Runnable mDrawCube = new Runnable() { > > > >public void run() { > > > >drawFrame(); > > > >// CHECK OUT drawFrame() --Am I doing things correctly there? > > > >} > > > >}; > > > > Remove all of the above. > > > > >mGLSurfaceView.setRenderer(new OpenGLRenderer()); > > > >mGLSurfaceView.setRenderMode(RENDERMODE_CONTINUOUSLY); > > > > These should be called on GLEngine, which you are subclassing. They > > > should look like this: > > > setRenderer(new OpenGLRenderer()); > > > setRenderMode(RENDERMODE_CONTINUOUSLY); > > > > >void drawFrame() { > > > >final SurfaceHolder holder = getSurfaceHolder(); > > > > >Canvas c = null; > > > >try { > > > >c = holder.lockCanvas(); > > > >if (c != null) { > > > >// draw something > > > >} > > > >} finally { > > > >if (c != null) > > > >holder.unlockCanvasAndPost(c); > > > >} > > > > >// Reschedule the next
[android-developers] Re: Live Wallpaper --OpenGL Help/Advice.
//I'm not sure this is the correct place //Should this go in OnCreate()? } @Override public void onCreate(SurfaceHolder surfaceHolder) { super.onCreate(surfaceHolder); this.mSurfaceHolder = surfaceHolder; // By default we don't get touch events, so enable them. setTouchEventsEnabled(true); } @Override public void onSurfaceChanged(SurfaceHolder holder, int format, int width, int height) { super.onSurfaceChanged(holder, format, width, height); } @Override public void onSurfaceCreated(SurfaceHolder holder) { super.onSurfaceCreated(holder); } @Override public void onSurfaceDestroyed(SurfaceHolder holder) { super.onSurfaceDestroyed(holder); } @Override public void onOffsetsChanged(float xOffset, float yOffset, float xStep, float yStep, int xPixels, int yPixels) { } /* * Store the position of the touch event so we can use it for drawing later */ @Override public void onTouchEvent(MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_MOVE) { mTouchX = event.getX(); mTouchY = event.getY(); } else { mTouchX = -1; mTouchY = -1; } super.onTouchEvent(event); } void drawFrame() { final SurfaceHolder holder = getSurfaceHolder(); Canvas c = null; try { c = holder.lockCanvas(); if (c != null) { // draw something } } finally { if (c != null) holder.unlockCanvasAndPost(c); } // Reschedule the next redraw mHandler.removeCallbacks(mDrawCube); if (mVisible) { mHandler.postDelayed(mDrawCube, 1000 / 25); } } } @Override public void onAccuracyChanged(Sensor sensor, int accuracy) { } @Override public void onSensorChanged(SensorEvent event) { // TODO Auto-generated method stub Sensor mySensor = event.sensor; mValues[0] = event.values[0]; mValues[1] = event.values[1]; mValues[2] = event.values[2]; } } Thanks for any analysis! I'm extending the code found here: http://www.rbgrn.net/content/354-glsurfaceview-adapted-3d-live-wallpapers On Feb 14, 4:19 am, joshbeck wrote: > I was afraid you might say that: > I've gone through and incorporated GLWallpaperService per his > instructions, but specifically I'm getting hung up here: > --QUOTE-- > In your GLEngine subclass, instantiate your Renderer, configure it and > set it using setRenderer(Renderer) and setRenderMode(int). > --/QUOTE-- > (http://www.rbgrn.net/content/354-glsurfaceview-adapted-3d-live- > wallpapers) > > Logcat is throwing a null pointer exception at line 79 in > GLWallpaperService.java which reads as follows: > ---LOGCAT ERROR-- > @Override > public void onSurfaceCreated(SurfaceHolder holder) { > Log.d(TAG, "onSurfaceCreated()"); > mGLThread.surfaceCreated(holder); <--Right Here Line 79 > super.onSurfaceCreated(holder);} > > ---END LOGCAT ERROR--- > > The following class works perfectly within an Activity for me: > --BEGIN CLASS-- > public class OpenGLRenderer implements Renderer { > //Should it be GLSurfaceView.Renderer? <-- > > private Square square; > private float angle = 45f; > public OpenGLRenderer() { > > square = new Square(); > //I have a square class that defines verts and > such. > } > > public void onSurfaceCreated(GL10 gl, EGLConfig config) { > --Clear the screen and prep it-- > } > > public void onDrawFrame(GL10 gl) { > --This function draws and rotates my object-- > } > public void onSurfaceChanged(GL10 gl, int width, int height) { > > --The code I have here also checks out in an Activity-- > } > } > > ---END CLASS--- > > -My Initial class extends GLWallpaperService --onCreate() as > follows:-- > > public void onCreate() { > GLSurfaceView mGLSurfaceView = new GLSurfaceView(this); > //I have a feeling this is misplaced. > > } > > --My subclass extends GLEngine-- > > class CubeEngine extends GLEngine { > private final Runnable mDrawCube = new Runnable() { >
[android-developers] Re: Live Wallpaper --OpenGL Help/Advice.
I was afraid you might say that: I've gone through and incorporated GLWallpaperService per his instructions, but specifically I'm getting hung up here: --QUOTE-- In your GLEngine subclass, instantiate your Renderer, configure it and set it using setRenderer(Renderer) and setRenderMode(int). --/QUOTE-- (http://www.rbgrn.net/content/354-glsurfaceview-adapted-3d-live- wallpapers) Logcat is throwing a null pointer exception at line 79 in GLWallpaperService.java which reads as follows: ---LOGCAT ERROR-- @Override public void onSurfaceCreated(SurfaceHolder holder) { Log.d(TAG, "onSurfaceCreated()"); mGLThread.surfaceCreated(holder); <--Right Here Line 79 super.onSurfaceCreated(holder); } ---END LOGCAT ERROR--- The following class works perfectly within an Activity for me: --BEGIN CLASS-- public class OpenGLRenderer implements Renderer { //Should it be GLSurfaceView.Renderer? <-- private Square square; private float angle = 45f; public OpenGLRenderer() { square = new Square(); //I have a square class that defines verts and such. } public void onSurfaceCreated(GL10 gl, EGLConfig config) { --Clear the screen and prep it-- } public void onDrawFrame(GL10 gl) { --This function draws and rotates my object-- } public void onSurfaceChanged(GL10 gl, int width, int height) { --The code I have here also checks out in an Activity-- } } ---END CLASS--- -My Initial class extends GLWallpaperService --onCreate() as follows:-- public void onCreate() { GLSurfaceView mGLSurfaceView = new GLSurfaceView(this); //I have a feeling this is misplaced. } --My subclass extends GLEngine-- class CubeEngine extends GLEngine { private final Runnable mDrawCube = new Runnable() { public void run() { //Does Nothing ATM } }; private boolean mVisible; CubeEngine() { //Blank Constructor } @Override public void onCreate(SurfaceHolder surfaceHolder) { super.onCreate(surfaceHolder); mGLSurfaceView.setRenderer(new OpenGLRenderer()); //This setRenderer is what I need help with. // By default we don't get touch events, so enable them. setTouchEventsEnabled(true); } --I don't think I need to override the things like onSurfaceChanged here, because I think that my OpenGLRenderer Class handles that, or at least it should. -- Thanks for being patient with me. I'll sort it all out in time I'm sure. Just getting an OpenGL object to work correctly in a regular Activity was a giant leap! Josh Beck Northeast ISD Humble Android Apprentice. On Feb 14, 3:03 am, Lance Nanek wrote: > http://groups.google.com/group/android-developers/browse_thread/threa... > > On Feb 14, 3:06 am, joshbeck wrote: > > > > > Hello all, > > > I can construct an Activity that utilized OpenGL to draw a square, set > > properties, and > > make it rotate around a fixed point by implementing > > android.opengl.GLSurfaceView,Renderer > > and configuring: > > > public void onSurfaceCreated(GL10 gl, EGLConfig config) {} > > > public void onDrawFrame(GL10 gl) {} > > > public void onSurfaceChanged(GL10 gl, int width, int height) {} > > > -Separately > > > I can construct a live wallpaper by drawing an image (Bitmap) to a > > Canvas > > as specified at: > > >http://developer.android.com/resources/samples/CubeLiveWallpaper/inde... > > > My Question: > > > I'm trying to figure out how to create a GLSurface and draw to it > > within a Live Wallpaper. > > I'm all about doing research. So, any advice is appreciated. > > > The Simple Cube wallpaper demo Google provided was VERY helpful. > > I think a lot of folks would like to see something along those except > > with an OpenGL cube in mind. > > > --Much appreciated. I'm totally new to OpenGL. > > > Josh Beck -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Live Wallpaper --OpenGL Help/Advice.
Hello all, I can construct an Activity that utilized OpenGL to draw a square, set properties, and make it rotate around a fixed point by implementing android.opengl.GLSurfaceView,Renderer and configuring: public void onSurfaceCreated(GL10 gl, EGLConfig config) {} public void onDrawFrame(GL10 gl) {} public void onSurfaceChanged(GL10 gl, int width, int height) {} -Separately I can construct a live wallpaper by drawing an image (Bitmap) to a Canvas as specified at: http://developer.android.com/resources/samples/CubeLiveWallpaper/index.html My Question: I'm trying to figure out how to create a GLSurface and draw to it within a Live Wallpaper. I'm all about doing research. So, any advice is appreciated. The Simple Cube wallpaper demo Google provided was VERY helpful. I think a lot of folks would like to see something along those except with an OpenGL cube in mind. --Much appreciated. I'm totally new to OpenGL. Josh Beck -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 Programming Class
Hello everyone: I teach an 8th grade programming class in San Antonio Texas. We're learning Android and I convinced the school to buy us 3 dev phones for the kids. Here's an article about what we're doing: http://www.neisd.net/ComRel/News/Krueger_Smartphone_10.htm I'd like to purchase a netbook to supplement the phones so that when the students check them out, they have an out-of-the-box programming environment within which the phones work. I've put together a donation page. My goal is to raise $350 dollars for a netbook to go along with these devices. If you can donate $1, $5, or $10 to help my class out, it would be greatly appreciated. http://www.linuxclassroom.com/donation/donate.html Thanks so much for considering it! Josh Beck -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Phone Calls
Apparently my home phone number, where my wife and kid are asleep at 7:30, is listed directly under my application. I'm good for customer support. I just prefer, and I would imagine google might agree with this, to take care of people over email. Does my developer number have to remain there? (The sub text next to the profile page number clearly indicated it would not be distributed to third parties.) Does anyone have any thoughts on the phone number placement? I think we should have an option there. Any help is apprecaited? Josh Beck --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: TERRIBLE BUG IN MARKET APPLICATION (was Re: Paid apps related questions discussion list?)
I agree. I've worked pretty darn hard to produce a clean application. The end-user is going to blame the developer most of the time on this one. It's a frustrating situation that I hope Google makes a top priority. On Feb 21, 8:15 pm, Stoyan Damov wrote: > That is, while I care about bad ratings (people are giving 1 star when > they have any of the problems in my previous post) I care more about > frustrated users CANCELLING their orders because of these issues. I > was JUST about to have 1 cancel because of the update problems (in > this case the "Force Close" dialog problem). > > On Sun, Feb 22, 2009 at 4:13 AM, Stoyan Damov wrote: > > I am SICK AND TIRED of typing and pasting the SAME thing OVER and OVER > > again today - "if you have any issues with the application after an > > update, please re-install it". > > > Could someone at Google FINALLY do something about it? It's been > > dozens of users today. I can only guess when paid apps-enabled Market > > app spreads to all users. > > The issues are (for the Nth time): hanging download, hanging install, > > "Force close" dialog at startup. > > FWIW it doesn't matter if the application is free or paid (had issues > > with both), or is protected or not (had issues with both). > > > On Sat, Feb 21, 2009 at 10:53 PM, Jon Colverson wrote: > >> - Show quoted text - > >> On Feb 21, 3:24 pm, Stoyan Damov wrote: > >>> Is there a dedicated list for developers who have paid apps in Android > >>> Market? It would be best if that list has at least 1 *Google* (not > >>> Android, i.e. I don't need it to be technically savvy) employee able > >>> to give sensible answers to WTF questions related to the Market and > >>> paid apps? > > >> This would seem to be the official place: > >>http://www.google.com/support/forum/p/Android+Market > > >> -- > >> Jon > >> - 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: Unable to Download Paid App Upgrade
This is a very bad situation indeed as my app relies on regular updates! I hope they prioritize this. On Feb 22, 2:30 pm, Stoyan Damov wrote: > http://www.google.com/support/forum/p/Android+Market/label?lid=7dc8a5... > > Basically, you're not the only one. A reinstall helps in most cases. > > On Sun, Feb 22, 2009 at 9:52 PM, joshbeck wrote: > > > Hello All, > > -I have a paid app on the market. > > -I uploaded an upgrade > > -The market download manager hangs on 'Starting Download' when I try > > to download the newest version. > > > -Has anyone experienced this? > > > (If the problem is resolved shortly, I'll post here.) > > > Thanks, > > Josh Beck --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Unable to Download Paid App Upgrade
Hello All, -I have a paid app on the market. -I uploaded an upgrade -The market download manager hangs on 'Starting Download' when I try to download the newest version. -Has anyone experienced this? (If the problem is resolved shortly, I'll post here.) Thanks, Josh Beck --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Paid App Question
If a Person Purchase my app through the store, and I push out an update, I would assume they will be eligible for the update free of charge. Can anyone confirm this? Also I'm interested in seeing how the end user will see the price and be prompted whether or not to purchase. Thanks, Josh Beck --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: MapActivity Problem --Debugs but won't launch from signed apk.
--PROBLEM SOLVED-- The Code Above will generate a simple map if you use a correct api key. (Which I was using.) Here is why the application wouldn't launch: I ran the program with the phone plugged in using Eclipse->Run As- >Android Application: -This ran the map activity, but only displayed a grid because the api key is designed to be used with a signed apk. Running directly from eclipse installs an unsigned package. (I figured this was the case.) -Then, I tried to install the apk via my web server and it spit out a signature mismatch error. -It also said it couldn't install the app in the app directory. It turns out that running the application via eclipse on the phone and then trying to install the apk triggers a signature error. (I can only assume this is because the version run directly from eclipse has no signature and the apk has a good one. This conflict, I think, triggers an error. --invalid signature. The O/ S assumes the first signature is the good one?) Solution: I found the application via the settings manager and manually uninstalled it. It was identified as 'mymap.' (See Manifest Above) Once I uninstalled it, the apk installed cleanly without any conflicts and the map appeared . Anyway, I hope this helps someone in the future. It's Alive! You guys are great, Josh On Dec 10, 6:23 am, Ludwig <[EMAIL PROTECTED]> wrote: > I would assume that there is an additional check on the app that there is a > map key for it on the phone that is not present in the emulator. Try it with > a map key and see what happens on the phone. > Ludwig > > 2008/12/10 joshbeck <[EMAIL PROTECTED]> > > > > > Problem: > > -I have the simplest MapActivity known to Android. (Code Below) > > -In Eclipse I run as->Android Application (G1 connected in debug > > mode.) > > -Works fine. Gray Grid is displayed. > > -Once I export, sign, and download it to my phone as an apk it says: > > -Install Successful! > > -The 'LAUNCH' button is grayed out. (Can't launch it.) > > -The application doesn't appear anywhere on the phone. > > -I do have '3rd Party Apps' enabled. > > Any help or insight is appreciated! > > Thanks, > > Josh Beck > > > Here is my code: > > -- > > maptest.java > > -- > > > imports --ALL CORRECT-- > > > public class maptest extends MapActivity { > > protected MapView MyMapView = null; > > [EMAIL PROTECTED] > > public void onCreate(Bundle savedInstanceState) { > > super.onCreate(savedInstanceState); > > MyMapView = new MapView > > (this,"MyApiKeyDerivedFromKeystoreMD5"); > > setContentView(MyMapView); > > } > > > [EMAIL PROTECTED] > > protected boolean isRouteDisplayed() { return false; } > > } > > > - > > MANIFEST > > > > > > > http://schemas.android.com/apk/res/android"; > > package="com.android.maptest"> > > > > > > > > > > > > > > > > > > android:name="android.intent.category.LAUNCHER" /> > > > > > > > > > > > Any idea why it would debug but not run when installed as an apk? > > > Thank you for any insight --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google 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 -~--~~~~--~~--~--~---
[android-developers] Re: MapActivity Problem --Debugs but won't launch from signed apk.
Hello there, Thanks for the response. I debug using the actual device, but you are right. It probably treats the phone as if it were the emulator in that case. I've followed the directions and obtained an MD5 fingerprint of my keystore. I used the sign-up form and passed it the fingerprint in the form of XX:XX:XX ... etc. The form returned an api key, which I actually use in the place of this: MyMapView = new MapView (this,"MyApiKeyDerivedFromKeystoreMD5"); Logcat isn't giving me any useful information that might help me determine the cause. -Questions -How can I trouble shoot my api key to be sure it is not the root cause of the problem? (i.e. incorrect) -Does anyone know if there really is a check against the api key that would prevent the application from launching? (This would mean that map activities require network access in order to be launched?) Thanks again, Josh Beck On Dec 10, 6:23 am, Ludwig <[EMAIL PROTECTED]> wrote: > I would assume that there is an additional check on the app that there is a > map key for it on the phone that is not present in the emulator. Try it with > a map key and see what happens on the phone. > Ludwig > > 2008/12/10 joshbeck <[EMAIL PROTECTED]> > > > > > Problem: > > -I have the simplest MapActivity known to Android. (Code Below) > > -In Eclipse I run as->Android Application (G1 connected in debug > > mode.) > > -Works fine. Gray Grid is displayed. > > -Once I export, sign, and download it to my phone as an apk it says: > > -Install Successful! > > -The 'LAUNCH' button is grayed out. (Can't launch it.) > > -The application doesn't appear anywhere on the phone. > > -I do have '3rd Party Apps' enabled. > > Any help or insight is appreciated! > > Thanks, > > Josh Beck > > > Here is my code: > > -- > > maptest.java > > -- > > > imports --ALL CORRECT-- > > > public class maptest extends MapActivity { > > protected MapView MyMapView = null; > > [EMAIL PROTECTED] > > public void onCreate(Bundle savedInstanceState) { > > super.onCreate(savedInstanceState); > > MyMapView = new MapView > > (this,"MyApiKeyDerivedFromKeystoreMD5"); > > setContentView(MyMapView); > > } > > > [EMAIL PROTECTED] > > protected boolean isRouteDisplayed() { return false; } > > } > > > - > > MANIFEST > > > > > > > http://schemas.android.com/apk/res/android"; > > package="com.android.maptest"> > > > > > > > > > > > > > > > > > > android:name="android.intent.category.LAUNCHER" /> > > > > > > > > > > > Any idea why it would debug but not run when installed as an apk? > > > Thank you for any insight --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google 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 -~--~~~~--~~--~--~---
[android-developers] MapActivity Problem --Debugs but won't launch from signed apk.
Problem: -I have the simplest MapActivity known to Android. (Code Below) -In Eclipse I run as->Android Application (G1 connected in debug mode.) -Works fine. Gray Grid is displayed. -Once I export, sign, and download it to my phone as an apk it says: -Install Successful! -The 'LAUNCH' button is grayed out. (Can't launch it.) -The application doesn't appear anywhere on the phone. -I do have '3rd Party Apps' enabled. Any help or insight is appreciated! Thanks, Josh Beck Here is my code: -- maptest.java -- imports --ALL CORRECT-- public class maptest extends MapActivity { protected MapView MyMapView = null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); MyMapView = new MapView (this,"MyApiKeyDerivedFromKeystoreMD5"); setContentView(MyMapView); } @Override protected boolean isRouteDisplayed() { return false; } } - MANIFEST http://schemas.android.com/apk/res/android"; package="com.android.maptest"> Any idea why it would debug but not run when installed as an apk? Thank you for any insight --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google 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 -~--~~~~--~~--~--~---
[android-developers] Re: Out Of Memory issue
My bad. I'll defer to Romain on this. My apologies. Josh Beck On Dec 9, 8:36 am, Romain Guy <[EMAIL PROTECTED]> wrote: > There is absolutely no such limitation of 640k. > > On Dec 9, 2008 6:21 AM, "joshbeck" <[EMAIL PROTECTED]> wrote: > > I can maybe help here. I'm an amateur, but the 'out of memory' error > is > a familiar adversary. > > The VM only allows you to use 640k at any given time. > I have a program that utilizes hundreds of large bitmap files. Here is > how I > decided to handle it. (It's clunky and inefficient, but it works.) > > -I keep solid track of how much memory is being used at any given > time. > Once the program gets anywhere near 500k, (Just to be safe), > I find a way to call finish, recycle bitmaps, and call an intent to > start a fresh activity. If it's possible to start a fresh activity > when > the memory limit gets close, you may want to consider that > as an option. > > -Also, if you are using images. Load your pics into photoshop or the > Gimp > and make sure they physically as small as you can get them. > > I don't know if any of that will help, but I've learned the hard way > that the 600k ceiling for > memory is something you have to keep a count on. > > Josh Beck > > On Dec 9, 7:07 am, Guillaume Perrot <[EMAIL PROTECTED]> wrote: > When > we have an OutOfMemor... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google 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 -~--~~~~--~~--~--~---
[android-developers] Re: Out Of Memory issue
I can maybe help here. I'm an amateur, but the 'out of memory' error is a familiar adversary. The VM only allows you to use 640k at any given time. I have a program that utilizes hundreds of large bitmap files. Here is how I decided to handle it. (It's clunky and inefficient, but it works.) -I keep solid track of how much memory is being used at any given time. Once the program gets anywhere near 500k, (Just to be safe), I find a way to call finish, recycle bitmaps, and call an intent to start a fresh activity. If it's possible to start a fresh activity when the memory limit gets close, you may want to consider that as an option. -Also, if you are using images. Load your pics into photoshop or the Gimp and make sure they physically as small as you can get them. I don't know if any of that will help, but I've learned the hard way that the 600k ceiling for memory is something you have to keep a count on. Josh Beck On Dec 9, 7:07 am, Guillaume Perrot <[EMAIL PROTECTED]> wrote: > When we have an OutOfMemoryError (either the MapView or huge images): > we have a message (in logs) like > "The VM won't allow us to allocate x bytes" or something like "VM > budget exceeded" > I think it's a VM limitation. > > On Dec 8, 11:09 pm, Mark K <[EMAIL PROTECTED]> wrote: > > > I've run into similar problems when rendering or successively > > rendering large bitmaps, can't tell if this is a specific bug, or just > > a limitation of the jvm. I haven't yet found a way to mitigate the > > problem. > > > Mark > > > On Dec 8, 12:47 pm, elephantbug <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > Our application sometimes runs out of memory, especially on the map > > > view. Below it the exception we got, anyone can give any hint about > > > what might be the cause? Is there any known issue about MapView? > > > > W/System.err( 193): OutOfMemory > > > E/MapView ( 193): IllegalStateException on drawMap. Wiping cache. > > > E/MapView ( 193): java.lang.IllegalStateException: null image > > > E/MapView ( 193): at com.google.googlenav.map.MapTile.getImage > > > (Unknown Source) > > > E/MapView ( 193): at com.google.googlenav.map.Map.a(Unknown > > > Source) > > > E/MapView ( 193): at com.google.googlenav.map.Map.drawMap > > > (Unknown Source) > > > E/MapView ( 193): at com.google.android.maps.MapView.drawMap > > > (MapView.java:996) > > > E/MapView ( 193): at com.google.android.maps.MapView.onDraw > > > (MapView.java:442) > > > E/MapView ( 193): at android.view.View.draw(View.java:5326) > > > E/MapView ( 193): at android.view.ViewGroup.drawChild > > > (ViewGroup.java:1420) > > > E/MapView ( 193): at android.view.ViewGroup.dispatchDraw > > > (ViewGroup.java:1192) > > > E/MapView ( 193): at android.view.ViewGroup.drawChild > > > (ViewGroup.java:1418) > > > E/MapView ( 193): at android.view.ViewGroup.dispatchDraw > > > (ViewGroup.java:1192) > > > E/MapView ( 193): at android.view.ViewGroup.drawChild > > > (ViewGroup.java:1418) > > > E/MapView ( 193): at android.view.ViewGroup.dispatchDraw > > > (ViewGroup.java:1192) > > > E/MapView ( 193): at android.view.ViewGroup.drawChild > > > (ViewGroup.java:1418) > > > E/MapView ( 193): at android.view.ViewGroup.dispatchDraw > > > (ViewGroup.java:1192) > > > E/MapView ( 193): at android.view.ViewGroup.drawChild > > > (ViewGroup.java:1418) > > > E/MapView ( 193): at android.view.ViewGroup.dispatchDraw > > > (ViewGroup.java:1192) > > > E/MapView ( 193): at android.view.View.draw(View.java:5329) > > > E/MapView ( 193): at android.widget.FrameLayout.draw > > > (FrameLayout.java:324) > > > E/MapView ( 193): at com.android.internal.policy.impl.PhoneWindow > > > $DecorView.draw(PhoneWindow.java:1701) > > > E/MapView ( 193): at android.view.ViewRoot.draw(ViewRoot.java: > > > 980) > > > E/MapView ( 193): at android.view.ViewRoot.performTraversals > > > (ViewRoot.java:829) > > > E/MapView ( 193): at android.view.ViewRoot.handleMessage > > > (ViewRoot.java:1103) > > > E/MapView ( 193): at android.os.Handler.dispatchMessage > > > (Handler.java:88) > > > E/MapView ( 193): at android.os.Looper.loop(Looper.java:123) > > > E/MapView ( 193): at android.app.ActivityThread.main > > > (ActivityThread.java:3742) > > > E/MapView ( 193): at java.lang.reflect.Method.invokeNative > > > (Native Method) > > > E/MapView ( 193): at java.lang.reflect.Method.invoke(Method.java: > > > 515) > > > E/MapView ( 193): at com.android.internal.os.ZygoteInit > > > $MethodAndArgsCaller.run(ZygoteInit.java:739) > > > E/MapView ( 193): at com.android.internal.os.ZygoteInit.main > > > (ZygoteInit.java:497) > > > E/MapView ( 193): at dalvik.system.NativeStart.main(Native > > > Method) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To po
[android-developers] Re: Out Of Memory issue
I can maybe help here. I'm an amateur, but the 'out of memory' error is a familiar adversary. The VM only allows you to use 640k at any given time. I have a program that utilizes hundreds of large bitmap files. Here is how I decided to handle it. (It's clunky and inefficient, but it works.) -I keep solid track of how much memory is being used at any given time. Once the program gets anywhere near 500k, (Just to be safe), I find a way to call finish, recycle bitmaps, and call an intent to start a fresh activity. If it's possible to start a fresh activity when the memory limit gets close, you may want to consider that as an option. -Also, if you are using images. Load your pics into photoshop or the Gimp and make sure they physically as small as you can get them. I don't know if any of that will help, but I've learned the hard way that the 600k ceiling for memory is something you have to keep a count on. Josh Beck On Dec 9, 7:07 am, Guillaume Perrot <[EMAIL PROTECTED]> wrote: > When we have an OutOfMemoryError (either the MapView or huge images): > we have a message (in logs) like > "The VM won't allow us to allocate x bytes" or something like "VM > budget exceeded" > I think it's a VM limitation. > > On Dec 8, 11:09 pm, Mark K <[EMAIL PROTECTED]> wrote: > > > I've run into similar problems when rendering or successively > > rendering large bitmaps, can't tell if this is a specific bug, or just > > a limitation of the jvm. I haven't yet found a way to mitigate the > > problem. > > > Mark > > > On Dec 8, 12:47 pm, elephantbug <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > Our application sometimes runs out of memory, especially on the map > > > view. Below it the exception we got, anyone can give any hint about > > > what might be the cause? Is there any known issue about MapView? > > > > W/System.err( 193): OutOfMemory > > > E/MapView ( 193): IllegalStateException on drawMap. Wiping cache. > > > E/MapView ( 193): java.lang.IllegalStateException: null image > > > E/MapView ( 193): at com.google.googlenav.map.MapTile.getImage > > > (Unknown Source) > > > E/MapView ( 193): at com.google.googlenav.map.Map.a(Unknown > > > Source) > > > E/MapView ( 193): at com.google.googlenav.map.Map.drawMap > > > (Unknown Source) > > > E/MapView ( 193): at com.google.android.maps.MapView.drawMap > > > (MapView.java:996) > > > E/MapView ( 193): at com.google.android.maps.MapView.onDraw > > > (MapView.java:442) > > > E/MapView ( 193): at android.view.View.draw(View.java:5326) > > > E/MapView ( 193): at android.view.ViewGroup.drawChild > > > (ViewGroup.java:1420) > > > E/MapView ( 193): at android.view.ViewGroup.dispatchDraw > > > (ViewGroup.java:1192) > > > E/MapView ( 193): at android.view.ViewGroup.drawChild > > > (ViewGroup.java:1418) > > > E/MapView ( 193): at android.view.ViewGroup.dispatchDraw > > > (ViewGroup.java:1192) > > > E/MapView ( 193): at android.view.ViewGroup.drawChild > > > (ViewGroup.java:1418) > > > E/MapView ( 193): at android.view.ViewGroup.dispatchDraw > > > (ViewGroup.java:1192) > > > E/MapView ( 193): at android.view.ViewGroup.drawChild > > > (ViewGroup.java:1418) > > > E/MapView ( 193): at android.view.ViewGroup.dispatchDraw > > > (ViewGroup.java:1192) > > > E/MapView ( 193): at android.view.ViewGroup.drawChild > > > (ViewGroup.java:1418) > > > E/MapView ( 193): at android.view.ViewGroup.dispatchDraw > > > (ViewGroup.java:1192) > > > E/MapView ( 193): at android.view.View.draw(View.java:5329) > > > E/MapView ( 193): at android.widget.FrameLayout.draw > > > (FrameLayout.java:324) > > > E/MapView ( 193): at com.android.internal.policy.impl.PhoneWindow > > > $DecorView.draw(PhoneWindow.java:1701) > > > E/MapView ( 193): at android.view.ViewRoot.draw(ViewRoot.java: > > > 980) > > > E/MapView ( 193): at android.view.ViewRoot.performTraversals > > > (ViewRoot.java:829) > > > E/MapView ( 193): at android.view.ViewRoot.handleMessage > > > (ViewRoot.java:1103) > > > E/MapView ( 193): at android.os.Handler.dispatchMessage > > > (Handler.java:88) > > > E/MapView ( 193): at android.os.Looper.loop(Looper.java:123) > > > E/MapView ( 193): at android.app.ActivityThread.main > > > (ActivityThread.java:3742) > > > E/MapView ( 193): at java.lang.reflect.Method.invokeNative > > > (Native Method) > > > E/MapView ( 193): at java.lang.reflect.Method.invoke(Method.java: > > > 515) > > > E/MapView ( 193): at com.android.internal.os.ZygoteInit > > > $MethodAndArgsCaller.run(ZygoteInit.java:739) > > > E/MapView ( 193): at com.android.internal.os.ZygoteInit.main > > > (ZygoteInit.java:497) > > > E/MapView ( 193): at dalvik.system.NativeStart.main(Native > > > Method) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To po
[android-developers] Marketplace --Demo vs Full Version--
Hello all, I have an app on the marketplace right now that is doing fairly well. When paid apps arrive, I'd like to change a few variables in my code and republish the code so a 'demo' and a 'full' version exists. I did some experimenting with this about a month ago and I'd like to get some input. If I change the folder structure from, com->mydomain->myapp to com -> mydomain -> myapp_full_version will the marketplace then recognize as a fully independent application? I tried changing the package name in the workspace and tweaking the manifest, but the marketplace transferred everything over and it wasn't seen as a 'new and separate' program. Thanks for any input, Josh Beck --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google 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 -~--~~~~--~~--~--~---
[android-developers] screen orientation question
Hello all, I am trying to determine exactly what happens when the screen orientation changes. (What I mean is, what happens to the lifecycle of an app when the user slides the screen out.) Reason: I show a dialog in my app. If the user slides the screen out, the app crashes with 'View not attached to window manager error.' Is onPause called or something else? I'm thinking if I can slip a progressdialog.dismiss(); into an override, I'll be able to eliminate that particular element when the screen changes. Thanks, Josh Beck --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google 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 -~--~~~~--~~--~--~---
[android-developers] ACTION_VIEW uri.parse options (System Settings)
Ok, If I create a new intent like this: Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market:// search?q=pname:com.android.")); It launches the market. A couple of questions: -Where is this "Market://" uri intent documented? (I can't seem to find it.) -What would I use to send the user directly to the system settings. (Location and Security) Thanks, Josh Beck --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google 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 -~--~~~~--~~--~--~---
[android-developers] Re: Camera Question: Off on Pause?
Question: By calling Camera.stopPreview(); It should also free up the Camera device, right. It's the preview that's drawing power I think. (Anyway, when I handle things that way, I am able to use other Camera apps while mine is pausede, which leads me to believe stopping the preview will conserve battery life.) ? Thanks again, Josh On Nov 22, 3:30 pm, Dave Sparks <[EMAIL PROTECTED]> wrote: > Call the release() method on the Camera object and set it to null. In > onResume, create a new Camera object. > > On Nov 22, 1:23 pm, joshbeck <[EMAIL PROTECTED]> wrote: > > > Here is what my app does: > > > It opens the camera. > > It draws a preview to a surface. > > > Now, if the user pauses the app, > > is the camera still siphoning the battery? > > > How can I make sure it is off? > > > Thanks > > Josh Beckhttp://globedroid.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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Camera Question: Off on Pause?
Thank you. On Nov 22, 3:30 pm, Dave Sparks <[EMAIL PROTECTED]> wrote: > Call the release() method on the Camera object and set it to null. In > onResume, create a new Camera object. > > On Nov 22, 1:23 pm, joshbeck <[EMAIL PROTECTED]> wrote: > > > Here is what my app does: > > > It opens the camera. > > It draws a preview to a surface. > > > Now, if the user pauses the app, > > is the camera still siphoning the battery? > > > How can I make sure it is off? > > > Thanks > > Josh Beckhttp://globedroid.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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Camera Question: Off on Pause?
Here is what my app does: It opens the camera. It draws a preview to a surface. Now, if the user pauses the app, is the camera still siphoning the battery? How can I make sure it is off? Thanks Josh Beck http://globedroid.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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Write PNG to PIcture Directory (FileOutputStream)
Actually, that code above isn't quite correct. I am writing png files to the sdcard with no problem. I'd like them to show up when the user chooses wallpaper - > Pictures or camera -> menu -> Pictures. Are those displays databased or something? Thanks again, Josh Beck --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google 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 -~--~~~~--~~--~--~---
[android-developers] Write PNG to PIcture Directory (FileOutputStream)
Hello all, How can I write an image so that it shows up under 'Pictures'? I've got a FileOutputStream like this: --Mypic is a valid bitmap. try { FileOutputStream stream = super.openFileOutput("picture.png", MODE_PRIVATE); Mypic.compress(CompressFormat.PNG, 100, stream); stream.flush(); stream.close(); }catch(Exception e) {Log.e("MyLog", e.toString()); } Any help is appreciated. Josh Beck --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google 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 -~--~~~~--~~--~--~---
[android-developers] extend MapActivity not Working
I am trying to extend the MapActivity class, but it's stumping me tonight. Notes: The first This post contains: -Working Code -Non-Working Code --I only change the extend MapActivity line and add unimplemented isRouteDisplayed() -- -Error Log Any Insight is Appreciated. Thank you all so much! (Imports omitted) Working Code: = -Begin Working Code--- public class GpsTest extends Activity{ public String test; TextView mine; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mycontrols(); } public void mycontrols() { mine = (TextView)findViewById(R.id.mytext); test = "Wassup"; mine.setText(test); } } End Working Code == Begin Non-Working Code--- //Now I'm extending MapActivity public class GpsTest extends MapActivity{ public String test; TextView mine; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mycontrols(); } public void mycontrols() { mine = (TextView)findViewById(R.id.mytext); test = "Wassup"; mine.setText(test); } //required override @Override protected boolean isRouteDisplayed() { // TODO Auto-generated method stub return false; } } End Non Working Code Error Log (Truncated) 11-14 05:29:56.810: ERROR/AndroidRuntime(725): Uncaught handler: thread main exiting due to uncaught exception 11-14 05:29:56.821: ERROR/AndroidRuntime(725): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.android.gpstest/com.android.gpstest.GpsTest}: java.lang.ClassNotFoundException: com.android.gpstest.GpsTest in loader [EMAIL PROTECTED] End Error Log Any advice is 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: System Timeout: Force Close/Wait
Thank You. That helps On Nov 8, 1:58 pm, Romain Guy <[EMAIL PROTECTED]> wrote: > Hi, > > No, you cannot change this timeout. If you see this message that means > your application is blocking the UI (or main) thread. The problem is > in your implementation; you should be using background threads > instead. Any "long" operation (anything that might take more than half > a second or so; and even half a second is very long) should be > performed in a background thread. > > On Sat, Nov 8, 2008 at 10:59 AM, joshbeck <[EMAIL PROTECTED]> wrote: > > > Is there a way to increase the system timeout so it won't throw the > > 'Force Close' screen so soon. > > I have an app that relies on web requests, and if they take too long, > > the user gets the Force Close > > prompt. (Push Wait and it works fine.) > > > Thanks! > > Josh Beck > > -- > Romain Guywww.curious-creature.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] System Timeout: Force Close/Wait
Is there a way to increase the system timeout so it won't throw the 'Force Close' screen so soon. I have an app that relies on web requests, and if they take too long, the user gets the Force Close prompt. (Push Wait and it works fine.) Thanks! Josh Beck --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google 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 -~--~~~~--~~--~--~---
[android-developers] Re: Use Bundle to Pass Bitmap
--Solved-- The answer seems to be. 'No.' It's inefficient, and the phone needs all the resources you can give it. Josh Beck On Nov 6, 5:42 pm, joshbeck <[EMAIL PROTECTED]> wrote: > Is it possible to pass a bitmap between activities using a bundle? > > Thanks, > Josh Beck --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google 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 -~--~~~~--~~--~--~---
[android-developers] Button Resource Invalid?
Ok, I am trying to get a button to pop up. When I add : b.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { int z = 5; } Logcat tells me the resource is invalid. Code: b.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { int z = 5; } } XML: <-- I have a strong hunch I'm doing something wrong here. (Everything is right up to the button entry) http://schemas.android.com/apk/res/ android" android:layout_width="fill_parent" android:layout_height="fill_parent"> 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Thread Question
First, thanks. I tried blocking the main thread, and quickly determined it wasn't a good idea. Didn't solve anything, but hey at least I know now. Here's what I'm working on: I have an application. It downloads a bunch of data and then loads that data into variables which are used to present the user with an initial display. If I load the variables and show the display the screen just goes black for like 20-30 seconds. If I background the thread, the variables aren't loaded prior to the display being drawn. Ideally, I'd like to use the progressbar to show a loading screen, but the loading bar doesn't show up unless the primary view is ready. I'm think the solution is to have the program start an initial activity that is small and prompts the user for a button press. That button press then activates a thread/ progress bar which in turn uses an intent to open the "primary" view. Make sense? If I have two separate activity files working in the same project, can I create public variables that are shared? Thanks, Josh Beck On Nov 6, 1:44 pm, Guillaume Perrot <[EMAIL PROTECTED]> wrote: > You should not use the following in your case but there is a simple > way to wait for a thread to complete, it's the Thread.join() function. > This should be called only in a background thread which need to > synchronize with another background thread for some reason. > You should (i'd say must) never call blocking functions in the main > thread. > > On Nov 6, 8:53 am, hackbod <[EMAIL PROTECTED]> wrote: > > >http://code.google.com/android/intro/appmodel.html > > > The last section is on threads, though it's strongly recommended you > > read the whole thing. > > > On Nov 5, 9:58 pm, joshbeck <[EMAIL PROTECTED]> wrote: > > > > I'm fairly new at this and just to the point where threading makes > > > sense. > > > So, my my main process is also considered a thread? > > > > True --- False > > > > I write a simple HelloWorld.java program. > > > This program has 1 thread, the main flow of execution. > > > > ? > > > > Thanks, > > > Josh > > > > On Nov 5, 7:26 pm, hackbod <[EMAIL PROTECTED]> wrote: > > > > > If the thread takes a while to complete, your main application thread > > > > probably shouldn't wait for it to complete... otherwise, what's the > > > > point of putting that work in the thread, if you're just going to > > > > block on it at some point. > > > > > Instead, consider using a Handler to post a message back to the main > > > > thread when the background thread has finished its work. > > > > > On Nov 5, 3:54 pm, joshbeck <[EMAIL PROTECTED]> wrote: > > > > > > I have a function that utilizes a thread. > > > > > > A variable the is needed for the program is populated after the thread > > > > > call is made. > > > > > > The thread takes a while to complete. > > > > > > How can I make the program wait for a thread to complete before moving > > > > > on? > > > > > > Thanks, > > > > > Josh Beck --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google 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 -~--~~~~--~~--~--~---
[android-developers] Use Bundle to Pass Bitmap
Is it possible to pass a bitmap between activities using a bundle? Thanks, Josh Beck --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google 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 -~--~~~~--~~--~--~---
[android-developers] Re: How to install software in the G1
I use a Tomcat webserver. You have to set the MIME settings so they recognize .apk files and serve them correctly. Josh Beck On Nov 6, 7:25 am, "dailyLife"<[EMAIL PROTECTED]> wrote: > My os is Windows ,IEDeclipse > How to install software in the G1. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google 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 -~--~~~~--~~--~--~---
[android-developers] Re: Thread Question
I'm fairly new at this and just to the point where threading makes sense. So, my my main process is also considered a thread? True --- False I write a simple HelloWorld.java program. This program has 1 thread, the main flow of execution. ? Thanks, Josh On Nov 5, 7:26 pm, hackbod <[EMAIL PROTECTED]> wrote: > If the thread takes a while to complete, your main application thread > probably shouldn't wait for it to complete... otherwise, what's the > point of putting that work in the thread, if you're just going to > block on it at some point. > > Instead, consider using a Handler to post a message back to the main > thread when the background thread has finished its work. > > On Nov 5, 3:54 pm, joshbeck <[EMAIL PROTECTED]> wrote: > > > I have a function that utilizes a thread. > > > A variable the is needed for the program is populated after the thread > > call is made. > > > The thread takes a while to complete. > > > How can I make the program wait for a thread to complete before moving > > on? > > > Thanks, > > Josh Beck --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google 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 -~--~~~~--~~--~--~---
[android-developers] Thread Question
I have a function that utilizes a thread. A variable the is needed for the program is populated after the thread call is made. The thread takes a while to complete. How can I make the program wait for a thread to complete before moving on? Thanks, Josh Beck --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google 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 -~--~~~~--~~--~--~---
[android-developers] Re: Create Drawable and Store Resource from Bitmap
No, I'm not aware of that group, but I'll be sure to read up there as I qualify. Thank you for that concise answer. It makes perfect sense. Thank you. On Nov 4, 7:44 pm, Steve Oldmeadow <[EMAIL PROTECTED]> wrote: > > How do I convert and store the bm object so that I can reference it > > with a drawable > > integer id ? > > You are getting confused between Drawable objects and static resources > stored under drawable. If you need a Drawable Bitmap use > BitmapDrawable. Otherwise if your image is stored in the drawable > directory then there will be an id for it in the R file. > > Are you aware of the Android Beginners group? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google 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 -~--~~~~--~~--~--~---
[android-developers] Create Drawable and Store Resource from Bitmap
I need a series of images loaded into an array like this: // Load an array with BitmapDrawable resources. private Integer[] mThumbIds = { R.drawable.sample_thumb_0, R.drawable.sample_thumb_1, R.drawable.sample_thumb_2, R.drawable.sample_thumb_3, R.drawable.sample_thumb_4 }; Right now I have Bitmap bm = Valid_Bitmap_Image How do I convert and store the bm object so that I can reference it with a drawable integer id ? Thank You! Josh Beck --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google 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 -~--~~~~--~~--~--~---
[android-developers] Re: Question about View, Canvas, and Drawable.. --Basics
I'll go ahead and add this too: I wrote two programs last night: -One added a Drawable to an ImageView Layout. -The other used onDraw and invalidate to repeatedly render out a canvas. Under what circumstances is the Drawable beneficial is my question I guess. Thanks again, Josh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Question about View, Canvas, and Drawable.. --Basics
Hello all, Is this correct? View: The android screen is divided up into views. Views are basic layout objects. Canvas: You need to have at least one canvas if you want to do any drawing. Each view potentially has its own canvas. Drawable: ---)This is where my 10:30 bedtime turns into a 2:30 am nap in the chair before work.) -What is the difference between a Bitmap and a Drawable? Can Drawables only be used with ImageView Views? Thanks for any help. Josh Beck --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google 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 -~--~~~~--~~--~--~---
[android-developers] Simple Level App
Ok, so I wrote an app tonight that reads the 'Roll' data from the compass and levels a line on the screen. (It's on marketplace. It's also here: http://www.imakmud.com/level.apk ) --Source Code Below: Here's how it works: -Basically every time the compass data changes, the canvas is rotated and redrawn. It's very fast I think. Problems I'm experiencing: What I've got there is a single view with a single canvas. I'd like to incorporate some static elements like a pointers that don't rotate with the rest of the canvas. I experimented with drawables, but I'm just not sure that's the answer. So, I'm looking to have multiple graphics on the screen. One rotates, the others don't. Any direction is appreciated. --God this device is awesome! Here is the Simple Level Code with comments as I understand the program to be working: (Please correct me where I am wrong.) I hope it helps other, and I hope other developers are able to chime in. -Look for the //LOOK HERE comment.- --ALL IMPORTS CORRECT-- public class level extends Activity { private static final String TAG = "Compass"; private Bitmap mBitmap; private SensorManager mSensorManager; private SampleView mView; private float[] mValues; //SensorListener is called by the SensorManager object returned in OnCreate private final SensorListener mListener = new SensorListener() { public void onSensorChanged(int sensor, float[] values) { if (Config.LOGD) Log.d(TAG, "sensorChanged (" + values[0] + ", " + values[1] + ", " + values[2] + ")"); //mValues contains direction, yaw, and roll. mValues = values; if (mView != null) { mView.invalidate(); } } public void onAccuracyChanged(int sensor, int accuracy) { // TODO Auto-generated method stub } }; @Override protected void onCreate(Bundle icicle) { super.onCreate(icicle); mSensorManager = (SensorManager)getSystemService(Context.SENSOR_SERVICE); mView = new SampleView(this); //SampleView(); is called here. So is onDraw? //Question: if a view is defined here through an xml file, is onDraw still called by default? // Is that even right to assume onDraw is called here? setContentView(mView); } @Override protected void onResume() { if (Config.LOGD) Log.d(TAG, "onResume"); super.onResume(); mSensorManager.registerListener(mListener, SensorManager.SENSOR_ORIENTATION, SensorManager.SENSOR_DELAY_GAME); } @Override protected void onStop() { if (Config.LOGD) Log.d(TAG, "onStop"); mSensorManager.unregisterListener(mListener); super.onStop(); } private class SampleView extends View { private Paint mPaint = new Paint(); private PathmPath = new Path(); private boolean mAnimate; private longmNextTime; public SampleView(Context context) { super(context); //Maybe onDraw is called at this point? } //Because mView.invalidate is called in SensorListener, we can count on onDraw everytime //there is a change of state. @Override protected void onDraw(Canvas canvas) { Paint paint = mPaint; canvas.drawColor(Color.BLACK); paint.setAntiAlias(true); paint.setColor(Color.BLACK); paint.setStyle(Paint.Style.FILL); if (mValues != null) { float rotateme = mValues[2]; //LOOK HERE //Can I put two canvases in action? //Should I use a drawable for two separately rotating objects? //??? --Any advice is appreciated. canvas.rotate(rotateme, 160, 240 ); } mBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.line2); canvas.drawBitmap(mBitmap, 0, 0, mPaint); } @Override protected void onAttachedToWindow() { mAnimate = true; super.onAttachedToWindow(); } @Override protected void onDetachedFromWindow() { mAnimate = false; super.onDetachedFromWindow(); } } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google 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 -~--~~~~--~~--~--~---
[android-developers] All apps are free right now?
It seems like all of tha apps on the marketplace are free right now. I'm trying to find some information about why this is. Thanks, great help here. Josh Beck --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google 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 -~--~~~~--~~--~--~---
[android-developers] Re: Changing the system Wallpaper --Intent Broadcast ?--
Thank you very much. I'll look it up. Much appreciated. prospero --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google 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 -~--~~~~--~~--~--~---
[android-developers] Re: Changing the system Wallpaper --Intent Broadcast ?--
The process number of my application was 3447. It says: CAUSED by: java.lang.SecurityException: Access denied to process: 3447 must have permission android.permission.SET_WALLPAPER This is the emulator. Any idea how to grant permission? Thanks, On Nov 2, 4:05 pm, Romain Guy <[EMAIL PROTECTED]> wrote: > What is the exception you see in logcat? > > > > On Sun, Nov 2, 2008 at 2:01 PM, joshbeck <[EMAIL PROTECTED]> wrote: > > > Ok, I have a short program written that I'd like to see change the > > system wallpaper. > > I use setWallpaper(Bitmap bitmap); > > It is crashing my system. > > I think it is because it is broadcasting an intent and I'm > > not set up to receive it correctly. > > Any help is appreciated. Thank you! > > > --Here is the code: Look at the try block for my comment-- > > > import --ALL IMPORTS CORRECT-- > > > public class wallpaper1 extends Activity { > > /** Called when the activity is first created. */ > > SampleView mview; > > [EMAIL PROTECTED] > > public void onCreate(Bundle savedInstanceState) { > > super.onCreate(savedInstanceState); > > mview = new SampleView(this); > > > setContentView(mview); > > > } > > > private static class SampleView extends View { > > > private Canvas mCanvas; > > private final Paint mPaint; > > private Bitmap mBitmap; > > private Drawable mdrawable; > > private string wallstring; > > public SampleView(Context context) { > > > super(context); > > > mPaint = new Paint(); > > mPaint.setAntiAlias(true); > > mPaint.setARGB(255, 255, 255, 255); > > > try { > > > //This line right here crashes the program > > // The graphic darkcleanlinux is valid. (640x480) > > // The API for setWallpaper states that an intent > > // ACTION_WALLPAPER_CHANGED is broadcast. > > //Do I need to set up a listener? How? > > > > context.setWallpaper(BitmapFactory.decodeResource(getResources(), > > R.drawable.darkcleanlinux)); > > > mdrawable = context.getWallpaper(); > > > } catch (IOException e) { > > //TODO Auto-generated catch block > > e.printStackTrace(); > > } > > > } > > > } > > } > > -- > Romain Guywww.curious-creature.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Changing the system Wallpaper --Intent Broadcast ?--
Ok, I have a short program written that I'd like to see change the system wallpaper. I use setWallpaper(Bitmap bitmap); It is crashing my system. I think it is because it is broadcasting an intent and I'm not set up to receive it correctly. Any help is appreciated. Thank you! --Here is the code: Look at the try block for my comment-- import --ALL IMPORTS CORRECT-- public class wallpaper1 extends Activity { /** Called when the activity is first created. */ SampleView mview; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mview = new SampleView(this); setContentView(mview); } private static class SampleView extends View { private Canvas mCanvas; private final Paint mPaint; private Bitmap mBitmap; private Drawable mdrawable; private string wallstring; public SampleView(Context context) { super(context); mPaint = new Paint(); mPaint.setAntiAlias(true); mPaint.setARGB(255, 255, 255, 255); try { //This line right here crashes the program // The graphic darkcleanlinux is valid. (640x480) // The API for setWallpaper states that an intent // ACTION_WALLPAPER_CHANGED is broadcast. //Do I need to set up a listener? How? context.setWallpaper(BitmapFactory.decodeResource(getResources(), R.drawable.darkcleanlinux)); mdrawable = context.getWallpaper(); } catch (IOException e) { //TODO Auto-generated catch block e.printStackTrace(); } } } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google 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 -~--~~~~--~~--~--~---
[android-developers] Re: SImple Draw Program --Advice Needed
On Nov 2, 9:06 am, joshbeck <[EMAIL PROTECTED]> wrote: > On Nov 2, 9:04 am, joshbeck <[EMAIL PROTECTED]> wrote: > > > Thanks a million. I'll try this today and report back. > > > I appreciate it. > > > When you say 'set a flag.' Do you mean like an int? 0 or 1 kind of > > thing? > > > Thanks again, > > Pros > > One more thing: > If I set a flag in OnTouchEvent that is something like this > int myflag = 1; > > What is the best way to make it global so that onDraw will recognize > it? Ok, this keeps the background and draws a circle on top of it when I touch the screen. Question: How do you think I might get it to keep the old circles when I draw new ones. Right now when I click the canvas is completely redrawn and the first circle I created is lost. Thanks, that helped a lot. import android.app.Activity; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.Rect; import android.os.Bundle; import android.util.FloatMath; import android.view.MotionEvent; import android.view.View; public class BitmapMesh extends Activity { SampleView mView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mView = new SampleView(this); setContentView(mView); } private static class SampleView extends View { private Canvas mCanvas; private final Paint mPaint; private Bitmap mBitmap; public float XX; public float YY; public float ZZ; public SampleView(Context context) { super(context); ZZ = 0; mPaint = new Paint(); mPaint.setAntiAlias(true); mPaint.setARGB(255, 255, 255, 255); mBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.darkcleanlinux); } @Override protected void onDraw(Canvas canvas) { mCanvas = canvas; if(ZZ != 0){ canvas.drawBitmap(mBitmap, 0, 0, null); canvas.drawCircle(XX, YY, 20, mPaint); } else canvas.drawBitmap(mBitmap, 0, 0, null); } @Override public boolean onTouchEvent(MotionEvent event) { invalidate(); XX= event.getX(); YY= event.getY(); ZZ = 1; return true; } private void draw2(float X, float Y) { mCanvas.drawCircle(X, Y, 200, mPaint); } } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google 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 -~--~~~~--~~--~--~---
[android-developers] Re: SImple Draw Program --Advice Needed
On Nov 2, 9:04 am, joshbeck <[EMAIL PROTECTED]> wrote: > Thanks a million. I'll try this today and report back. > > I appreciate it. > > When you say 'set a flag.' Do you mean like an int? 0 or 1 kind of > thing? > > Thanks again, > Pros One more thing: If I set a flag in OnTouchEvent that is something like this int myflag = 1; What is the best way to make it global so that onDraw will recognize 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: SImple Draw Program --Advice Needed
Thanks a million. I'll try this today and report back. I appreciate it. When you say 'set a flag.' Do you mean like an int? 0 or 1 kind of thing? Thanks again, Pros --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google 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 -~--~~~~--~~--~--~---
[android-developers] Re: SImple Draw Program --Advice Needed
Here's the code: Thank You! package com.android.picturetest; import android.app.Activity; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.Rect; import android.os.Bundle; import android.util.FloatMath; import android.view.MotionEvent; import android.view.View; public class BitmapMesh extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(new SampleView(this)); } private static class SampleView extends View { private Canvas mCanvas; private final Paint mPaint; private Bitmap mBitmap; public SampleView(Context context) { super(context); mPaint = new Paint(); mPaint.setAntiAlias(true); mPaint.setARGB(255, 255, 255, 255); mBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.darkcleanlinux); } @Override protected void onDraw(Canvas canvas) { canvas.drawBitmap(mBitmap, 0, 0, null); } @Override public boolean onTouchEvent(MotionEvent event) { draw2(event.getX(),event.getY()); return true; } private void draw2(float X, float Y) { mCanvas.drawCircle(X, Y, 200, mPaint); } } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google 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 -~--~~~~--~~--~--~---
[android-developers] SImple Draw Program --Advice Needed
I watered this code down as much as possible for easy reading. Here is what it does: It draws a bitmap image to the screen. --darkcleanlinux (This part works.) It's the OnTouchEven(MotionEvent event) function that doesn't work. -I'm not sure I'm using the mCanvas object correctly. I would think that it would place a big dot on the screen when touched. Instead, it crashes. Any advice for a newb? 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Emulator Calendar Code --What's up?
Here is a very simple code segment I am running on the emulator. It creates a new Calendar cal and reads cal.HOUR and cal.MINUTE it then prints those values to the screen. The emulator always reads 10 12 ? Any ideas? Thanks, package com.android.date; import android.app.Activity; import android.os.Bundle; import java.lang.Object; import java.util.Calendar; import java.util.GregorianCalendar; import java.util.Date; import android.os.Bundle; import android.widget.TextView; public class date extends Activity { /** Called when the activity is first created. */ Calendar cal = Calendar.getInstance(); int hour = cal.HOUR; int minute = cal.MINUTE; /** LOOK HERE -- tv.setText(hour + " " + minute) @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); TextView tv = new TextView(this); tv.setText(hour + " " + minute); setContentView(tv); } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google 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 -~--~~~~--~~--~--~---