[android-beginners] My column '_id' does not exist?
I'm having trouble with something that works in the Notepad example. Here's the code from the NotepadCodeLab/Notepadv1Solution: String[] from = new String[] { NotesDbAdapter.KEY_TITLE }; int[] to = new int[] { R.id.text1 }; SimpleCursorAdapter notes = new SimpleCursorAdapter(this, R.layout.notes_row, c, from, to); This code seems to work fine. But just to be clear, I ran the adb utility and run sqlite3 I inspected the schema as follows: sqlite> .schema CREATE TABLE android_metadata (locale TEXT); CREATE TABLE notes (_id integer primary key autoincrement, title text not null, body text not null); All seems good to me. - Now on to My App, which as far as I can see is basically the same with a few minor changes. I've simplified and simplified my code, but the problem persists. String[] from = new String[] { "x" }; int[] to = new int[] { R.id.x }; SimpleCursorAdapter adapter = null; try { adapter = new SimpleCursorAdapter(this, R.layout.circle_row, cursor, from, to); } catch (RuntimeException e) { Log.e("Circle", e.toString(), e); } When I run my app, I get a RuntimeException and the following prints in LogCat from my Log.e() statement: LogCat Message: java.lang.IllegalArgumentException: column '_id' does not exist So, back to sqlite3 to see what's different about my schema: sqlite> .schema CREATE TABLE android_metadata (locale TEXT); CREATE TABLE circles (_id integer primary key autoincrement, sequence integer, radius real, x real, y real); I don't see how I'm missing the '_id'. Can anyone point out what I've done wrong? One thing that's different between my app and the Notepad example is that I started by creating my application from scratch using the Eclipse wizard while the sample app comes already put together. Is there some sort of environmental change I need to make for a new app to use a sqlite database? Hopefully this is easy to spot by someone that's not a newbie like me. Thanks. Mitch -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Android Scaled Drawing to ImageView
I'm drawing some simple shapes using canvas.drawCircle(), canvas.drawLine() etc. I originally copied the code from: http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/DrawPoints.html Which extends a View and draws directly to a canvas. It doesn't load a pre-drawn bitmap because I need my application to turn data into a drawing and the user will enter the data. My changes work, but the drawing is too small (or big) and doesn't fill the screen using all the available screen. Ideally I'd rather use something like an ImageView in .XML like so: If that's possible. The documentation seems to imply that I want to set the scaleType as shown in the above .XML which seems like the simple way to do this. If using an ImageView in .XML is a good idea, then I'm lost on how to draw to the ImageView and could use some guidance on doing that task. If that won't work, then I'll need to do some more thinking about how to get my drawing scaled on the screen and basically I'm lazy and would rather have Android do the work for me. Feel free to suggest some other way that's completely different is this is the wrong solution path. :) Thanks. -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Binding spinner to a list of custom objects
(Apologies with the last post, keyboard went a bit screwey) Wondering if someone can point me in the right direciton, I'm trying to bind a spinner to a List of custom objects. public class serverStatus { ... few other things public string getServerName(); public string getServerGuid(); ... few other things } Is it doable (and easily) or and I just missing stuff on my (possibly bad) searches. Thanks! mitch -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Binding to list of custom objects
Hiya, wonder if someone can point me in the right direction, I'm trying to bind a spinner to a list which contains a custom object type serverStatus { } -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: Start My Next Activity
I took a look at the code for the Notepad Tutorial and the instructions and followed what it said regarding creating a new Activity: http://developer.android.com/resources/tutorials/notepad/index.html http://developer.android.com/resources/tutorials/notepad/notepad-ex2.html Step 8 I'm still getting the same error and I did modify my AndroidManifest.xml as described in Step 11: "If you prefer to edit this file directly, simply open the AndroidManifest.xml file and look at the source (use the AndroidManifest.xml tab in the eclipse editor to see the source code directly). Then edit the file as follows: " But it makes no difference. I'm still getting the same error. Hm??? On Mar 7, 6:01 pm, Mitch wrote: > I'm trying start a new Activity from my current one. Every place I > look for example code is different, but the result is the same. The > code brings up the following dialog: > > = > Sorry! > > The application MyApp (process com.example.mypackage) has stopped > unexpectedly. Please try again. > > [Force close] > = > > Here's one of the things I tried (among dozens) which causes this: > > Intent myIntent = new Intent(this, NextActivity.class); > startActivity(myIntent); > > Does anyone have a link to simple example that starts up a new > activity that is complete and works? > > Thanks > > Mitch -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: Start My Next Activity
I didn't know this was an either or choice. I was under the impression one could create activities and have them share the User ID and therefore the same process? Regardless, my goal here is to find simplest example (at this point in my learning), seems like the simplest thing to do is share the same project and add the activity. Can I get a simple full example of only this with the Direct Invoke? On Mar 7, 6:51 pm, Mark Murphy wrote: > Mitch wrote: > > Looks like maybe I need one manifest for all my application's > > activities? > > If you want to use an Intent like: > > new Intent(this, MyOtherActivity.class) > > then MyOtherActivity should be in the same project and has to be listed > in that project's manifest. > > > Is there an option to create more than one project and > > have an activity in each project and have one call the other? > > Sure. You have to craft an appropriate for the second > activity's manifest entry (in its own project and manifest) and you have > to use an Intent that will trigger that Intent filter. And the user will > have to have both applications installed (the one with your first > activity and the one with the second activity). > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://twitter.com/commonsguy > > _The Busy Coder's Guide to *Advanced* Android Development_ > Version 1.3 Available! -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: Start My Next Activity
Looks like maybe I need one manifest for all my application's activities? Is there an option to create more than one project and have an activity in each project and have one call the other? Maybe this is an option and if so, why choose one way over the other. I chose to create a different project for the new activity, but not for any particular reason. On Mar 7, 6:28 pm, Mitch wrote: > So, I need to add the next activity I'm trying to call to my current > activity's manifest? If I do, then, no, that could very well be my > problem. > > On Mar 7, 6:06 pm, Greg Donald wrote: > > > On Sun, Mar 7, 2010 at 8:01 PM, Mitch wrote: > > > I'm trying start a new Activity from my current one. Every place I > > > look for example code is different, but the result is the same. The > > > code brings up the following dialog: > > > > = > > > Sorry! > > > > The application MyApp (process com.example.mypackage) has stopped > > > unexpectedly. Please try again. > > > Did you add the new activity to your manifest? > > > -- > > Greg Donald > > destiney.com | gregdonald.com > > -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: Start My Next Activity
So, I need to add the next activity I'm trying to call to my current activity's manifest? If I do, then, no, that could very well be my problem. On Mar 7, 6:06 pm, Greg Donald wrote: > On Sun, Mar 7, 2010 at 8:01 PM, Mitch wrote: > > I'm trying start a new Activity from my current one. Every place I > > look for example code is different, but the result is the same. The > > code brings up the following dialog: > > > = > > Sorry! > > > The application MyApp (process com.example.mypackage) has stopped > > unexpectedly. Please try again. > > Did you add the new activity to your manifest? > > -- > Greg Donald > destiney.com | gregdonald.com -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: Start My Next Activity
Yes, tried to find calls in the NotePad, but none existed that I could find that did the call simply. They all looked like ones that did calls implicitly and not directly. Hence the reason I'm asking for "1" and not 43. I'm working on an example from a book I bought, but it's not working, so I've been looking for the correct way (obviously the book is either incorrect or incomplete). The book certainly doesn't have a full example. So let me restate my question a bit clearer: 1 full example of one direct invoke of an activity. Nothing extra. On Mar 7, 6:11 pm, Mark Murphy wrote: > Mitch wrote: > > I'm trying start a new Activity from my current one. Every place I > > look for example code is different, but the result is the same. The > > code brings up the following dialog: > > > = > > Sorry! > > > The application MyApp (process com.example.mypackage) has stopped > > unexpectedly. Please try again. > > > [Force close] > > = > > Use adb logcat, DDMS, or the DDMS perspective in Eclipse to look at the > Java stack trace associated with this dialog. That will tell you what is > going wrong. Most likely, there is a problem in your second Activity. > > > Here's one of the things I tried (among dozens) which causes this: > > > Intent myIntent = new Intent(this, NextActivity.class); > > startActivity(myIntent); > > That is perfectly fine, assuming that NextActivity is registered in your > manifest. > > > Does anyone have a link to simple example that starts up a new > > activity that is complete and works? > > There are 43 total calls to startActivity() from the sample code that > shipped with your SDK. Visit $ANDROID_HOME/platforms/$SDK/samples, where > $ANDROID_HOME is wherever you installed your SDK and $SDK is some SDK > version (e.g., android-2.1). > > Also, the Notepad tutorial has multiple activities: > > http://developer.android.com/resources/tutorials/notepad/index.html > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://twitter.com/commonsguy > > _Android Programming Tutorials_ Version 2.0 Available! -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Start My Next Activity
I'm trying start a new Activity from my current one. Every place I look for example code is different, but the result is the same. The code brings up the following dialog: = Sorry! The application MyApp (process com.example.mypackage) has stopped unexpectedly. Please try again. [Force close] = Here's one of the things I tried (among dozens) which causes this: Intent myIntent = new Intent(this, NextActivity.class); startActivity(myIntent); Does anyone have a link to simple example that starts up a new activity that is complete and works? Thanks Mitch -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Class Diagram
Does anyone know where I can find a simplified Android Class Diagram? I think a diagram that shows the basic structure of the Android classes and cuts out the non-major classes would be helpful to understand the connections between the classes. Thanks, Mitch -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: Library Class Method
Hi Mark, Don't feel bad about the suggestion. I am a C++ programmer, so yes learning Java makes sense. So far I'm unimpressed with Java in that the language seems highly restrictive, especially in the generics and non existant in the preprocessor area. Yes, I'm aware that Java has other ways to do some of the same things, but often with less than ideal equivalents. Personally if I could code in C++ for Android, I'd be happy and I'm sure a Java programmer would feel the same moving to C ++. After some research it appeared that while you can code in C++, you can't do UI work and there's cost to crossing the C++/Java divide. Hence I started to learn Java as well as Android, Eclipse, and while I was at it, might as well throw in some Linux learning. I'm doing my best to dovetail the learning so they can help reinforce each other. I don't see much on the Java compiler model. I see some stuff about .java creates .class files, there a JVM etc, but no real world application layouts yet. I'm sure I'll find more as I learn, but that is really what this post is about - Learning the build model for combining application code and user written libraries. Should be simple. No? On Mar 2, 9:24 am, Mark Murphy wrote: > Mitch wrote: > > 1. Create a JAR file and use it in my activity. The JAR file must be > > a standard Java JAR (whatever that means). I see there are options to > > choose in the wizard for the JRE and no idea what a good choice is. > > > 2. Try to put the code into a particular folder and reference it in > > each Android Activity project. This will cause duplication of the > > code inside each activity? > > > 3. Create a service with the code and ask it to do the calculations > > and/or UI calls. Not sure if I can call UI inside a service. I think > > not after some reading. > > > I'd still like other options if anyone is reading this... > > To be honest, I think the best option is: > > 4. Spend some time learning Java outside of Android first. > > You seem to be fighting Java and Eclipse as much as, if not more so, > than Android. Android is just strange enough that newcomers to Java > often run into problems. > > Learn how to create standard Java console apps and JARs using Eclipse > (or dump Eclipse and use other tools). Then, head back into Android to > see how to utilize those techniques there. > > This is not particular to you -- I make this same recommendation to > anyone new to Java. IIRC, you said your background was C++, not Java, > which is why I make the recommendation here. > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://twitter.com/commonsguy > > _The Busy Coder's Guide to *Advanced* Android Development_ > Version 1.3 Available! -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: Library Class Method
Tried that, but so far it's not working. So far I have: 1. Create a JAR file and use it in my activity. The JAR file must be a standard Java JAR (whatever that means). I see there are options to choose in the wizard for the JRE and no idea what a good choice is. 2. Try to put the code into a particular folder and reference it in each Android Activity project. This will cause duplication of the code inside each activity? 3. Create a service with the code and ask it to do the calculations and/or UI calls. Not sure if I can call UI inside a service. I think not after some reading. I'd still like other options if anyone is reading this... On Mar 2, 7:20 am, Mark Murphy wrote: > Kitzy wrote: > > One last word of advice, if you are creating a standard jar file, then > > your project (for that code) shouldn't be an Android project but a > > regular java project. > > That may be true, but it is perfectly valid to link to the appropriate > Android JAR file, to reference classes and methods available in the > Android SDK. > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://twitter.com/commonsguy > > Warescription: Three Android Books, Plus Updates, One Low Price! -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: Library Class Method
Hi Dori, Thanks for the link. The resolution was too poor to be able to read what they were choosing. I did try the suggestion, but it is so far only partially working. I can now get the debugger to show the code is being called (with some wacky stuff happening before it gets there). Howver, the call never returns. I'm starting to think I may try finding a way to share the source under Eclipse. Maybe that will be easier than doing the JAR method described. I tried to do the same with a simple test case and that worked fine. However, the test case had no Android code in the library function, and I suspect that helped. Even if that works, I think this means I'll have multiple copies of the code inside each activity. Not a big deal for now, so long as I can figure out all the options I have before I make it available to the public. I hate to put more code on people's phones than they need, but if that works... Mitch On Mar 2, 7:08 am, Dori wrote: > This video may help you with referencing the jar from an android > project > > http://www.screencastcentral.com/public/yt3334.cfm > > You can export code as a jar file in eclipse by selecting your project > and going to File -> Export -> Select Java folder -> Jar file...then > import that into your projects which you want be able to access the > jar file from... > > Hope it helps! > > Dori > > On Mar 1, 6:38 pm, Mitch wrote: > > > > > Okay, so one option is to create a .jar file (somehow) and then > > (somehow) include that inside Eclipse. I may need to figure out how > > to set up the build dependencies as well. > > > I'll look into that. Seems reasonable and at least a direction to > > try. If anyone has other suggetions or can fill in the "somehow"s, > > that would be good too. > > > Thanks. Mitch > > > On Mar 1, 10:05 am, Mark Murphy wrote: > > > > Mitch wrote: > > > > I'm not sure what the options are, which is the basis of my > > > > question. > > > > > I have some code that is general (geometry calculations, Android UI > > > > helpers, ... etc). I would like to have multiple applications have > > > > access to the same code. I don't need this done at runtime, but I do > > > > know that is an option. I would like to start with sharing the source > > > > and then move to sharing the compiled code (.class?). I don't know > > > > how to set up the project to do this. I guessed by creating a new > > > > Java Project and leaving off the Activity, which worked as far as the > > > > Eclipse environment was concerned (no warnings, errors, etc), but when > > > > it runs, it's ugly and unhelpful as to what's wrong. Even debugging > > > > doesn't help. > > > > > I assume there's a model here for sharing code. Source sharing, > > > > compiled code sharing, runtime sharing, ... I simply don't know what > > > > the options are for sharing. > > > > You need to create a project that creates a JAR file as its target, then > > > use that JAR file in other projects. I am sure there is some magic > > > incantation, probably involving pentagrams drawn in chicken blood, to > > > get Eclipse to do that. :-) Outside of Eclipse, using Ant, it's about a > > > 15 second operation once you have the pattern in hand. > > > > -- > > > Mark Murphy (a Commons > > > Guy)http://commonsware.com|http://twitter.com/commonsguy > > > > Android Training...At Your > > > Office:http://commonsware.com/training-Hidequoted text - > > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: Library Class Method
Okay, so one option is to create a .jar file (somehow) and then (somehow) include that inside Eclipse. I may need to figure out how to set up the build dependencies as well. I'll look into that. Seems reasonable and at least a direction to try. If anyone has other suggetions or can fill in the "somehow"s, that would be good too. Thanks. Mitch On Mar 1, 10:05 am, Mark Murphy wrote: > Mitch wrote: > > I'm not sure what the options are, which is the basis of my > > question. > > > I have some code that is general (geometry calculations, Android UI > > helpers, ... etc). I would like to have multiple applications have > > access to the same code. I don't need this done at runtime, but I do > > know that is an option. I would like to start with sharing the source > > and then move to sharing the compiled code (.class?). I don't know > > how to set up the project to do this. I guessed by creating a new > > Java Project and leaving off the Activity, which worked as far as the > > Eclipse environment was concerned (no warnings, errors, etc), but when > > it runs, it's ugly and unhelpful as to what's wrong. Even debugging > > doesn't help. > > > I assume there's a model here for sharing code. Source sharing, > > compiled code sharing, runtime sharing, ... I simply don't know what > > the options are for sharing. > > You need to create a project that creates a JAR file as its target, then > use that JAR file in other projects. I am sure there is some magic > incantation, probably involving pentagrams drawn in chicken blood, to > get Eclipse to do that. :-) Outside of Eclipse, using Ant, it's about a > 15 second operation once you have the pattern in hand. > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://twitter.com/commonsguy > > Android Training...At Your Office:http://commonsware.com/training- Hide > quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: Library Class Method
I'm not sure what the options are, which is the basis of my question. I have some code that is general (geometry calculations, Android UI helpers, ... etc). I would like to have multiple applications have access to the same code. I don't need this done at runtime, but I do know that is an option. I would like to start with sharing the source and then move to sharing the compiled code (.class?). I don't know how to set up the project to do this. I guessed by creating a new Java Project and leaving off the Activity, which worked as far as the Eclipse environment was concerned (no warnings, errors, etc), but when it runs, it's ugly and unhelpful as to what's wrong. Even debugging doesn't help. I assume there's a model here for sharing code. Source sharing, compiled code sharing, runtime sharing, ... I simply don't know what the options are for sharing. Mitch On Mar 1, 6:59 am, Dori wrote: > What exactly are you trying to do here? > > Do you just want an activity to call a method from another class you > have written or do you want to be able to import a library contained > in a .jar file? > > Dori > > On Mar 1, 5:24 am, Mitch wrote: > > > > > I'm using Eclipse. I created a new Android Project with the wizard > > and I can start the application in the emulator. I would like to > > create a class outside of the project (like it would be in a library) > > and call it. I created another Android Project without an Activity > > name and created a class with a "public static" method. All compiles, > > but it won't run. It just crashes without any helpful information. > > > Since there is no code inside my method, something else must be > > wrong. I assume I don't understand something about how things link in > > Java/Android (C++ programmer here). Can anyone explain or show me a > > tutorial on how to create a class in a library so I can call it from > > my project? Should I be creating a Android Project or something > > else? > > > Thanks, > > > Mitch- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: Library Class Method
Depends on what you mean by "package". I can put the code in the same file and that works. I did not try naming the package the same name. I did try creating the class inside the same project, which is named "package" in the Eclipse environment, but I think they are using the wrong name from what I read. I think "package" means a namespace type construct in Java from what I'm reading. On Mar 1, 7:08 am, Kitzy wrote: > For starters... can you create you class inside the same Android > package? > > As far as Android gos.. if you are going to have seperate Android > programs needing acess to the same, large, component, the component > itself will need to be handled by its own android project and access > from an activity, service, or broadcast reciever. Your other android > programs could then start an Intent to try to run it. You will also > have to have both programs installed on you device/emulator. (At least > that is the only way I think you can do it) > > -Kitzy > > On Feb 28, 10:24 pm, Mitch wrote: > > > > > I'm using Eclipse. I created a new Android Project with the wizard > > and I can start the application in the emulator. I would like to > > create a class outside of the project (like it would be in a library) > > and call it. I created another Android Project without an Activity > > name and created a class with a "public static" method. All compiles, > > but it won't run. It just crashes without any helpful information. > > > Since there is no code inside my method, something else must be > > wrong. I assume I don't understand something about how things link in > > Java/Android (C++ programmer here). Can anyone explain or show me a > > tutorial on how to create a class in a library so I can call it from > > my project? Should I be creating a Android Project or something > > else? > > > Thanks, > > > Mitch- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: Library Class Method
I'm working on games and would like my games to share library code. In this case I have some geometry calculations and some common UI helper functions. But my question is more generic than just that. I would like to know how to create a library of code that I would reuse in various games. Maybe I just don't understand Java or maybe this is a Android question. As I mentioned I'm a C++ programmer, so I'm very used to that programming model. If this were C++, I would place the library code in a different folder structure. I would then have options on how to link that code. I could compile it into a library file. I could also have my environment include a copy of the source and compile it directly as if it was part of the application. Both methods work equally well and have their pros and cons which are beyond the scope of this group. This is extremely simple in C++, but in Java/Android it's not clear. You can easily try what I did to see what's wrong. Even if what I'm doing is wrong (which would not surprise me), I've discourage by the lack of any message and a crash when doing something that up until that point seems reasonable. In C++ if you can get past the compiler and linker messages, it works. In Java/Android, this confirmation that all is good seems to be missing. To recreate what I did, simply use the Eclipse wizard to create a new Android Application. Run it and get the Hello App text on the screen. Then create a new project, however tell the Wizard to not create an Android Activity (uncheck the checkbox). Then add a class and a public static method and call it inside your Android onCreate code from the first project . The system will simply stop working without a helpful message as to what's wrong, but will build cleanly. If anyone knows how to create a library I could reuse in various programs, I would appreciate it. Is this question a Java or Android question? Thanks, Mitch On Mar 1, 6:59 am, Dori wrote: > What exactly are you trying to do here? > > Do you just want an activity to call a method from another class you > have written or do you want to be able to import a library contained > in a .jar file? > > Dori > > On Mar 1, 5:24 am, Mitch wrote: > > > > > I'm using Eclipse. I created a new Android Project with the wizard > > and I can start the application in the emulator. I would like to > > create a class outside of the project (like it would be in a library) > > and call it. I created another Android Project without an Activity > > name and created a class with a "public static" method. All compiles, > > but it won't run. It just crashes without any helpful information. > > > Since there is no code inside my method, something else must be > > wrong. I assume I don't understand something about how things link in > > Java/Android (C++ programmer here). Can anyone explain or show me a > > tutorial on how to create a class in a library so I can call it from > > my project? Should I be creating a Android Project or something > > else? > > > Thanks, > > > Mitch- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Library Class Method
I'm using Eclipse. I created a new Android Project with the wizard and I can start the application in the emulator. I would like to create a class outside of the project (like it would be in a library) and call it. I created another Android Project without an Activity name and created a class with a "public static" method. All compiles, but it won't run. It just crashes without any helpful information. Since there is no code inside my method, something else must be wrong. I assume I don't understand something about how things link in Java/Android (C++ programmer here). Can anyone explain or show me a tutorial on how to create a class in a library so I can call it from my project? Should I be creating a Android Project or something else? Thanks, Mitch -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Custom Compound Control
I'm trying to learn how to build my own custom compound control component by reading: http://developer.android.com/guide/topics/ui/custom-components.html#compound I created my own view class and inherited it from RelativeLayout like so: public class MyCompoundView extends RelativeLayout { I also wrote a constructor like so: // Constructor version for instantiation from XML layout file. public MyCompoundView(Context context, AttributeSet attrs) { super(context, attrs); and created an main.xml file that uses it: Everything works fine. What I can't figure out is how to get access to the attributes in the xml to read the hello string so I can display it. I can't find an example of someone doing this that works for me. The LabelView from the ApiDemos does something that looks good: http://developer.android.com/guide/samples/ApiDemos/src/com/example/android/apis/view/LabelView.html But when I try to modify this for my program as shown here: text_ = new TextView(context); TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.MyCompoundView); CharSequence s = a.getString(R.styleable.MyCompoundView_text); if (s != null) { text_.setText(s.toString()); } I get the compiler error: R.styleable cannot be resolved. So I tried to use this instead: // see: http://stackoverflow.com/questions/1476371/android-writing-a-custom-compound-component LayoutInflater inflater = (LayoutInflater) context.getSystemService (Context.LAYOUT_INFLATER_SERVICE); inflater.inflate(R.layout.my_layout, this); I get the compiler error: R.layout cannot be resolved. I'd like to be able to share my composite control with others, so I'd want it to be flexible in that I can define my own attributes. Also, it should allow users to declare the control in XML and not just instantiate it in Java code. Any hints on how to do this? Thanks, Mitch -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: Android 2.0 SDK is here!
My emulator is showing what looks like Chinese characters when I try to enter names into the address book. Is there a configuration I need to set? Is there an emulator user's guide? On Oct 28, 6:54 am, donden1 wrote: > Same error here... does anyone know how to fix this error or what the > problem is? > > "SSL Peer shut down incorrectly" > > On Oct 28, 8:31 am, Dori wrote: > > > > > Exactly the same problem here, any suggestions? > > > On Oct 28, 10:32 am, Maxood wrote: > > > > I am getting the following messages after > > > > Done. Nothing was installed. > > > > Downloading SDK Platform Android 2.0, API 5, revision 1 > > > SSL peer shut down incorrectly > > > > Whats the solution? > > > On Oct 27, 11:16 am, Jeffrey Blattman > > > wrote: > > > > > new and updated tools. regardless of the SDK version, you can always > > > > develop your app to target previous SDK versions. in your manifest, look > > > > for the line, > > > > > > > > > > 3 is for 1.5, 4 for 1.6 ... > > > > > On 10/27/09 10:42 AM, Matt Raffel wrote: > > > > > > how does this apply if my phone is currently 1.5 and I wanted my app > > > > > to > > > > > work on it? Do I stick to 1.5? > > > > > > Matt > > > > > > Xavier Ducrohet wrote: > > > > > >> Hello everyone! > > > > > >> We've just announced the Android 2.0 SDK > > > > >>http://android-developers.blogspot.com/2009/10/announcing-android-20-... > > > > > >> If you already have the 1.6 SDK, note that you can simply use the SDK > > > > >> Manager to add Android 2.0 to your SDK. Make sure you also get the > > > > >> new > > > > >> SDK Tools (revision 3), as the SDK Manager in revision 2 (the one > > > > >> that > > > > >> shipped with 1.6) doesn't enforce dependencies between platforms and > > > > >> Tools (fixed in rev 3) > > > > > >> For more information about using the SDK Manager, see: > > > > >>http://developer.android.com/sdk/adding-components.html > > > > > >> Have fun! > > > > >> Xav > > > > > --- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Scroll Left and Right
I posted a question that I never got a response to. I'm starting to think what I'm trying to do must be impossible. I see a ListView that allow me to go up and down. As a consolation prize, is there any way I can pan left and right even if it can't go up and down at the same time? If this isn't possible, then I assume I'll need to find another way. See original question below... Thanks - Mitch From: Mitch Date: Thu, 1 Oct 2009 22:54:17 -0700 (PDT) Subject: Spreadsheet View I've been trying to make a layout that displays something like a mini spreadsheet that's specialized for my app. I would like it to have headers for both rows and columns. The row header can only pan left and right. The column header can only pan up and down. Hard to explain in words, so I'll try a picture (must be seen in a fixed pitch font): Stays| ... T3 T4 T5 ... --- . Row 3| ... 32 31 7 ... Row 4| ... 17 21 9 ... . If the user pushes the image up the screen, row 3 goes away and row 5 appears but the header row stays. If the user pushes the image to the left, column T3 goes away and column T6 appears and the header column stays. Having the "..." continuation hint would be nice, but is not required. I would also like to be able to have more than 1 header row and column (the ones that stay fixed). The info in the upper left quadrant of the spreadsheet would always stay put. It would be good to have the spreadsheet retain orientation in both landscape and portrait to allow the user to choose if the rows or columns would benefit from more display space. A nice feature would be to let the user resize rows and/or columns. This would be especially helpful for the fixed headers as display space is at a premium. I don't see anything that scrolls right or left nor anything that would scroll both right/left and up/down as would be needed for the lower right quadrant so I'm not even sure where to start. I suspect nothing like this exists as a single view I can simple drop into my xml, but how would I create such a thing by combining other views? Is there some other way through code to do his? I'm new so simple hints are appreciated. Thanks in advance. - Mitch --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Spreadsheet View
I've been trying to make a layout that displays something like a mini spreadsheet that's specialized for my app. I would like it to have headers for both rows and columns. The row header can only pan left and right. The column header can only pan up and down. Hard to explain in words, so I'll try a picture (must be seen in a fixed pitch font): Stays| ... T3 T4 T5 ... --- . Row 3| ... 32 31 7 ... Row 4| ... 17 21 9 ... . If the user pushes the image up the screen, row 3 goes away and row 5 appears but the header row stays. If the user pushes the image to the left, column T3 goes away and column T6 appears and the header column stays. Having the "..." continuation hint would be nice, but is not required. I would also like to be able to have more than 1 header row and column (the ones that stay fixed). The info in the upper left quadrant of the spreadsheet would always stay put. It would be good to have the spreadsheet retain orientation in both landscape and portrait to allow the user to choose if the rows or columns would benefit from more display space. A nice feature would be to let the user resize rows and/or columns. This would be especially helpful for the fixed headers as display space is at a premium. I don't see anything that scrolls right or left nor anything that would scroll both right/left and up/down as would be needed for the lower right quadrant so I'm not even sure where to start. I suspect nothing like this exists as a single view I can simple drop into my xml, but how would I create such a thing by combining other views? Is there some other way through code to do his? I'm new so simple hints are appreciated. Thanks in advance. - Mitch --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: INTERNET
I'm not trying to use HTTP, the "www.google.com" was just a URL I knew would be able to respond. Turns out that if I replace the "www.google.com" with it's IP "74.125.53.105" then it works. Don't know why. I would like to get 2 android simulators talking so I can test 2 way communications with data. I haven't found out how to get 2 simulators up yet either. On Aug 19, 11:14 pm, Mitch wrote: > I would like to play around with sockets to see if I can get them to > work, but I'm not having any luck. Here's what I tried: > > new Socket("www.google.com", 80); > > I've also tried > > new Socket("localhost", 7); > > but anything you can suggest that's simple is appreciated. I'm no > socket expert so I'm not sure if these are considered simple > examples. > > I read that I should add INTERNET permission to my manifest, so I did > this too: > > > http://schemas.android.com/apk/res/android"; > package="com.kea" > android:versionCode="1" > android:versionName="1.0"> > > android:label="@string/app_name"> > > > android:name="android.intent.category.LAUNCHER" /> > > > > > permission> > > > I'm just trying to learn so there's no real goal, just looking for a > simple example that I can get working. Any hints what I'm missing? > Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] INTERNET
I would like to play around with sockets to see if I can get them to work, but I'm not having any luck. Here's what I tried: new Socket("www.google.com", 80); I've also tried new Socket("localhost", 7); but anything you can suggest that's simple is appreciated. I'm no socket expert so I'm not sure if these are considered simple examples. I read that I should add INTERNET permission to my manifest, so I did this too: http://schemas.android.com/apk/res/android"; package="com.kea" android:versionCode="1" android:versionName="1.0"> I'm just trying to learn so there's no real goal, just looking for a simple example that I can get working. Any hints what I'm missing? Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Share Code
Hi, I've been told posting general questions is not a good idea, but I've had some luck so I'll try again. SInce this is a general question, general answers are fine. I'm working on an idea for a game and was wondering if it's possible in Android. It's basically an ad-hoc game so that 2 (or more) people with android devices could play even if only 1 person has the app. This game would involve sharing both data and code. I think the data sharing is possible. What I think may be difficult is the sharing of code. I've read some postings asking why one would want to share code, so I'll answer that before you ask. The main reason is that the each player of this game actually would write code (albeit often simple code) and transmit it to the device hosting the game. I could develop my own language and transmit the instructions that way as data, but it seems better to transmit the Java bytecode that would run on the phone since I would include library functions they could call to perform common actions. For example a user might write this upon entering a virtual room and spotting an enemy: while (enemy.isalive()) { swing(weapon); duck(); } if (health()<0.2) { drink(potion); } Also, having lived in areas where there is poor phone service I know that being able to transmit directly to the person sitting next to you in the car or while camping in nowhereland would be a good feature regardless. So even if I decide to transmit the user written code as data, getting the original app from the web might not be reasonable in some cases. If transmitting code isn't reasonable, I still think the app will work, it would just cause me to write it differently. Summary: Is it reasonable/possible to directly share user written code? Is it reasonable/possible to directly transmit an app directly from one device to another? What options exist for transmitting data and/or code? If transmitting Java bytecode isn't reasonable, how does one go about directly transmitting data to another phone? In this game, one device would host the code written by all players while the results of running the code would be updated on all devices (if that's helpful). So really only one person need have the total app that's purchased. Everyone else could have a free version that didn't host the program's execution but allowed for writing instructions, transmitting to the host and reading back the results as it happens. I would only expect you to point me in a reasonable direction and/or post a link to the info that will answer these questions, even if only partially. So while I appreciate details, don't go nuts unless you like that sort of thing. Thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] TicTacToe et al
I've read a bunch of stuff on the Android developers site (examples, docs, etc)... I still have lots of unanswered questions, especially on how to use XML for layouts, but thought I should start putting together my first application. I would really like to create an application based on my ideas and not just re-implement someone else's ideas. I was thinking that would give me a better idea on how difficult Android is to program. I thought for my first application I would create a 3x3 TicTacToe game. Seems simple but the more I work on it the harder it looks to do. I've been trying to use the Gridview example, but not having luck. My ideas for this game are below, I'd appreciate any direction, examples, documentation, etc you could give me. Also, if you think TicTacToe is too big of a program to tackle for my first app, comments on that are welcome. I would like a very graphical game and not just a grid of buttons with text. I think to create a real game people would expect graphics that look professional and be able to click directly on the board. So I need to display the X's and O's on top of a # looking grid that is equal in height and width. I'd like the game to be 2 person. By this I would want to have 2 android emulators running and transmitting moves to and from each other. This way 2 people could play over a distance. It would be nice to allow the games to transmit the data without the aid of a network if they are physically close to each other (not sure if Android can do this). It would be best to allow me to draw the graphics (#, O, X) in a graphics editor and scale them to the device. I'd like both landscape and portrait mode to work and use any extra space outside the square # board to have buttons or text like (Forfeit, Play Again, Score,...). I'd rather use XML for the view layout so I can change it without coding. It seems this is too difficult for my current skill level, but even if I can only do some of it, that would be good too. I keep trying to use Gridview to do my 3 x 3 layout, but I can't figure out how to do that. Thanks for any hints... Mitch --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] XML Layout Language
I'm still confused by the XML Layout syntax/semantics. I've asked before but never got a good response. Does anyone know where the specification for the XML Layout exists? I'd like some simple examples, but not like the ones on the android site. They are too dismissive of the specifics of each attribute. Perhaps with a specification I could read the details about the examples. Thanks. Mitch --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] XML Layout Specification
Here's a layout from the DevGuide: http://developer.android.com/guide/topics/ui/declaring-layout.html http://schemas.android.com/apk/res/ android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > - What does xmlns mean? - What is the android:xxx sytnax all about? - What does the "http://schemas.android.com/apk/res/android"; do? - Are there other values I might choose? (ex. "http:// schemas.android.com/apk/res/iPhone") - Can you create your own Layouts like the "LinearLayout"? - Is there a list of available components like "Button", "TextView"? - What does the @, the / and the + symbol do? - Can I edit this directly in Eclipse with a graphical editor rather than editing the xml text? That's a lot of questions. So let me sum these up into one simple question: Does anyone know a link to the specification for the XML Layout Language for Android? Thanks for any hints for a complete newbie. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] XML Layout Language
Does anyone know a link to the specification for the XML Layout? I'm looking for a description of the tags etc. Since I'm new and just learning, a simplified version would be nice, focusing on the most common tags. Everything I read now is vague. If not, here's some questions I have that are more specific. >From the layout section of the DevGuide: http://schemas.android.com/apk/res/ android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > - What does xmlns mean? - What is the android: sytnax all about? - What does the "http://schemas.android.com/apk/res/android"; do? - Can you create your own Layouts like the "LinearLayout"? - Is there a list of available components like "Button", "TextView"? - What does the @ symbol do? - Can I edit this directly in Eclipse with a graphical editor rather than manipulating text? I'm sure these are probably simple questions answered somewhere, but I just can't find the specification and I'm so new I don't seem to be able to find the info. Thanks for any hints. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Delete android database
Hiya, Does anyone know if there is a way to remove an android database file programmatically? I need to remove a lot of records (10,000+) and it seems it would be quicker to remove the database and re-create from scratch rather than deleting from the various tables (Which takes about 20 seconds using triggers to force referential integrity). Thanks in advance! mitch --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: CSS in WebView
Thanks Mark, That seemed to fix it, I've also bugged it at http://code.google.com/p/android/issues/detail?id=1659 mitch! On Dec 26, 11:26 pm, Mark Murphy wrote: > mitch wrote: > > I'm having a slightly strange problem, I'm using a WebView widget in a > > page, when I put HTML in the widget using loadData it works fine, > > however if I include a tag in the HTML the widget goes blank > > and doesn't show any details. > > > The initial code is > > > WebView oBrowser = (WebView)this.findViewById > > (R.id.wineResultHTMLViewer); > > > String szHTML = "<html><head><title>Wine Detail</ > > title><style type=\"text/css\">.moo {color: #00;} > head>1972 Achaia > > Clauss Nemea > \"> "; > > oBrowser.loadData(szHTML, "text/html", "UTF-8"); > > Try using loadDataWithBaseURL(), supplying some screwball base URL > (fake://it/is/so/stupid/that/we/have/to/do/this). That clears up a lot > of problems seen when using the simplified loadData() API. > > -- > Mark Murphy (a Commons Guy)http://commonsware.com > _The Busy Coder's Guide to Android Development_ Version 1.9 Available! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] CSS in WebView
I'm having a slightly strange problem, I'm using a WebView widget in a page, when I put HTML in the widget using loadData it works fine, however if I include a tag in the HTML the widget goes blank and doesn't show any details. The initial code is WebView oBrowser = (WebView)this.findViewById (R.id.wineResultHTMLViewer); String szHTML = "<html><head><title>Wine Detail</ title><style type=\"text/css\">.moo {color: #00;}1972 Achaia Clauss Nemea "; oBrowser.loadData(szHTML, "text/html", "UTF-8"); This should do nothing more than display a piece of text in H1 on the page. However it just displays a blank screen, removing the section which says .moo {color: #00;} fixes the problem. For reference the XML is :- http://schemas.android.com/apk/res/android"; android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > Any help is appreciated! Thanks mitch --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---