|
What is Android? Google’s quirky, beautiful, mobile operating system. Initial Setup
Learning Android
Distributing Applications
Android development/design blogs
Useful(?) Tools, libraries, apps, and links Note: use Gradle, please to find the correct invocation to bring most of the libraries into your project using Gradle
If you're wanting to play around with different libraries and controls check out the DevAppsDirect application. It provides a nice interface for downloading and running samples of many popular libraries. Open Source Projects Worth Checking Out
FAQ • I need more help. The documentation is poo poo and Android is whack. Can’t I just talk to the Android team directly so they can fix my broken code? Sure! Add Android Developers to your circles on Google+. They typically hold developer office hours via Hangout on Wednesdays at 2pm Pacific (UTC-7). It’s pretty awesome, it’s not improbable to get your question about doing something crazy in ListView answered by Romain Guy in one of these. The Google TV team does this as well, but at 1pm Pacific. • I love the animation used in the ICS launcher but I’m not sure how to reproduce it, how can I do that without hassling someone else? One of the great things about Android is that the OS is open source. If you fancy using something you see in the OS in your own application but it isn’t available directly through the Android API check out the AOSP directly and modify the code to your needs. • I prefer brainfuck and MUMPS to Java, isn’t there another language I can use for Android applications? I think so! Besides using the NDK (which probably isn’t a good idea to use unless you’re writing a game or something) some developers have been using Scala with success. I’m not one of them but perhaps someone with Scala+Android experience will be kind enough to post a trip report in this thread. • How do I add in-app purchases to my app? Check out the developer docs on In-App Billing. • Android is terrible, my app crashes whenever I change orientation - why!? Go back to Android Basic Training, specifically Managing The Activity Lifecycle - Recreating An Activity. The Android Documentation posted:Caution: Your activity will be destroyed and recreated each time the user rotates the screen. When the screen changes orientation, the system destroys and recreates the foreground activity because the screen configuration has changed and your activity might need to load alternative resources (such as the layout). How do I Gradle? • Forums member Uncomfortable Gaze gives a brief rundown on converting to Gradle What versions of Android should I support? • Good question. If your app is already out there you should be able to check your install breakdown via the Play Store Developer Console. Use that data to decide for yourself. My personal opinion? minSdkVersion=14 is upon us. Users who are still on 2.x probably aren't going to download and use apps anyway. Check the monthly OS version breakdown on the Android Developer Dashboard page. (Suggestions on updating/modifying this OP are welcome!) Glimm fucked around with this message at 01:37 on Feb 23, 2014 |
# ¿ Jun 18, 2012 03:31 |
|
|
# ¿ Apr 28, 2024 08:56 |
|
Geekner posted:Glimm, you should add a link to Awful for Android's source to the OP. It's a good example of a modern Actionbar(sherlock) based app with tablet functionality. Done. Also, did anyone notice the developer.android.com redesign?
|
# ¿ Jun 23, 2012 03:04 |
|
Doctor w-rw-rw- posted:Yes. It's horrible. Less readable. Odd, I find it easy on the eyes. What I really like is the ActionBar styling and the autocomplete in the search box, just looks pretty to me.
|
# ¿ Jun 23, 2012 04:16 |
|
If anyone is interested in some swipe to dismiss example code Roman Nurik posted some on Google+ recently: https://plus.google.com/113735310430199015092/posts/Fgo1p5uWZLu Which Jake Wharton helpfully backported to utilize his Nine Old Androids (animation library): https://github.com/JakeWharton/SwipeToDismissNOA (I've updated the OP to include a link to the Nine Old Androids project)
|
# ¿ Jun 24, 2012 14:50 |
|
Thermopyle posted:New stuff for devs: To elaborate on this here is Google's dev page on 4.1: http://developer.android.com/about/versions/jelly-bean.html#google
|
# ¿ Jun 27, 2012 18:18 |
|
TheReverend posted:Hey dudes, I'm coming from an exclusively C# workplace and I'm having some XML issues. In .NET, XML that was formatted like a datatable was pretty easy to sort through, edit columns, add columns, edit rows, delete rows, add rows, etc. I've actually never had to work with xml on Android (the one time I had xml data it was a one-off and I just parsed it into json with a short Python script), so sorry not to have any great advice to give. But this article looks promising, have you checked it out? http://www.ibm.com/developerworks/opensource/library/x-android/
|
# ¿ Jun 27, 2012 18:20 |
|
NoDamage posted:Just curious, how are you guys dealing with this? 90% of devices are still below 3.0. ActionBarSherlock all the way. It is pretty seamless for the most part.
|
# ¿ Jun 28, 2012 12:38 |
|
NoDamage posted:Since ActionBarSherlock requires me to compile against Android 4.0 but I want to target 2.3, is there a way to have Eclipse tell me if I've accidentally used an API not available in 2.3? I seem to remember reading this was possible but can't find the source again. Android Lint should handle this, check the newAPI section here: http://tools.android.com/tips/lint-checks As long as you properly set your minSdk/targetSdk you should get warnings when you use newer APIs while supporting older versions, you can then use these warnings to ensure you're guarding against the older versions attempting to use those APIs.
|
# ¿ Jun 28, 2012 14:44 |
|
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 |
|
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 |
|
Thermopyle posted:Android development isn't wonderful by any means, I think it's fun Thermopyle posted:but I don't think it has anything to do with the activity level in this thread. I mean, it's apparent that Android development is wide-spread, I think its just that there's better resources for getting help a lot of the time. This is my feeling as well. I think the thread is serving its purpose if it is pointing those interested in Android development at decent resources to help solve their problems. I should probably update the OP more often as it seems like useful Android libraries are popping up every week. Doctor w-rw-rw- your post of horrors gives me a sad. Supporting older OS versions is probably the most frustrating part of Android development.
|
# ¿ Sep 29, 2012 01:34 |
|
Thermopyle posted:That would be something I'd like to see more posts about. I always miss out on new libraries until they've been out for 2 years or something. One of the reasons I haven't been posting new libs myself is I haven't had time to really use any of them. In my day job I'm working on iOS and lately I've been too lazy to work on anything in my spare time. But I'll post some things I've seen recently that look neat to me! Most of these I've found from the #AndroidDev Weekly mailing list, so if you'd rather read about this things directly feel free to subscribe. Libraries: The Ultimate Android Library - These guys basically created a site to do what I'm doing here, list a bunch of Android libraries. They put out an example app as well to show them in action. You know it's good because it has the word 'Ultimate' right in the title. Android Bootstrap - "A template/bootstrap/boilerplate application that includes tons of great open source tools and frameworks" (GitHub link) Crouton - Cyril Mottier wrote a blog post about his idea of a replacement to Android Toast's and this guy provided an implementation of it. Looks pretty cool, basically context sensitive notifications that are tied to a particular window. SpongyCastle - Android's Bouncy Castle (security library) isn't quite complete, this lib fills in the missing gaps. OAK - "OAK is a powerful kit of tools and components to use in your Android project (Compatible with API Level 8+)" (image caching, pinned header list view, section adapter, auto-resizing textview,, encrypted shared prefs, some other stuff). Undergarment - Slide out menu navigation library. Pretty straight forward, seems to work well. Tools: Android Holo Colors Generator - "The Android Holo Colors Generator allows you to easily create Android components such as editext or spinner with your own colours for your Android application. It will generate all necessary nine patch assets plus associated XML drawables and styles which you can copy straight into your project." j2ObjC - translate Java to Objective-C. Google uses this tool to write their poo poo in Java and then translate to Javascript (with GWT) so they can write some code once in Java for the web, Android, and iOS! Pretty snazzy. Though there are some pretty obvious limitations (specified on the project page). android-unused-resources - clean up unused resources in an Android project. Hallelujah. Glimm fucked around with this message at 02:44 on Sep 29, 2012 |
# ¿ Sep 29, 2012 02:41 |
|
Doctor w-rw-rw- posted:Android-unused-resources is great. However, and without trying to paint the strokes too broadly, I'm going to go out on a limb and say most of us don't use most of these extra libraries if we do Android for a living. Have you tried building an app with lots of libraries? Here's what can happen: Yeah this is definitely something to weigh while creating an app. It's pretty easy to have an empty shell of an app with an apk around 7-10MB. quote:* Android tools update. You decide to update. Guess what? they changed the directory libraries go in without telling you. It's now libs/ instead of lib/. This was annoying as hell. Geekner posted:Definitely going to give this one a try, been looking for a decent image caching solution. I haven't personally used OAK yet so I'm not sure how it handles, but I've used AQuery in the past and it's fantastic. I'd probably try that first unless you're interested in other features OAK provides as well.
|
# ¿ Sep 30, 2012 00:08 |
|
Geekner posted:I recently did a fresh install of the SDK on a new system, and I gotta say the hardware-accelerated Intel emulator is really loving sweet. I'm able to run Awful with gifs playing at full speed. No extra effort unless you run native code (then you have to add the intel build target). Yeah it's pretty awesome. Before an official x86 emulator was around I'd sometimes use the Google TV emulator just to mess with something where the speed wasn't abominable. In Android news for the day Android's new build system has been officially announced and is at version 0.1, yay! https://plus.google.com/109385828142935151413/posts/XnW7t9XJCMJ http://tools.android.com/tech-docs/new-build-system Xav posted:
Glimm fucked around with this message at 00:02 on Oct 4, 2012 |
# ¿ Oct 2, 2012 23:47 |
|
Interesting post Ferg linked to on Google+: Reverse Engineering Android: Disassembling Hello World quote:When it comes to learning Android, it’s amazing how easy it is to find tutorials, code samples, and documentation to immerse yourself into the world of Android. Interestingly, I’ve found the inverse to be true for the, dare I say, way cooler world of hacking Android. Reverse engineering Android applications can be really fun, and give you a decent knowledge for the inner workings of the Dalvik Virtual Machine. This post will be an all-out, start-to-finish, beginners* tutorial on the tools and practices of reverse engineering Android, through the disassembly and code injection of the Android Hello World application.
|
# ¿ Oct 10, 2012 14:54 |
|
This is pretty cool: http://www.androidviews.net/ Lots of different helpful views/libraries to use in your own projects.
|
# ¿ Dec 4, 2012 16:32 |
|
jkyuusai posted:Learnin' I lazily linked to this post from the OP and added Drag-Sort-ListView to the list of useful libraries.
|
# ¿ Dec 11, 2012 21:19 |
|
Doctor w-rw-rw- posted:Neat, thanks. Mind adding the link to SlidingMenu? It's mentioned in the same line as DSLV but not as its own bullet. Oh oops, I thought I had added that awhile ago!
|
# ¿ Dec 12, 2012 01:10 |
|
Doctor w-rw-rw- posted:It's career ending if Android was supposed to be a 1-or-2 month side project that you really didn't want to do in the first place, but did because you were the most qualified at a small company you liked -- then ended up doing for two years, neglecting your other skills and passions, hating yourself the whole time. My situation isn't common I'm sure. It's gotten to the point where I've stopped caring about my work and about programming, even though I've been doing it for 80%+ of my life - and I'm not even 25 yet. That really sucks I find myself in a bit of the opposite situation (I mostly work on iOS), though I don't have such an extreme distaste to iOS development as you have built up to Android. I wish I had more time on the side to work on Android stuff, c'est la vie. In other news, this looks like a handy project: https://github.com/cesarramirez/ADG-Android_Drawable_Generator quote:This is a tool that allows for the automatic creation of drawables resources for the different screen densities in an Android projects. Uses perl and Imagemagick to do its work. Looks neat.
|
# ¿ Dec 12, 2012 18:43 |
|
IntelliJ for personal use is on sale right now, $50 (normally $200): http://www.jetbrains.com/specials/index.jsp I also picked up PyCharm ($25) though I typically use Vim for Python stuff, as I buggered my autocomplete settings for Python last weekend and can't be arsed to fix it; I've never used PyCharm - hope it doesn't suck. IntelliJ however I think is pretty awesome and if you hate Eclipse maybe give it a shot (there is a free Community Edition as well).
|
# ¿ Dec 21, 2012 00:16 |
|
ultramiraculous posted:You might want to ask for a refund on PyCharm if you bought IntelliJ. All of the features of PyCharm are actually in the Python plugin that comes with IntelliJ Ultimate. Oh dear, thanks for the heads up!
|
# ¿ Dec 21, 2012 00:40 |
|
Doctor w-rw-rw- posted:it'll save you from writing Java code. This sounds worth it.
|
# ¿ Feb 8, 2013 14:39 |
|
Doctor w-rw-rw- posted:
quote:
Actually, this should be okay now: http://developer.android.com/about/versions/android-4.2.html#NestedFragments As far as I know nested Fragment support works in the support library as well. It looks like the person who made this StackOverflow post was having a similar issue and solved it: http://stackoverflow.com/questions/7707032/illegalstateexception-when-replacing-a-fragment Glimm fucked around with this message at 03:29 on Mar 9, 2013 |
# ¿ Mar 9, 2013 03:26 |
|
Karthe posted:What's the best way to close a foreground activity and pass info back to the parent activity after rotating the screen? My app displays two columns in landscape mode and one column in portrait mode. When the device is in portrait mode, tapping on a listView item in Activity A starts up Activity B and displays additional information about that entry. Maybe use one Activity with a landscape orientation containing two Fragment containers and a portrait orientation with only one, and just maintain state within the single Activity?
|
# ¿ Mar 12, 2013 15:24 |
|
Karthe posted:I tried using FragmentTransaction's earlier to do the whole two-column-landscape/one-column-portrait but it got real messy, or at least was beyond my ability. Maybe check out the Master Detail View sample that comes with the SDK? Create a new project within Eclipse (target SDK 11+) and select the Master Detail View template and try to match what you're doing with the sample.
|
# ¿ Mar 12, 2013 16:13 |
|
Has ActiveAndroid come up before? Can I gush over this library for a bit? https://github.com/pardom/ActiveAndroid ActiveAndroid posted:ActiveAndroid is an active record style ORM (object relational mapper). What does that mean exactly? Well, ActiveAndroid allows you to save and retrieve SQLite database records without ever writing a single SQL statement. Each database record is wrapped neatly into a class with methods like save() and delete(). Examples pulled from the GitHub page: Create some model classes code:
code:
https://github.com/pardom/ActiveAndroid/blob/master/src/com/activeandroid/content/ContentProvider.java Haven't used it much, just set it up today for a new project. But so far, so good. Glimm fucked around with this message at 14:59 on Mar 23, 2013 |
# ¿ Mar 15, 2013 23:19 |
|
Anyone else looking for a mobile focused dev conference to goto? I didn't win the I/O lottery so I've been looking at a few options. AnDevCon Boston (28-31st May) looks fairly promising, kind of pricey at $1395 a ticket. Droidcon London (24-27th October 2013) seems awesome. Much cheaper (£100 ~ $152 USD). The ticket+flight will actually be cheaper for me if I go this route, and hey - it's in London! I'm not really sure what to expect out of training sessions/classes/talks as I haven't been to either conference or any major dev conference. Anyone checked these out before?
|
# ¿ Mar 21, 2013 16:17 |
|
Murodese posted:I bought a copy a few years ago when I started doing Android dev, and it worked pretty well. Had a few minor bugs here and there (which I'm sure they've fixed long since). Are we talking about the same library? https://github.com/pardom/ActiveAndroid This is released under the Apache license and appears to have only been under development for 4 months or so.
|
# ¿ Mar 23, 2013 14:58 |
|
GenJoe posted:Is there a way to programatically disable the android WebView from loading the mobile version of a website? It seems that the WebView defaults to loading mobile versions, but for my purposes I pretty much need it to load the default version of the website. Maybe try using WebSettings: http://developer.android.com/reference/android/webkit/WebSettings.html#setUserAgentString%28java.lang.String%29 code:
|
# ¿ Apr 1, 2013 20:59 |
|
Small White Dragon posted:Is it possible to scale a view in Android? If so, how? That is strange advice, Android Views don't have width/height directly - those are calculated based on top/bottom/left/right. You could animate those values though. Could you use a ScaleAnimation? http://developer.android.com/reference/android/view/animation/ScaleAnimation.html Something like: code:
|
# ¿ Apr 5, 2013 20:15 |
|
Sab669 posted:Hey guys, I'm looking for a particular app that doesn't quite seem to exist so I thought I'd try to make it myself. I've got a good bit of C# experience but very very little with Java and mobile development. That sounds really simple to me. You might look into using Xamarin Studio (http://xamarin.com/studio) and just writing the app in C# if that's what you're familiar with. I haven't used it but from what I understand you don't need a license to create small applications (I don't know what the cutoff is exactly but it sounds like you would not come close to it).
|
# ¿ Apr 10, 2013 19:37 |
|
Sab669 posted:I've considered using Xamarin but figured I should probably brush up on my Java skills because I need a new loving job. I don't think Xamarin really makes it any easier to develop ultimately. And with the free license you can build apps and test them on a virtual device but you can't actually publish them I believe. I briefly used it to emulate a barcode reader for work but never got far with it The old Xamarin suite (MonoTouch?) worked that way, but the new one (Xamarin Studio) does allow you to work on actual hardware (this I've seen) and from what I understand you can even publish apps under a certain size (32k of IL code according to http://xamarin.com/monoforandroid - doesn't sound like much but I think it would fit your use case). Doing it in Java isn't a bad idea, I just suggested Xamarin given your C# background. I don't think it would take too long to do what you're trying, if you get hung up feel free to post some code and ask for advice.
|
# ¿ Apr 10, 2013 22:00 |
|
Karthe posted:Does the Play Store not check an app's minimum SDK level and auto-exempt devices that are running an earlier version of Android? It does. This is generally a good way of excluding older devices. I generally target 2.3+ now, and am really considering moving to 4.0+. You could check over the filters documentation for filtering on other things which might help: http://developer.android.com/google/play/filters.html
|
# ¿ Apr 22, 2013 02:33 |
|
edit: I'm an idiot
Glimm fucked around with this message at 00:21 on Apr 24, 2013 |
# ¿ Apr 24, 2013 00:10 |
|
Salvador Dalvik posted:Huh? I saw the response before you deleted it, it was perfectly normal? After I wrote it I re-read the posts and figured you were asking j4on directly. My spergtastic nature required removal of my post. I'm excited to leave 2.x behind. Thankfully for most of our apps installs on 2.x are down to about 35%. Yay for progress! I always feel bad for the Android folks (I mostly do iOS dev at work) when I get to bump up my minimum SDK for cool feature X (ARC and weak references hallelujah) and they have to just deal with it. Like you said though backwards compatibility isn't terribly difficult to maintain in Android, still a bit of a pain though.
|
# ¿ Apr 24, 2013 00:40 |
|
Somewhat cringe inducing but otherwise informative video from Google on the in-app purchase API: https://www.youtube.com/watch?v=rnsgAvFUEUo
|
# ¿ Apr 25, 2013 23:18 |
|
Karthe posted:What component does the Play app use to allow for left-to-right swiping between categories? I want to implement something similar but I'm not sure what I should be looking for. I thought it was a spinner, but I found out that's just Android's drop-down list. Is it an alternate form of the action bar's navigation tabs? You're looking for the ViewPager, which is in the support library: http://developer.android.com/reference/android/support/v4/view/ViewPager.html The new Play store uses its own implementations of some things the ViewPager gives by default, you can read about it here: https://plus.google.com/108761828584265913206/posts/Cwk7joBV3AC Looks like someone made an implementation based on the above post already that should be pretty much drop in: https://github.com/astuetz/PagerSlidingTabStrip
|
# ¿ Apr 29, 2013 16:49 |
|
Doctor w-rw-rw- posted:I think ViewPagerIndicator also has the same control. If so then use that library, as the same guy behind ActionBarSherlock is behind VPI, so you're assured some level of quality. It's similar, but somewhat different from the new implementation in the Play Store. Just to add a link VPI is available here: https://github.com/JakeWharton/Android-ViewPagerIndicator (If you're interested in the differences they're explained pretty well in Kirill's post: https://plus.google.com/108761828584265913206/posts/Cwk7joBV3AC)
|
# ¿ Apr 30, 2013 01:05 |
|
it is posted:I have a spinner with this XML You probably want to reference the Spinner you created in xml, something like: code:
http://developer.android.com/guide/topics/ui/controls/spinner.html
|
# ¿ Apr 30, 2013 02:22 |
|
|
# ¿ Apr 28, 2024 08:56 |
|
Doctor w-rw-rw- posted:Holy loving poo poo. Yeah Volley looks extremely useful. I'm excited to use it! Now I don't know what to look at first, OkHttp/Picasso (http://corner.squareup.com/2013/05/picasso-one-dot-oh.html) or Volley? Probably Volley.
|
# ¿ May 16, 2013 00:42 |