|
Thank you all.
|
# ? Feb 14, 2014 23:30 |
|
|
# ? May 28, 2024 14:57 |
|
I finished migrating my project to Gradle, but I compiled a release APK just now and noticed a couple of problems. The APK is 300% larger than when I was compiling it with ANT, and the Play Store now reports that this new APK includes localizations for every language, not just the two I actually have localizations for. What did I do wrong?
|
# ? Feb 15, 2014 20:42 |
|
Karthe posted:I finished migrating my project to Gradle, but I compiled a release APK just now and noticed a couple of problems. The APK is 300% larger than when I was compiling it with ANT, and the Play Store now reports that this new APK includes localizations for every language, not just the two I actually have localizations for. Try unzipping the APK and running du -h on the directory to compare file sizes for a better idea of the difference.
|
# ? Feb 16, 2014 01:59 |
|
I'm slowly trying to get into Android development so I'm doing a small game. I'm trying to draw tiles using one large tileset and then drawing each tile as a subrectangle. The problem I'm having is that only the first tile is actually drawn. I'm doing something like this: Java code:
|
# ? Feb 16, 2014 17:22 |
|
It might help to post your actual code since it depends exactly what you're drawing to, but the basic idea is:
If you're seeing drawing happen I'd guess it's a problem with your looping logic though? Try a couple of straight explicit definitions and see if they draw. Also you might be better reusing your Rect objects and using set to change the coords.
|
# ? Feb 16, 2014 18:35 |
|
baka kaba posted:It might help to post your actual code since it depends exactly what you're drawing to, but the basic idea is: Thanks, but it looks like I'm an idiot. I had a typo (in the real code) when setting the "right" parameter of the dstRect object. So for all tiles > 0 the right parameter was smaller than the left. Man I hate when the rectangles are defined by x1, y1, x2, y2 rather than x, y, w, h.
|
# ? Feb 16, 2014 19:40 |
|
Good news! Sorta This is a terrible url that probably won't work Still requires an initial width and height calculation, but then you can just shift the rect around - there's offsetTo as well
|
# ? Feb 16, 2014 19:51 |
|
Any prefered libraries to calculate running pace? Do running apps use info from the maps api or use accelerometer data from the device? How is this tested at home- do you just have to go for a jog or can you set up some tests at home? I'll be researching this today and just thought I'd start here if anyone had some experience with this sort of thing. Found this: I'll be starting from here I reckon. It looks like it might be pretty simple using the gps fine location. I'm just going for real-time speed data. Calculating that from the internal sensors looks like a real pita based on some SO questions. vvvvvvvvv Infomaniac fucked around with this message at 19:05 on Feb 17, 2014 |
# ? Feb 17, 2014 18:34 |
|
Infomaniac posted:Any prefered libraries to calculate running pace? Do running apps use info from the maps api or use accelerometer data from the device? How is this tested at home- do you just have to go for a jog or can you set up some tests at home? There's two separate things to use; the Location APIs (GPS), and the Motion Sensor APIs (Accelerometer/Linear Accelerometer). There's probably someone's library to help out, but it's a question of whether you want aggregate info about your general pace, distance, etc, or whether you're looking for more of a pedometer.
|
# ? Feb 17, 2014 18:47 |
|
I wrote my first app using PhoneGap and I'm now ready to get it on the store. This is going to be a paid app so I'm now having trouble figuring out the licensing stuff I need to do. Since everything was done in the HTML/JS/CSS, I'm a bit lost now that I have to dive into the Java code. I mean, all I have for my src java file is this:code:
|
# ? Feb 21, 2014 18:11 |
|
Wow, great OP in this thread. I'm just getting started in Android development and found the info really useful. One thing I'm curious about, is there any pattern for MVC/MVVM/etc. style application development in Android? I've done stuff in the windows and web worlds where there's nice databinding support so you can build a simple model and bind its values directly to UI elements (i.e. updating an edit box changes the value of a model property automatically). From looking at the Android docs and searching around a bit it doesn't seem like there's anything native in the Android SDK for it. Is there any mature or frequently used libraries for MVC style development in Android?
|
# ? Feb 21, 2014 20:21 |
|
mod sassinator posted:Wow, great OP in this thread. I'm just getting started in Android development and found the info really useful. Friend of mine wrote this: https://github.com/depoll/bindroid
|
# ? Feb 21, 2014 20:28 |
|
Nice, I'll check it out. I'm also curious what do folks prefer for a development IDE? I've played with the Eclipse-based ADT, IntelliJ-based Android Studio, and normal IntelliJ with Android SDK. I really like the IntelliJ IDE compared to Eclipse--the UI builder seems much nicer in IntelliJ and the IDE doesn't seem as clunky as Eclipse. I wanted to like AS, but the gradle-based system seems like it's way too cutting edge for someone starting out. Simple stuff like adding an external library or unit tests are infuriatingly difficult in AS (and also terribly documented with many blog posts showing bad or outdated ways to do it). I've settled on IntelliJ 13 CE with the Android SDK since it's 99% of AS but with the normal ant-based build system. For anyone that's gone down the path of IntelliJ, do you have any regrets or major issues? As far as prototyping and quickly iterating on UI designs, are there any better tools than what's built into the major IDEs? I really like IntelliJ's view with the layout XML next to a live updating preview of the design.
|
# ? Feb 21, 2014 20:50 |
|
mod sassinator posted:Wow, great OP in this thread. I'm just getting started in Android development and found the info really useful. Thanks, I've actually been slacking though - a ton of new useful libraries and development techniques have cropped up since my last update. I'm hoping to update the OP again soon, I'm just a lazy rear end in a top hat. Personally I've been using Android Studio lately. If something is on maven central it really makes pulling in dependencies incredibly easy. If you need any specific help with getting Gradle working or importing a library project that's all code just post in here and we should be able to help you through it (assuming you want to give AS another shot). Before AS though I definitely used IntelliJ and found it a lot nicer than Eclipse to work in. For prototyping UI designs I typically work straight with the xml and use IntelliJ/Android Studio's live preview. It works really well. Just make sure to use View.isInEditMode() when making custom views to prevent errors/warnings popping up in the preview.
|
# ? Feb 21, 2014 21:19 |
|
I'll see how things go with IntelliJ for now--once I understand more about gradle, maven, etc. I might check out AS again. Some of the libraries mentioned in the OP look really handy, like RoboGuice and AQuery. Are there any other extremely useful, general libraries to check out? For controls, SlidingMenu looks really nice. Any other widely used and useful controls to check out?
|
# ? Feb 21, 2014 22:31 |
|
mod sassinator posted:I'll see how things go with IntelliJ for now--once I understand more about gradle, maven, etc. I might check out AS again. Yeah, this is one reason I need to update the OP. RoboGuice isn't terribly performant, Dagger is probably the DI framework of choice on Android. I'd also recommend Ion (web requests/image loading) or OkHttp/Retrofit & Picasso(image loading) over AQuery these days. AQuery has a few bugs that can be a pain to work around. I feel like I write better code using the other libraries. quote:For controls, SlidingMenu looks really nice. Any other widely used and useful controls to check out? SlidingMenu is nice but Google provides a NavigationDrawer which is built into the system (well, the support library) and is really preferred as you end up with a control that is more familiar to users. For checking out other controls DevAppsDirect is a really nice app. It incorporates demos for a large number of 3rd party applications. Some neat ones off the top of my head: Etsy's staggered grid, cardslib (mimic Google's cards style a la G+/Google Now), and Crouton (toast like notifications tied to a particular View instead of just showing up haphazardly). One other app that is really nice for development is DevDrawer. Add it as a widget and add your package names to it (com.glimm.*) and all apps with that package will be listed there, so you can quickly open them/delete them/clear their data. It'll remember which apps you're working on - so as soon as you install an app that matches it'll show up in the list. Pretty handy. Glimm fucked around with this message at 02:41 on Feb 22, 2014 |
# ? Feb 22, 2014 02:38 |
|
Man, managing jar dependencies is a bit of a nightmare. I'm trying to add the hamcrest library to an android unit test project, but when I do I keep getting this error on build: Android Dex: [AndroidTests] Unable to execute DX Android Dex: [AndroidTests] com.android.dex.DexException: Multiple dex files define Lorg/hamcrest/Description; It seems like this means there are multiple libraries, but as far as I can tell this is the only one. Anyone else run into this? Also, am I just doing something wrong or is managing jar dependencies a big nightmare? It seems like I have to fight every library I add to make it work. Really feels like I'm doing something wrong.
|
# ? Feb 22, 2014 02:42 |
|
mod sassinator posted:Man, managing jar dependencies is a bit of a nightmare. I'm trying to add the hamcrest library to an android unit test project, but when I do I keep getting this error on build: You're using the legacy IDEA build config, right? You probably need to set the duplicate JAR reference to Provided. e: Gradle handles that kind of thing automatically, so whenever you get into that it'll save a lot of trouble.
|
# ? Feb 22, 2014 03:59 |
|
Yeah the weird thing is as far as I can tell I only have one jar with hamcrest, but I think junit uses it internally too so it might be confusing things. I gave up on trying to use hamcrest for now and will just stick to the asserts provided by the Android SDK.
|
# ? Feb 22, 2014 04:56 |
|
Starting to feel like I really need to use maven. Looking at how to use Dagger and it seems like manually installing it isn't documented, and is pretty sucky (all kinds of wackiness with configuring a new compiler library and such). Is there any good overview of how to use maven and the android sdk? I've seen a bunch of stack overflow questions that seem to say different things. To make sure I understand stuff correctly too, maven is basically a replacement build system that also does dependency management (like downloading dependencies from a central repository), right? I.e. if I switch to maven my project needs to switch away from its ant-based build system. And just to humor me, is gradle yet another build system to consider? Do gradle and maven work together? Sorry for the basic questions--still pretty new to Android development. edit: Ah, this SO question has a great breakdown of each system: http://stackoverflow.com/questions/1163173/why-use-gradle-instead-of-ant-or-maven I really don't like clunky XML-based build systems and like what gradle is trying to achieve. Sounds like I should give gradle a second shot. mod sassinator fucked around with this message at 07:16 on Feb 22, 2014 |
# ? Feb 22, 2014 07:06 |
|
mod sassinator posted:Starting to feel like I really need to use maven. Looking at how to use Dagger and it seems like manually installing it isn't documented, and is pretty sucky (all kinds of wackiness with configuring a new compiler library and such). Is there any good overview of how to use maven and the android sdk? I've seen a bunch of stack overflow questions that seem to say different things. Yea, gradle is the way to go. Maven support is only through third-party build plugins and it's a bit of a pain to manage. Thankfully gradle does make use of the maven repository, so you still have access to almost everything maven would have. This site is pretty useful when you need to find dependencies: http://gradleplease.appspot.com/ It'll look up the package name and give you the most recent version. If you want a quick and dirty way to convert to gradle, you can do it in a few steps: 1. Create a new dummy project in Android Studio, it doesn't matter the package name or anything. 2. Copy these files from the dummy to your project: gradlew gradlew.bat gradle/ (copy the folder and contents, skip .gradle as it's just a temp folder) gradle.properties (if it exists, it'll probably be empty) build.gradle settings.gradle (edit this and replace the dummy folder name) (AppName)/build.gradle (you'll need to edit this to add any dependencies/signing configs/ect) Once you've copied the files over, you just need to move the folders for src, assets, res, and the manifest. The standard layout is this: (AppName)/src/main/java/(com/whatever/yourname) (AppName)/src/main/assets/ (AppName)/src/main/res/ (AppName)/src/main/AndroidManifest.xml For tests: (AppName)/src/instrumentTest/java/ Some conversion guides just use a modified build.gradle that overrides the folder locations to point to the old folder structure, but I figure it's easier in the long run to just move them. Delete any .iml files and the .idea folder to prevent any IDE issues. Then just open the project in Android Studio, it'll automatically import and try to build it. One little bug to watch out for: when AS tries to import the project, make sure it's not trying to point to (ProjectFolder)/gradle, and make sure the gradle wrapper option is selected. If you have JAR files in the libs folder, they'll automatically be included like normal, but it's a good idea to replace them with maven references. Using local copies of android libraries is a little bit of work, try to find a maven version to save you some trouble. That should leave you with a build, from there you can add a signing configurations to handle release builds. If you run into any snags, try to compare the config to your dummy project. Also make sure to hit the "Sync Gradle" button when you edit a gradle file. AS will pop up a little reminder at the top of the window. zeekner fucked around with this message at 09:26 on Feb 22, 2014 |
# ? Feb 22, 2014 09:24 |
|
FYI I've updated the OP with what I hope is better, more current information. There are a few interesting projects I'd like to talk about and maybe add to the list of libraries but I think this is better than recommending Eclipse/SlideMenu/ActionBarSherlock/RoboGuice like it was before.
|
# ? Feb 22, 2014 16:26 |
|
Awesome--I'm really impressed with Square's libraries. Those guys really seem to be on top of Android development. Starting to play with AS again, and now that I realize gradle is the one true way to use it it's not so bad. I just want to check, with the latest version of AS you still have to run your instrument tests through a terminal with the gradlew connectedCheck command right? I tried making a run configuration for tests but it bombs out with a test runner error and all the SO answers seem to indicate running tests is only through the terminal right now.
|
# ? Feb 22, 2014 22:42 |
|
mod sassinator posted:Awesome--I'm really impressed with Square's libraries. Those guys really seem to be on top of Android development. I should hope so. Bob Lee, their CTO, previously led core library development on Android at Google.
|
# ? Feb 22, 2014 22:53 |
|
Cool--with gradle and maven I got the hamcrest library working for tests. A few things that threw me off, if you just search for hamcrest on gradle, please you'll get a reference to some older version that doesn't work with android. You need to find the libary on maven central and after some googling find out you really need to include just a few components of the library in your build.gradle:code:
code:
code:
I'm curious to understand the duplicate file issue--what's actually happening that causes the error? It's a little concerning to me that libraries which happen to have duplicate files will completely break your build. Is it a bad library, or just a quirk/issue of how APKs are built?
|
# ? Feb 22, 2014 23:25 |
|
This is dumb, but where do you see the logcat output from a unit test run in IntelliJ? I want to see some stuff being logged during the test run, but when I go to the logcat view after the test run it's not updated. Seems like the logcat view only shows data from actual runs. I have to be missing something obvious--how do you see the logcat from a test run? edit: Found an option for my test run configuration to clear the logcat before running. Checked this and the logcat is cleared, but there's still nothing being written to it. Wtf, is this a bug of AS? mod sassinator fucked around with this message at 02:57 on Feb 25, 2014 |
# ? Feb 25, 2014 02:49 |
|
mod sassinator posted:This is dumb, but where do you see the logcat output from a unit test run in IntelliJ? I want to see some stuff being logged during the test run, but when I go to the logcat view after the test run it's not updated. Seems like the logcat view only shows data from actual runs. I have to be missing something obvious--how do you see the logcat from a test run? Possibly. You can always just do lolcat from the commandline, which has various benefits/drawbacks.
|
# ? Feb 25, 2014 04:53 |
|
Ok, trying to use AndroidStudio again. Now I'm having the "exciting" issue where it's throwing a fatal exception in code that doesn't exist in my project, because somehow it cached the very first version on the AVD and absolutely refuses to change it for any reason whatsoever. uninstalling the APK doesn't do poo poo. I even tried bumping the version number, and the new version number shows up, but it still throws a NPE on a line that's past the end of my file. The NPE (was) in the boilerplate code where it was binding to a button by ID that I renamed. So somehow it's still running the template code that comes with a new project, but using my layout with different names. WTF google. Edit: ... deleting build didn't fix it, wiping the AVD didn't fix it, but running my project in the debugger did, and now when I change code it's reflected in the apk. How bizarre. Harik fucked around with this message at 07:45 on Feb 26, 2014 |
# ? Feb 26, 2014 03:45 |
|
What's a good, cheap SDK that'll simplify game development? I want to dabble in making awful, lovely-looking Android games but there are just too many options. On a related note, GameMaker has a sale right now: upgrades from Standard to Professional are $35 instead of $99. This'd let me test games on Android, but I'd have to shell out another $199.99 to purchase the module that lets me compile the finished product so I can release it on the Play Store. Should I upgrade? Edit: I want to add to the endless sea of blackjack games so I'd only need to work in 2D for now. IAmKale fucked around with this message at 16:06 on Feb 26, 2014 |
# ? Feb 26, 2014 16:04 |
|
LibGDX is pretty nice, it's not a pre-built game engine like GameMaker but definitely a pretty nice framework. They set up the project structure such that you can run the same game on Android or directly on the desktop, so you can quickly jump between them.
|
# ? Feb 26, 2014 16:47 |
|
Any tips on how to add a resource file to a gradle test project (the standard instrumentTest folder)? I can create a res/raw folder but I don't know how a R.raw.file value is generated like in the non-test project. I need the resource ID so I can load it from my test case.
|
# ? Feb 27, 2014 22:19 |
|
Looks like there's a getResourcesForApplication(packageName) on PackageManager, I think that will do it.
|
# ? Feb 27, 2014 23:58 |
|
So I find myself in the position of having to support development of an android app, and it looks like I'm going to be expected to run and test the interface myself on an actual device. I would really rather not do this manually, and some googling turned up something called "selendroid". Is this the way to go? I basically need to simulate a metric shitload of swipes and feed them to the app. (this is way outside of my comfort zone, I'm not at all a front end person)
|
# ? Feb 28, 2014 08:55 |
|
I had never heard of that one before. We use Robotium which looks similar. One of our QA guys has set up a Jenkins slave box on a Mac mini that has half a dozen different phones plugged in, so when you kick off a build it runs the instrumentation tests on every phone simultaneously.
|
# ? Feb 28, 2014 14:51 |
|
kitten smoothie posted:I had never heard of that one before. We use Robotium which looks similar. One of our QA guys has set up a Jenkins slave box on a Mac mini that has half a dozen different phones plugged in, so when you kick off a build it runs the instrumentation tests on every phone simultaneously. Cool, I'll check that out too, thanks. Maybe it worked? I had to totally blow away my Eclipse project directory but stuff seems to be happening. fritz fucked around with this message at 03:38 on Mar 1, 2014 |
# ? Mar 1, 2014 03:16 |
|
fritz posted:Cool, I'll check that out too, thanks. R.java is autogenerated when the project builds. I always had issues with Eclipse failing to rebuild it automatically, I'd have to clean workspace + rebuild to fix it.
|
# ? Mar 1, 2014 04:29 |
|
In case anybody's curious, the primary issue after going line-by-line was a TextView.setText was receiving a char, which I thought was fine, and triggered no IDE errors, but was apparently super not fine. Literally Elvis fucked around with this message at 10:21 on Mar 1, 2014 |
# ? Mar 1, 2014 09:31 |
|
OK, so I have a very basic thing working going through eclipse and the "android create project" workflow. I got to https://developer.android.com/training/basics/actionbar/index.html however I'm getting errors: EDIT: I nuked lots of stuff, pointed Eclipse to the "right" directory, re-followed the actionbar stuff and I'm getting a little bit farther. The homebrew installation has an examples directory, and I went there to try to build some of those to see what would happened. I went to samples/android-19/ui/ActionBarCompat-Styled and, following the README.txt, ran "./gradlew build". It dl'd a bunch of things, but doesn't build. Here's what happens: code:
code:
code:
EDIT: line 14 is: code:
fritz fucked around with this message at 02:48 on Mar 3, 2014 |
# ? Mar 3, 2014 00:01 |
|
fritz posted:Eclipse/Gradle question? I'm not sure the Gradle build system functions with Eclipse at the moment. Maybe try Android Studio? Speaking of! 0.5.0 is out now: http://tools.android.com/recent/androidstudio050released http://tools.android.com/tech-docs/new-build-system woop woop Glimm fucked around with this message at 00:48 on Mar 7, 2014 |
# ? Mar 7, 2014 00:43 |
|
|
# ? May 28, 2024 14:57 |
|
Poking around with the Facebook sdk has lead me into new realms of insight and frustration. Implementing graph calls led me to write some methods to populate views in ways that I eventually discovered were already provided through the facebook classes. It took some fiddling and detective work to work out that the Facebook classes are useful and powerful, but somewhat poorly or unintuitively named. The api documentation is not great in my opinion.
|
# ? Mar 9, 2014 00:28 |