[android-beginners] UI Question - ListView and Relative View
Hello, Android beginners! I've completed all of the tutorials under the Hello, Viewshttp://developer.android.com/resources/tutorials/views/index.html section. However, I'm unsure if what I want to do is possible. I want the top of my UI to be a edit box and a button (much like in the Relativehttp://developer.android.com/resources/tutorials/views/hello-relativelayout.html layout tutorial), and then everything following that should be a ListViewhttp://developer.android.com/resources/tutorials/views/hello-listview.html . At first, I thought, Hm. It might not work, but maybe I can mix the XML. Something like RelativeLayout ... ... /RelativeLayout followed by a ListView ... /ListView. The problem I came across was that ListView is not created through XML; instead, the code for it is within an activity. The code directly from the tutorial follows: --- public class ListViewActivity extends ListActivity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setListAdapter(new ArrayAdapterString(this, // -- This is giving me a ListView! android.R.layout.simple_list_item_1, COUNTRIES)); getListView().setTextFilterEnabled(true); } ... } --- So... how can I get my UI to have these two layouts? Is such a combination even possible, or do I have to adhere to a single layout at a time on the screen? Thank you in advance! -Danny -- 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] Is Browsing While Calling Impossible? Why?
Greetings, fellow aspiring Android developers! In a discussion about the differences between the iPhone and Android devices, I recently heard that Verizon users were unable to browse the internet while they were on a call. That is: 1. User makes a phone call. 2. User hits Home and opens up the browser. 3. User attempts to go to some website. 4. --- The website is never loaded! I confirmed this on my Motorola Droid, but was left a bit confused: why can't I browse? Someone mentioned that it's how CDMA works. Another said that Verizon simply didn't support it. My questions are: - Is it up to Android? Can I, as a developer, overcome this limitation? - Is it indeed left to the carrier (Verizon, ATT, etc.), and would that knowledge be practically useless to me as a developer? It's possible to get around this by using an application that does VoIP calls, but I really wanted to understand the reasons behind the limitation when a regular call is being made. I remember watching a video of the Google Maps developer; she demonstrated looking up directions while on a phone call. Wouldn't that mean that she used data obtained in the way that some say is impossible? Thanks! -Danny -- 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
Re: [android-beginners] installation problem
Hi, Dhaval. The method in the error, *java.io.PrintStream.printf*, is actually a Java method that has no direct association with Android ( http://java.sun.com/j2se/1.5.0/docs/api/java/io/PrintStream.html). If I had to guess, I'd recommend checking to make sure Java is installed on your machine. If you've got all the Java components on your machine, maybe Eclipse just doesn't know how to find them. When I started from the instructions herehttp://developer.android.com/sdk/index.html, I felt as if I had a complete and thorough setup at the end. Give it a shot; I think the line in particular that would deal with what you're seeing is: In particular, you may need to install the JDKhttp://java.sun.com/javase/downloads/index.jsp(version 5 or 6 required) and Eclipse http://www.eclipse.org/downloads/ (version 3.4 or 3.5, needed only if you want develop using the ADT Plugin).. Keep in mind that I'm a newbie in this environment too, so don't be surprised if my suspicion is not the whole case! -Danny *whelps helping whelps* On Wed, May 12, 2010 at 12:14 AM, dhaval shah dhavalshah9...@gmail.comwrote: Hi everybody, i am trying to install SDK along with Eclipse and ADT on linux. i have already install Eclipse 3.5.2. now when i try to follow the step of *tools/android* i get following error *Starting Android SDK and AVD Manager Exception in thread main java.lang.NoSuchMethodError: method java.io.PrintStream.printf with signature (Ljava.lang.String;[Ljava.lang.Object;)Ljava.io.PrintStream; was not found. at com.android.sdkmanager.Main.showMainWindow(Main.java:268) at com.android.sdkmanager.Main.doAction(Main.java:247) at com.android.sdkmanager.Main.run(Main.java:92) at com.android.sdkmanager.Main.main(Main.java:81) *can someone help why this error comes ? what are reasons possible for this error? your help is appriciated a lot. thanks regards, Dhaval shah. -- 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.comandroid-beginners%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -- 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
Re: [android-beginners] What is R.java
On this note, I was wondering: when exactly is R.java updated? Here are some cases that have caused confusion for me. - I add a new file in the res/layout folder. R.java is NOT updated with my new xml file. I perform a CLEAN on the project and then... - I delete a file such that main.xml is the only file remaining. R.java IS updated! - I delete a file after having added two -- that is, main.xml is not the only file remaining. R.java is NOT updated. Any ideas? I especially am interested in making the R.java file pointing to the newly added xml files (case 1 of the three in my list). -Danny On Sat, May 8, 2010 at 7:23 PM, joshua hublar joshua.m.hub...@gmail.comwrote: Android considers XML-based layouts to be resources, and as such layout files are stored in the res/layout directory inside your Android project. Each XML file contains a tree of elements specifying a layout of widgets and their containers that make up one view hierarchy. The attributes of the XML elements are properties, describing how a widget should look or how a container should behave. For example, if a Button element has an attribute value of android:textStyle = bold, that means that the text appearing on the face of the button should be rendered in a boldface font style. Android’s SDK ships with a tool (aapt) which uses the layouts. This tool should be auto- matically invoked by your Android tool chain (e.g., Eclipse, Ant’s build.xml). Of particular importance to you as a developer is that aapt generates the R.java source file within your project, allowing you to access layouts and widgets within those layouts directly from your Java code. On Sat, May 8, 2010 at 9:48 PM, Ubuntu Explorer ubuntuexplo...@gmail.comwrote: Hello , Why is R.java named so? It seems to store IDs in static variables like R.layout etc. It looks like this is Android's way of keeping track of predefined UI elements in the Manifest file. Is it possible to access Views created during runtime using the same class R? Regards, UE. -- 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.comandroid-beginners%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -- 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.comandroid-beginners%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -- 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
Re: [android-beginners] Advice For First (Simple?) Non-Tutorial Project
Greetings again, fellow beginners! I looked through status.net and it provoked a question. I do not need something too specialized; in fact, I don't really have the server to host the suggested microblogging service on. Instead, does Android have the capability to do something with a public medium instead, as described below? --- Affecting the Counter --- 1. User makes a selection to add or remove themself to/from the counter. 2. The app posts something to a public medium (example: twitter) account that indicates an addition or a removal. 3. The app updates its counter according to the user's addition/subtraction. 4. The app looks up the public counter (below). --- Looking Up the Counter --- 1. The app looks up the twitter account. For simplicity, let us say that this occurs when a user adds or removes themselves (above). 2. The app reads entries from some date/time to present date/time; entries contain text that indicate additions/subtractions to the count. 3. The app reads/parses these entries. 4. The app updates its counter according to the entries' values. What I want to know: is all that possible on the Android? You don't have to give me details if you don't feel like it, but any direction/comments/ideas/pitfalls are welcome. Thank you for reading, and have a great day! -Danny On Sat, May 1, 2010 at 3:42 PM, ubuntuexplorer ubuntuexplo...@gmail.comwrote: Dear Mark, Thanks for the answer. As I understand, it seems that learning will be simpler if I make up an app. idea and then try to learn what is required to build it. I will try to get the books suggested if I need further info. Regards, UE. On Sat, May 1, 2010 at 11:30 PM, Mark Murphy mmur...@commonsware.comwrote: Ubuntu Explorer wrote: I have more or less the same question. The amount of detail in the API is overwhelming for me to choose what is really required for my app. Are there specific areas we can focus on that can help us ramp up quickly. That is impossible to answer in the abstract. A 3D first-person shooter is very different from a PDF viewer, which is very different from a social networking client, which is very different from a tip calculator. The specific areas [you] can focus on that can help [you] ramp up quickly will vary by what you are building. At the risk of sounding self-serving, if you find the documentation overwhelming, perhaps you need different documentation: http://wiki.andmob.org/books (in the interests of full disclosure, I wrote some of those) On Sat, May 1, 2010 at 4:27 PM, Daniel Favela dfav...@gmail.com First question: I've done the Hello World and notepad tutorials, as well as run through the quick tutorial http://www.youtube.com/watch?v=I6ObTqIiYfEon youtube by Dan Morril. I've also read a bit of the Android fundamentals materials. Is this enough experience to make an application like the one I'll describe below? If not, what do you think I should read or try next? If so, The application I have in mind will be a counter triggered by users. A user will add themselves to the count, remove themselves from the count, and view the count. When a user adds or removes themself to the count... - if possible, this will update the count on other instances for other users/devices That's my first step for now. The UI will be a ListView showing the counts that users have added themselves to (once I create the means to have one count, I will easily be able to scale the app to have n counts). There will be a button to add and remove the user. Sounds reasonable, right? Please let me know if this sounds difficult, especially where the multi-device communication (in updating the counter) is concerned. Know of a library that I'll have to use, or have some general advice for this? Tell me! :) IMHO, you're looking at your problem backwards. Your application requires a server, from your description. Focus on getting the server right first: -- how are you planning on sending data to the server? (HTTP via a REST-style API? XMPP? SMTP? something else?) -- where and how are you storing your counts? (SQLite? MySQL? Oracle? Flat file? memcached? Redis? something else?) -- how are you determining who sees what count? (everybody sees everybody's? something else?) -- how are you planning on distributing updates from the server? (polling by the clients? WebSockets with Comet? SMS? something else?) -- what data format will you be using for all of this? (XML? JSON? YAML? binary payloads via Protocol Buffers? binary payloads via Thrift? something else?) The only part of Android that really comes into play when thinking about your server are the communication protocols and payloads to/from the server. In the end, Android can handle just about anything, but there is more work involved with some compared to others
[android-beginners] Advice For First (Simple?) Non-Tutorial Project
Greetings, fellow beginners! First question: I've done the Hello World and notepad tutorials, as well as run through the quick tutorial http://www.youtube.com/watch?v=I6ObTqIiYfEon youtube by Dan Morril. I've also read a bit of the Android fundamentals materials. Is this enough experience to make an application like the one I'll describe below? If not, what do you think I should read or try next? If so, The application I have in mind will be a counter triggered by users. A user will add themselves to the count, remove themselves from the count, and view the count. When a user adds or removes themself to the count... - if possible, this will update the count on other instances for other users/devices That's my first step for now. The UI will be a ListView showing the counts that users have added themselves to (once I create the means to have one count, I will easily be able to scale the app to have n counts). There will be a button to add and remove the user. Sounds reasonable, right? Please let me know if this sounds difficult, especially where the multi-device communication (in updating the counter) is concerned. Know of a library that I'll have to use, or have some general advice for this? Tell me! :) Thank you for reading! -Danny -- 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
Re: [android-beginners] Advice For First (Simple?) Non-Tutorial Project
Thank you very much, Mark Murphy; that was EXACTLY the type of response I was looking for, and it provoked some more thought on my end. My original idea was to avoid the need for a server. My naive idea was relaying data between devices themselves (ex. user A adds themself to count. This messages/texts user B. This adds user A to user B's list of participants, and both update their counter. Any future inquiries -- user C -- to A or B will get that list of participants, and user C will now be able to relay their own addition and removal to A and B). The reason I first dreamt that up was because of current applications such as google talk, messaging, etc. -- correspondence between two devices, which other applications http://www.youtube.com/watch?v=JUmachL5IW4 have been capable of. For those that may benefit from my case, a problem arises that can be seen when the first user, ever, uses the application. Who does he or she contact when adding themself to the count? They have no one to contact; the need for the server becomes apparent. Thanks again, Mark. You've described my upper bound for what I'll need in order to relay that contact information between devices -- and maybe after that, users can maintain a device-centric count. I'll be looking into status.net for that purpose. Have a great day! If you have any more comments or corrections for this newbie, lay 'em on me. -Danny On Sat, May 1, 2010 at 7:30 AM, Mark Murphy mmur...@commonsware.com wrote: Ubuntu Explorer wrote: I have more or less the same question. The amount of detail in the API is overwhelming for me to choose what is really required for my app. Are there specific areas we can focus on that can help us ramp up quickly. That is impossible to answer in the abstract. A 3D first-person shooter is very different from a PDF viewer, which is very different from a social networking client, which is very different from a tip calculator. The specific areas [you] can focus on that can help [you] ramp up quickly will vary by what you are building. At the risk of sounding self-serving, if you find the documentation overwhelming, perhaps you need different documentation: http://wiki.andmob.org/books (in the interests of full disclosure, I wrote some of those) On Sat, May 1, 2010 at 4:27 PM, Daniel Favela dfav...@gmail.com First question: I've done the Hello World and notepad tutorials, as well as run through the quick tutorial http://www.youtube.com/watch?v=I6ObTqIiYfEon youtube by Dan Morril. I've also read a bit of the Android fundamentals materials. Is this enough experience to make an application like the one I'll describe below? If not, what do you think I should read or try next? If so, The application I have in mind will be a counter triggered by users. A user will add themselves to the count, remove themselves from the count, and view the count. When a user adds or removes themself to the count... - if possible, this will update the count on other instances for other users/devices That's my first step for now. The UI will be a ListView showing the counts that users have added themselves to (once I create the means to have one count, I will easily be able to scale the app to have n counts). There will be a button to add and remove the user. Sounds reasonable, right? Please let me know if this sounds difficult, especially where the multi-device communication (in updating the counter) is concerned. Know of a library that I'll have to use, or have some general advice for this? Tell me! :) IMHO, you're looking at your problem backwards. Your application requires a server, from your description. Focus on getting the server right first: -- how are you planning on sending data to the server? (HTTP via a REST-style API? XMPP? SMTP? something else?) -- where and how are you storing your counts? (SQLite? MySQL? Oracle? Flat file? memcached? Redis? something else?) -- how are you determining who sees what count? (everybody sees everybody's? something else?) -- how are you planning on distributing updates from the server? (polling by the clients? WebSockets with Comet? SMS? something else?) -- what data format will you be using for all of this? (XML? JSON? YAML? binary payloads via Protocol Buffers? binary payloads via Thrift? something else?) The only part of Android that really comes into play when thinking about your server are the communication protocols and payloads to/from the server. In the end, Android can handle just about anything, but there is more work involved with some compared to others. However, it may be that you are still better off choosing something that you're already comfortable with, even if it makes the Android side a bit more complex, just to make your server work simpler. Once you have the server more or less working
Re: [android-beginners] Re: How often does an activity run?
Well, this seems like a good exercise to test my learning and reading as a newbie in the Android scene. If I'm understanding BobG correctly, he means that the calls to onDraw depend entirely on your application. Your *Hello World!* sample renders the text once and never has to render anything again -- the view stays put as you left it. It's a callback: when something happens (like user input), then onDraw() might be called if something new has to be drawn. A game, for example, might process game logic at each frame. This results in onDraw() being called for each frame, since game logic might place a game object in a position different from that it was in during the last frame. Hello World, as mentioned, doesn't need to be updated in that way. That's why onDraw() is not called anymore. With regards to the zombie sentiment, onDraw() does not actually take up any more memory than any other function might take; it is called when needed, I suspect, much like onCreate(), onStart(), onResume, onDestroy() do (these are methods involved in an activity's life cycle; check out the Android Application fundamentals page herehttp://developer.android.com/guide/topics/fundamentals.html#lcycles to see where I'm pulling these potentially wrong statements from). From what I've read, Android does things in a very, very, very modular manner; everything is there and safe until it's needed. I'm guessing that if you were to press Home or Back while *Hello World!*was running, then you brought it back to the foreground, it would call onDraw() again. If I'm wrong in anything I've said, please correct me! I hope that helps. -Danny On Mon, Apr 19, 2010 at 7:27 AM, BobG bobgard...@aol.com wrote: On Apr 19, 9:08 am, ~ TreKing treking...@gmail.com wrote: I don't know what you're asking. Activities don't really run like threads that have a definite function that gets executed to do work. They have functions that are invoked in response to system events (onCreate, onPause, onConfigurationChanged, etc). = Here is my 'model' that compares an embedded program to an android program: embedded program: main gets called by os, main calls initstuff(), falls into a while(1) loop that calls inputs(), process() and outputs() forever. The os can kill it if it has to. In the android program, the onCreate is the init, the os scheduler is the while(1) loop, and the onSensorChanged events are like the input and process functions, and the onDraw is like the output function. Sort of. Does this model make sense to anyone else? Can it be explained more clearly by another model? -- 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.comandroid-beginners%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -- 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