|
Gangsta Lean posted:Does anyone do Android development in VirtualBox? Is it supposed to work?
|
# ? Aug 4, 2012 08:24 |
|
|
# ? May 2, 2024 23:34 |
|
NoDamage posted:The Android emulator is super slow as is, I can't even imagine how much slower it will run inside a virtual machine. What you can try instead is installing Android-x86 in another VirtualBox and running Android directly on that, rather than using the emulator inside a VirtualBox. (I do this anyway because it's so much faster than running the emulator natively.) You realize there's official x86 emulation now, right?
|
# ? Aug 4, 2012 09:31 |
|
Doctor w-rw-rw- posted:You realize there's official x86 emulation now, right? On another note, after much debugging with Eclipse Memory Analyzer I have learned a painful lesson: never declare a WebView in XML, always create it programmatically, and never set its context to an Activity (use your application context instead). Failure to do so will lead to horrible memory leaks 100% of the time.
|
# ? Aug 4, 2012 17:31 |
|
I'm trying to use the AndEngine.java library for use in a school project, but I don't think I'm correctly adding it to the build path. There are some superclasses in the library that I'm supposed to extend into subclasses for the purposes of the game, but Eclipse is just not recognizing the library at all. Here's what I'm doing: 1.) Create a new folder in this project's subfolder called "libs" 2.) move andengine.java to that subfolder 3.) right click on it and select Build --> Add to build path From here, the AndEngine library appears under the "Referenced Libraries" subgroup (It's the only thing in there), and I can open up the AndEngine library to find all the superclasses I'm supposed to be extending. The IDE just doesn't recognize any of them when I try to call them in my code. Edit: I actually fixed it by adding a specific import statement for one of the classes I needed. code:
code:
However, is there any way to make the IDE do this for me? It did not recognize anything from the imported library until I specifically typed out that import statement by hand. None of the subclasses/methods appear in the intellisense Harold Ramis Drugs fucked around with this message at 23:08 on Aug 4, 2012 |
# ? Aug 4, 2012 22:59 |
|
Harold Ramis Drugs posted:I'm trying to use the AndEngine.java library for use in a school project, but I don't think I'm correctly adding it to the build path. There are some superclasses in the library that I'm supposed to extend into subclasses for the purposes of the game, but Eclipse is just not recognizing the library at all. That's mostly how java works, but you should be able to import something like code:
|
# ? Aug 4, 2012 23:33 |
|
Here's a video version of my problem: http://www.andengine.org/blog/tag/tutorial/ I am able to follow the video up to about 1:50, when he changes the name of the extended class from "Activity" to "BaseGameActivity". He is actually able to do it with intellisense, and eclipse automatically added the correct import statement to the top. It won't do this for me. The andengine jar file is sitting in my referenced libraries tab for this project. The IDE doesn't seem to recognize anything that's in it, including the above BaseGameActivity statement. (The correct import option selected in the video isn't even available to me). mmm11105 posted:That's mostly how java works, but you should be able to import something like This doesn't work. However, I forgot to note last time that the AndEngine.jar expands into a list of about ~100 different packages, each one with the objects I need inside. I was thinking the above import statement isn't working because the class files needed are contained within subdivisions of that directory. Is there a more inclusive way to use the import statement to import all the classes from all the sub-directories of a jar? Edit: I'm now considering that this might be a symptom of the new release of eclipse (Juno). All of our course materials were prepared for Indigo, so I'll revert to that version and see Harold Ramis Drugs fucked around with this message at 01:20 on Aug 5, 2012 |
# ? Aug 5, 2012 01:01 |
|
Moey posted:Cannot offer any help, but why are you developing in a vm? I don't know, really. I do most of my development in linux nowadays, and I do all of that in a vm. For the kind of work I usually do, I have to switch back and forth between different versions of libraries depending on project, so it usually makes things easier being able to save state at any time or roll back. It looks like that won't be the case for Android development, at least the way I was attempting to do it. Isn't linux the preferred platform for Android development? I'll probably end up dual booting if so.
|
# ? Aug 6, 2012 03:14 |
|
I've not found an elegant solution for including a populated database with an app. Anyone have any experience or do you always check for a database and create it on a first run?
|
# ? Aug 7, 2012 02:49 |
|
rotaryfun posted:I've not found an elegant solution for including a populated database with an app. Anyone have any experience or do you always check for a database and create it on a first run? Does your app have internet access already? Could you download it? Maybe using the APK expansion API? http://developer.android.com/guide/google/play/expansion-files.html These are probably terrible ideas, never thought of distributing a database this way. Generally mine are small enough I just create them the first time the app loads.
|
# ? Aug 7, 2012 02:58 |
|
rotaryfun posted:I've not found an elegant solution for including a populated database with an app. Anyone have any experience or do you always check for a database and create it on a first run? I ended including the database as a resource, and copying it into the proper location on first run. It's not ideal, especially if you've got a large database, but it does work.
|
# ? Aug 7, 2012 03:37 |
|
PT6A posted:I ended including the database as a resource, and copying it into the proper location on first run. It's not ideal, especially if you've got a large database, but it does work. Put it in your SQLiteOpenHelper or whatever it's called, and apply it at database creation or update time. Or something like that.
|
# ? Aug 7, 2012 11:04 |
|
Doctor w-rw-rw- posted:Why resource and not an asset? Err, yeah, it was an asset. I haven't done enough Android development lately to keep all the terminology straight.
|
# ? Aug 7, 2012 21:40 |
|
So I have my first app that I'm building and I've run into a asynctask issue in that I think I need to use it but I don't know just how to do it. I have a doFirstRun method that is called and run if a setting isn't found in the sharedprefs code:
However, the message is never really displayed and it hangs while adding them. The way they are added is by passing player information to a object method... 150 of them. This hangs the app for a few seconds until that is finished. example: code:
http://labs.makemachine.net/2010/05/android-asynctask-example/
|
# ? Aug 8, 2012 23:43 |
|
rotaryfun posted:So I have my first app that I'm building and I've run into a asynctask issue in that I think I need to use it but I don't know just how to do it. Do something like this... code:
|
# ? Aug 10, 2012 01:45 |
|
BabyJebus posted:Do something like this... Shouldn't the progressdialog be a member of the asynctask and be started in onPreExecute?
|
# ? Aug 10, 2012 09:08 |
|
Doctor w-rw-rw- posted:Shouldn't the progressdialog be a member of the asynctask and be started in onPreExecute? I'm getting: Type mismatch: cannot convert from void to ProgressDialog Would this be why? edit: I changed it to code:
The method show(Context, CharSequence, CharSequence) in the type ProgressDialog is not applicable for the arguments (ViewPlayers.AddPlayersTask, String, String) edit2: Nevermind, I added changed the context from this to ViewPlayers.this (activity name) and it cleared the error. edit3: Got it all up and running. Works great. Thanks for the code help gentlemen! rotaryfun fucked around with this message at 18:30 on Aug 10, 2012 |
# ? Aug 10, 2012 15:10 |
|
rotaryfun posted:I'm getting: are you not using an IDE to edit? You should be able to autocomplete most of that in seconds.
|
# ? Aug 10, 2012 18:45 |
|
Hey guys, looking for some advice here. I'm trying to do some type of persistent data storage in my app, and after looking around, I decided a FileOutputStream( http://developer.android.com/reference/java/io/FileOutputStream.html ) would probably be best for me. Right now, all I have is a LinearLayout with a series of CheckBoxes. I just need an efficient way to save the data, which is the only way a checklist is ever going to be useful. As it is right now, my xml file contains all the CheckBoxes, and my java file is pretty clean. I know I'm going to need to read in the data and set the initial states of all the CheckBoxes in the onCreate() function and save in the onPause() and onStop() functions. I assume I could, in each of these functions, address each CheckBox by id and update the info that way. But that's not a good solution, since every time I decided to add a new CheckBox to the cheklist, I'd have to update the layout file, as well as three separate functions in the java file. I was hoping there would be a way to just read every box in sequence and write the whole thing to a file. My C background is telling me to throw them all in a struct and read/write the struct to and from a file each time, but something tells me that's just not going to work here.
|
# ? Aug 10, 2012 18:56 |
|
Zero The Hero posted:Hey guys, looking for some advice here. I'm trying to do some type of persistent data storage in my app, and after looking around, I decided a FileOutputStream( http://developer.android.com/reference/java/io/FileOutputStream.html ) would probably be best for me. Right now, all I have is a LinearLayout with a series of CheckBoxes. I just need an efficient way to save the data, which is the only way a checklist is ever going to be useful. You should be able to hook checkboxes up straight into SharedPreferences. I could be wrong, since I haven't done anything like that in a while, and it might have been a function of a PreferencesScreen, but you should probably use SharedPreferences regardless, if it's a mostly static set of checkboxes. Otherwise I dunno.
|
# ? Aug 10, 2012 22:16 |
|
Doctor w-rw-rw- posted:are you not using an IDE to edit? You should be able to autocomplete most of that in seconds. Yeah I'm using Eclipse but for whatever reason it autocompleted to just this
|
# ? Aug 10, 2012 22:59 |
|
Doctor w-rw-rw- posted:You should be able to hook checkboxes up straight into SharedPreferences. I could be wrong, since I haven't done anything like that in a while, and it might have been a function of a PreferencesScreen, but you should probably use SharedPreferences regardless, if it's a mostly static set of checkboxes. Otherwise I dunno. I'm looking at this tutorial: http://developer.android.com/guide/topics/data/data-storage.html#pref This looks easy, and it would certainly work for storing a lot of binary data, but I'm not sure how this streamlines the process. It looks like I'd still have to address each CheckBox individually, I'm looking for a way to access them through a loop, or something, or together as one entire unit. Or am I just missing something about how preferences work?
|
# ? Aug 11, 2012 03:25 |
|
Zero The Hero posted:Hey guys, looking for some advice here. I'm trying to do some type of persistent data storage in my app, [...] all I have is a LinearLayout with a series of CheckBoxes. I just need an efficient way to save the data, which is the only way a checklist is ever going to be useful. SQLite, man.
|
# ? Aug 15, 2012 01:42 |
|
Lutha Mahtin posted:SQLite, man. Well, I looked into that. I was hoping to avoid it, partially because it's been a while since I used databases for anything, and partially because I haven't actually figured out all the fields it would need, and I'm not sure how much of a hassle it would be to update(see first reason). But now I'm looking into ListViews and I think it would make using SQLite a lot easier(and vice versa). Not entirely sure, though. This is the link I'm using: http://developer.android.com/guide/topics/ui/layout/listview.html . It looks like it can read and display an unspecified amount of data, I just have to make sure it can display that data as checkboxes. And figure out how the loader works.
|
# ? Aug 15, 2012 04:19 |
|
I've been working at trying to do some small inconsequential games over the past year and I keep hitting road blocks in my planning and development. Are there any guides on there for approach what is normally Java only development to accommodate android development? An example of one of the many small issues I'm running into: I'll create a java object and in the constructor for the object I would set a string value for a string data type, however Android wants to use the strings.xml for all the storage of string data. So do I just initialize the string value to null and then figure out how to access the strings.xml file for the data type or am I completely off base? If I could find some information or guides out there that hand hold for java to java/android that would probably clear up a lot of my frustration.
|
# ? Aug 16, 2012 16:06 |
|
n0manarmy posted:I've been working at trying to do some small inconsequential games over the past year and I keep hitting road blocks in my planning and development. Are there any guides on there for approach what is normally Java only development to accommodate android development? I'm not sure what you mean here. The lint tool will complain if you don't use strings.xml, but it's still possible to just use a String programmatically. What issues are you having accessing strings from your resources? It should be something like this: http://developer.android.com/guide/topics/resources/string-resource.html code:
|
# ? Aug 16, 2012 16:16 |
|
I think it was the (Context myContext) piece that I was not adding to my constructor for the data type. Because of this I wasn't able to access the strings.xml. These are little, yet big, things that I'm trying to work through that confuse me coming from straight Java.code:
|
# ? Aug 16, 2012 18:33 |
|
Strange problem... I have some EditTexts that will need to change between actionDone (in which case the IME should close) and actionNext (in which case the focus should move to the next EditText in the list). When I don't see any IME options, it works as it should, where the enter key moves focus to the next EditText. Likewise, when I set the appropriate IME options to IME_ACTION_DONE, it closes as expected. However, when I have an EditText which previous had IME_ACTION_DONE set, but then has IME_ACTION_NEXT set, it closes instead of moving focus to the next EditText. Is there something I'm failing to understand about how imeOptions is supposed to work? EDIT: It appears as long as ACTION_DONE is never set, setting IME_ACTION_NEXT works fine. This suggests to me that I need to somehow "clear" the previous imeOptions, but I can't figure out how to do that. I was under the impression that setImeOptions removed all previous options, but I must be mistaken. EDIT 2: Apparently IME option changes aren't recognized until the IME is closed and re-opened. As well, it seems you need to manually set Next Focus Down after switching from ACTION_DONE to something else. How I ended up getting it working the way I wanted was to write a custom OnEditorActionListener to handle the change of focus the way I wanted. PT6A fucked around with this message at 22:05 on Aug 16, 2012 |
# ? Aug 16, 2012 21:01 |
|
I've been trying to play with some of the samples in the directory C:\Users\HLC\android-sdks\samples\android-16\LunarLander. To do this, I've been using: New -> Android Project from existing code -> C:\Users\HLC\android-sdks\samples\android-16\LunarLander The problem is, this code does not properly resolve the "R" variable, and as such every reference to "R" has the error message "R cannot be resolved to a variable". From google, the most common cause is Eclipse automatically adding an "Import android.R" statement, but this is not the case in my program. The "lunar-layout.xml" has errors in it on every line with the "match_parent" statement: code:
Edit: Here's the code for the Lunar Lander and Lunar View classes Edit 2: I checked the "gen" folder, and there is no R.java file inside Edit 3: I fixed it after reverting to an old release of eclipse, restarting, reinstalling the android SDK. Not sure which one fixed the problem Hot Yellow KoolAid fucked around with this message at 03:34 on Aug 19, 2012 |
# ? Aug 19, 2012 01:31 |
|
That's odd. Doesn't the resource class get built during compile?
|
# ? Aug 19, 2012 05:00 |
|
R.java is recreated during compile, but eclipse auto-compiles it as you go, since you need it to reference against to keep autocomplete/intellisense from freaking out. A common cause for it failing to compile is the wrong java compiler compliance level. In eclipse, right click project -> properties, under Java Compiler, check the compliance level, it should be 1.6, with the default settings box under it checked. e: Also, if you tend to use sub-folders for separating out your code (like com.package.appname.subfolder), in those folders you can't indirectly reference the R class, you had to import it (import com.ferg.awfulapp.R;). At least you couldn't a while ago, I don't know if they ever fixed that. zeekner fucked around with this message at 05:18 on Aug 19, 2012 |
# ? Aug 19, 2012 05:13 |
|
Has anyone had any experience with theming their apps? I'm trying to theme 4 buttons and I want borderless buttons. However when I try to combine styles to simplify the app I can't. Single button code:
code:
code:
I ended up fixing the issue by embedding android:background="?android:attr/selectableItemBackground" in to the theme which gave me the same effect. n0manarmy fucked around with this message at 21:23 on Aug 20, 2012 |
# ? Aug 20, 2012 20:10 |
|
I'm trying to get Eclipse and the Android SDK set up on my laptop. I think I have everything installed properly, but Eclipse and/or ADB will not recognize my phone or my tablet (which are working perfectly with my main computer). I've installed the whole thing on OS X computers successfully multiple times, but this is my first time with a Windows machine, so is there some magic step I'm forgetting? I installed the USB driver for my tablet, but it still won't work. EDIT: Never mind, the right combination of restarts and unplugging/plugging it in finally got the prick working. I still have no idea why it wasn't working, or what I did to fix it so I can't help anyone else in a similar situation, but the important thing is that it's working now. PT6A fucked around with this message at 04:26 on Sep 4, 2012 |
# ? Sep 4, 2012 04:13 |
|
PT6A posted:I'm trying to get Eclipse and the Android SDK set up on my laptop. I think I have everything installed properly, but Eclipse and/or ADB will not recognize my phone or my tablet (which are working perfectly with my main computer). I've installed the whole thing on OS X computers successfully multiple times, but this is my first time with a Windows machine, so is there some magic step I'm forgetting? I installed the USB driver for my tablet, but it still won't work. adb kill-server && adb start-server often helps, 'cause it kills and restarts the daemon that connects to the Android devices.
|
# ? Sep 4, 2012 20:33 |
|
I'm trying to launch the Nook's "Shop Details" intent through phonegap (1.4.1). I'm new to Android and I'm a little confused. I need to trigger an intent with javascript. The original intent sample clode looks like this:code:
which appears to be built into PhoneGap. I can include the .js source, anyway. I saw some instructions that told me to add WebIntent.java to the project's /src/borismus folder but that just creates more errors. Am I barking up the wrong tree? code:
klem_johansen fucked around with this message at 03:06 on Sep 14, 2012 |
# ? Sep 14, 2012 02:22 |
|
I'm bashing my head against the keyboard in my iOS class right now because I hate obj-C. Was just digging through the iOS programming thread here and I saw a "C# / .NET for iOS" framework you can buy.... Then I saw it's available for Android too. Has anyone tried it? I really want to do Droid development, but I strongly dislike Java for no good reason other than I'm unfamiliar with it and Eclipse.
|
# ? Sep 25, 2012 23:34 |
|
Sab669 posted:I really want to do Droid development, but I strongly dislike Java for no good reason other than I'm unfamiliar with it and Eclipse. You could try Scala, at the very least it's free (I think it's better than both Java and C#, for what it's worth).
|
# ? Sep 25, 2012 23:53 |
|
Sab669 posted:I'm bashing my head against the keyboard in my iOS class right now because I hate obj-C. Was just digging through the iOS programming thread here and I saw a "C# / .NET for iOS" framework you can buy.... Then I saw it's available for Android too. Has anyone tried it? I really want to do Droid development, but I strongly dislike Java for no good reason other than I'm unfamiliar with it and Eclipse. Re: Mono: Note: I haven't used Mono, though I have looked into it at work. You're just trading the devil you know for the devil you don't. Both in terms of iOS -> Android, and in terms of switching to C#. Not that there aren't good reasons for switching, but you also indicate that you hate Objective-C and dislike Java. For the most part, hating on any kind of language quickly becomes trite and repetitive, and doesn't stop people from using them and writing decent software with them. Even PHP, as awful as it is, has a lot of software, some of which is very well-constructed. Apologies if this comes off as rude, but allowing language hate to dictate your choice of platform is an awful thing to do. Languages are languages. No matter how good a language you use, awful tooling or libraries will ruin it. As I understand it, C# is, if not in code, then at least in character, very similar to Java, though with a couple of nifty features thrown in and some lessons learned from Java. There's little to nothing fundamentally different in Java, Objective-C, and C#'s flavor of OOP; or rather, it's so similar that Mono can bridge C# to both fairly competently. Nothing is stopping you from trying Mono if you like C#, but keep in mind that your framework is a second-class citizen subject to breakage, and the languages are the least of your problems if you plan to do anything "real" with either platform. Platforms (the sum total of considerations involving available libraries and frameworks and device limitations) are what will dictate how good or bad of a time you have (hint: Android can be pretty bad, usually far worse than iOS). Also, since you won't be going beneath that abstraction directly, you may encounter unusual difficulty with debugging problems that come up. Re: Scala: Scala is going to be strictly worse than Java on Android. Slower, less tooling there, more finagling with bullshit other than just writing an app, which is already tough enough as it is. Not for the faint of heart, if you ask me. The language is good, the libraries are good, but the performance is worse. If nothing is particularly performance-dependent, you'll be in better shape but you're going to have major problems with building the app. Proguard has issues with Scala, and you'll be including a large jar containing the Scala runtime library. I haven't looked too far into Mirah, but since it can compile its source into Java source, and has no runtime library, it might be easier to debug than Scala.
|
# ? Sep 26, 2012 01:32 |
|
Saying "I hate Obj-C and Java, but I like C#" is either really dumb or really incomplete. Dumb if you're referring to syntax itself, given their similarities; incomplete if you're really talking about standard libraries, runtimes, or other things.
|
# ? Sep 26, 2012 06:44 |
|
So I'm following the steps on developer.android.com and I can't get past this. It says my Android support library is out of date so I click Install/Upgrade and it doesn't work. It says it fails to create that path. Also when I try to download the extras in the Android SDK it just says access denied. Am I doing something wrong? Is there anything I can do to fix it?
|
# ? Sep 27, 2012 09:18 |
|
|
# ? May 2, 2024 23:34 |
|
I remember coming across the same thing last month, as i recall, the solution was to add it in a different maner, the solution was found somewhat easily at stackoverflow searching "eclipse not recognizing blah, blah, blah...
|
# ? Sep 27, 2012 10:06 |