Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Glimm
Jul 27, 2005

Time is only gonna pass you by

What is Android?
Google’s quirky, beautiful, mobile operating system.

Initial Setup
  1. Development Environments
    1. Android Studio - the blessed future of Android tooling. Gradle support baked in directly. Great live previews of views. Based on IntelliJ IDEA 13 CE
    2. Eclipse - Android is moving towards the Gradle build system and better tooling which is why it is listed first, but you could muck around with Eclipse (though Gradle support for it is nowhere near as far along as Android studio), and you can get Eclipse this way:
  2. Interested in creating low level native applications? Check out the Android NDK.

Learning Android
  1. Forums member jkyuusai posts: Things I found useful while beginning Android
  2. Android Design - Know and use Android design patterns. Don’t be a schmuck.
  3. Android Training - Generally Android applications are created with Java and heavily rely on the Android framework which can take some time to learn. Google’s Android Training sessions are meant to catch seasoned Java developers up to speed and familiarize them with Android to get developers up to speed. Don’t miss any course listed under Basic Training, and really most of the Advanced Courses should be pretty well understood.
  4. Vogella’s Android Development Tutorial - Lars Vogel is pretty well known in the Eclipse community and his series of Android tutorials have helped me from time to time
  5. Professional Android 4 - The author of this, Reto Meier, is an Android DevRel for Google and this is a fairly comprehensive book on the Android APIs and essential developer knowledge.
  6. If you’re interested in developing for Google TV there is Google TV specific development information available. Keep in mind TV is very different:

    Doctor w-rw-rw- posted:

    And while you might think you can just port your tablet layout to GoogleTV, remember that TVs don't have touchscreens, have up to 10% overscan on the edges, are navigated with the D-pad and not usually the mouse, and the option button is practically taboo.


Distributing Applications
  1. Google Play - this is Android's major store. Allows staged rollouts and alpha/beta testing directly through the Google Play app on your end users device.
  2. Amazon AppStore for Android - distribute here to make sure your apps can be installed on Kindle Fires and the like.
  3. F-Droid - FOSS app store
  4. Or just email the apk directly to your users, no provisioning necessary.


Android development/design blogs
  • Styling Android - Posts fairly frequently on different Android related topics, such as using vector drawables to help scale between different UIs and using Android components like the LruCache to create memory caches. (G+)
  • Cyrl Mottier’s Android Development Blog - I mostly linked this because of the series of posts on ‘The making of Prixing’, this implementation of the sliding app menu (popularized by apps like Dolphin HD & Facebook) is pretty great.
  • Holo Everywhere - this blog highlights/reviews Android apps and critiques their design. A good place for inspiration or direction on user expectation. (G+)
  • AndroidDev Weekly - posts a couple of articles on Android development each week which vary in quality.
  • CommonsWare Blog - wrote a book The Busy Coder's Guide to Android Development, posts an answer within 3s to any Android related question on StackOverflow.
  • My Life With Android :-) - writes a few articles a month on various Android topics.
  • Codependent - Chet Haase's blog. Chet is an Android framework engineer who is mostly responsible for making the animation libraries on Android no longer suck.
  • Chris Bane's blog - Chris is an engineer on the Android developer relations team. He created the popular Android-PullToRefresh library.

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
  • Web Requests
  • Analytics
    • ACRA - a library enabling Android Application to automatically post their crash reports to a GoogleDoc form. Much more detailed information than Google Play gives you upon crashes.
    • Crashlytics - very nice crash reporting tool. Great iOS support too.
    • Google Analytics - kind of nice having app tracking sitting right next to web tracking tools
    • Flurry - Pretty popular. My shop has moved away from this tool but it's still widely used I think.
  • Design Tools - creating assets for every major bucket is a pain, these can help
  • Android Support Library - this is basically part of the SDK, but I mention it here because nearly every app will want to use something from the support library.
    • Gone are the days of ActionBarSherlock, if you're one of the unfortunate souls still supporting 2.x pull in the appcompat ActionBar from here.
    • Need a NavigationDrawer? The support library provides an idiomatic NavigationDrawer with instructions.
  • Otto - A publish subscribe mechanism for Android. If you use this and IntelliJ I highly recommend the Otto IntelliJ plugin which will show you which parts of your application are publishing and subscribing to particular events.
  • Dagger - Dependency injection with Guice/RoboJuice on Android is tremendously slow. Square made Dagger to be much faster (a lot of things are done at compile time, made possible by the explicitness of the object graph). Check out Jesse Wilson's InfoQ presentation on Dagger.
  • Android SDK Reference Search - a Chrome extension to add ‘ad’ command to the Chrome omnibox which allows for searching Android Documentation, with autocomplete functionality.
  • Timber - Jake Wharton's excellent logging library.
  • Nine Old Androids - Backports the Android 3.0 animation framework to Android 1.0.
  • Drag-Sort-ListView - Pretty neat looking implementation of draggable ListView items
  • Crouton - A library based on Cyril Mottier's Activity tied notifications. Basically a better looking, more sensible, Toasts replacement.
  • Android Priority Jobqueue - Async tasks are kind of a pain. Jobs are a bit nicer to deal with, especially when used in conjunction with a pub/sub mechanism (Otto/Green Robot), or maybe RxJava
  • DevDrawer - excellent app for organizing your projects on your Android device. Create a widget that lists all of your applications (based on filtering package names), quickly delete apps or clear their data, have them available on your homescreen between installs without having to drag them from the app drawer.

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
  • Awful for Android - developed by Ferg/Geekner/other contributors (thread here), a good example of an ActionBarSherlock application with tablet functionality.
  • Markers - Pretty great drawing application with some neat customizations.

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

Adbot
ADBOT LOVES YOU

duck monster
Dec 15, 2004

Does android support in-app purchases. Got a client who wants to know.

Suran37
Feb 28, 2009

duck monster posted:

Does android support in-app purchases. Got a client who wants to know.

http://developer.android.com/guide/market/billing/billing_overview.html

Anyways, is there anyway to still use OpenFeint? I know it was bought out, but I can't find any tutorials or anything for GREE, and there seemed to be tons of info on OpenFeint.

Suran37 fucked around with this message at 09:00 on Jun 18, 2012

Doctor w-rw-rw-
Jun 24, 2008
Late-night braindump (tell me if I should clean this up):

duck monster posted:

Does android support in-app purchases. Got a client who wants to know.

http://developer.android.com/guide/market/billing/billing_overview.html

Yes, and last time I looked into it (1+ years ago) it sucked. Maybe it's gotten better. Google is phasing out alternative forms of payment. Obviously, it's harder for Google to have a handle on it than Apple, but they plan - eventually - to pull the same my-way-or-the-highway poo poo that Apple did for mobile payments. So even if there is an alternative, you should factor that in - unless you're planning on releasing on an alternate platform, in which case YMMV.


Glimm posted:

What is Android?
Google’s quirky, beautiful, mobile operating system.
:barf:

Glimm posted:

Learning Android

Newbie Android developers should consider that while there *may* a time and a place to violate the design patterns, if you don't know when, then that is not the time. Most of the time you're probably just going to end up with a crappy app. And while you might think you can just port your tablet layout to GoogleTV, remember that TVs don't have touchscreens, have up to 10% overscan on the edges, are navigated with the D-pad and not usually the mouse, and the option button is practically taboo.

Glimm posted:

Useful(?) Tools, Libraries, and links
  • ActionBarSherlockYou no longer have an excuse to forego the ActionBar. Well, unless the lovely iOS port your boss is paying you to make can’t really utilize its features. In which case, I’m sorry.
  • RoboGuice - Google Guice is a dependency injection library for Java projects and RoboGuice is the Android specific version of the library. Give it a try, if for nothing else but to use the improved logging functionality it offers. Can greatly reduce boilerplate code.
  • AQuery - Android-Query (AQuery) is a light-weight library for doing assynchronous tasks and manipulating UI elements in Android. Can greatly reduce boilerplate code. The AQuery blog has helpful usage examples as well.
  • Android Annotations - (recommended to me but haven’t used) adds interesting annotations like @UiThread to ensure a method is run on the UI thread.
  • greenDAO - (recommended to me but haven’t used) maps POJOs to SQLite database tables.
  • Android Asset Studio - generate icons and images at proper sizes given a source image, even has a 9 patch generator.
ActionBarSherlock is a must. Like, any new project that doesn't want to be irrelevant must use it. This goes hand-in-hand with following the Android design patterns. It follows that the Support Library is a must. USE IT. Fragments are a good idea, but you don't necessarily need to start with them right off the bat. They're basically activities minus the baggage of having to be the only thing on the screen. Bags of self-contained logic and UI, that's what they are.

WARNING On some older devices, with enough injection bindings, RoboGuice may contribute noticeably to the startup time of the app. Use something like RoboSplashActivity if you're targeting old devices, more bindings will mean a longer startup, but old ones are seriously slow. Also note that constructor injection makes a lot less sense on Android, and that immutability and anything referencing a context needs to be handled with care.

I would not use AndroidAnnotations in production code simply because it's too far off the beaten path that I anticipate debugging could be a bitch. IIRC, it uses annotations to transform the source. While it might seem nifty, I don't want to have to pretty fundamentally alter my code if there's a bug I can't locate or figure out how to fix. That said, I'm not actually aware of any reason the implementation is not sufficient.

I haven't seen greenDAO before, but be careful when displaying large lists of objects backed by POJOs it's going to put some memory stress on your app, and it could hiccup. If you have a large set of data that maps well to SQLite, consider using a SimpleCursorAdapter. it will often be smoother than an ArrayAdapter will be.

Miscellaneous:
  • Remember that activities are destroyed and recreated on orientation change.
  • An asynctask can run, then finish independently of an activity. It'll probably crash the task with an exception if it references the activity. However, this usually doesn't affect the activity anyway.
  • RoboAsyncTask/SafeAsyncTask are useful because AsyncTasks have awful exception handling and silently drop Exceptions. onSuccess, onException (forgot if that was the right method name but you get the idea), and onFinally make handling errors so much easier.
  • Use ACRA If you want a non-poo poo way of finding out about your errors. Android market is frustratingly bad about detailed information.

Doctor w-rw-rw- fucked around with this message at 09:37 on Jun 18, 2012

Suran37
Feb 28, 2009
I am trying to figure out ActionBarSherlock for an app I am working on. I am currently trying to add a button that opens a new activity, I tried following the Action Provider sample, but I seem to be stuck on the intent. The sample opens the phone settings menu, and I have been struggling to try and modify it to open my activity. My code so far can be seen here: http://pastebin.com/cc4pN6qF

If I leave it how it is, it displays the icon and opens the phone settings perfectly. If I try to move the intent after the constructor and change the intent to Intent(mContext, AddPilot.class) it doesn't show the icon, but it says "Add Pilot" which is the title I assigned to it, however it doesn't open the new activity it displays the toast "Handling in onOptionsItemSelected avoided." Maybe I am following the wrong sample, I don't know. Any help would be appreciated.

Safe and Secure!
Jun 14, 2008

OFFICIAL SA THREAD RUINER
SPRING 2013
Thank you for making this thread. I didn't realize there were so many resources for learning to develop for Android nowadays.

zeekner
Jul 14, 2007

Suran37 posted:

I am trying to figure out ActionBarSherlock for an app I am working on. I am currently trying to add a button that opens a new activity, I tried following the Action Provider sample, but I seem to be stuck on the intent. The sample opens the phone settings menu, and I have been struggling to try and modify it to open my activity. My code so far can be seen here: http://pastebin.com/cc4pN6qF

If I leave it how it is, it displays the icon and opens the phone settings perfectly. If I try to move the intent after the constructor and change the intent to Intent(mContext, AddPilot.class) it doesn't show the icon, but it says "Add Pilot" which is the title I assigned to it, however it doesn't open the new activity it displays the toast "Handling in onOptionsItemSelected avoided." Maybe I am following the wrong sample, I don't know. Any help would be appreciated.

Any reason you're using an ActionProvider over a simple menu item? Are you familiar with how ICS actionbar or pre-ICS menus work?

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.

zeekner fucked around with this message at 04:52 on Jun 22, 2012

Glimm
Jul 27, 2005

Time is only gonna pass you by

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? :swoon:

Doctor w-rw-rw-
Jun 24, 2008

Glimm posted:

Done.

Also, did anyone notice the developer.android.com redesign? :swoon:

Yes. It's horrible. Less readable.

Glimm
Jul 27, 2005

Time is only gonna pass you by

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.

Suran37
Feb 28, 2009

Geekner posted:

Any reason you're using an ActionProvider over a simple menu item? Are you familiar with how ICS actionbar or pre-ICS menus work?

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.

I'm not familiar with actionbars at all. I was looking through the ABS Demos app and ActionProvider seemed to be relevant, but I have figured out a solution now based on the Android ActionBar examples.

Suran37 fucked around with this message at 04:47 on Jun 23, 2012

Doctor w-rw-rw-
Jun 24, 2008

Glimm posted:

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.

It's easier on the eyes but I feel like that's part of the problem. I could scroll very quickly through the old documentation and know roughly where in the document I was just by the shape of the text. Now not only that's harder, but the links to other pages don't pop and so it's easy to miss. I hate how muted it looks now.

And it's poo poo like this:

that means that I can no longer code by dividing my screen in half, because why would I ever want to see the diagram and the code at the same time?

They also got rid of the toggle that made the page stop complaining about your API version so that when you googled for something related to, say, fragments and it brought up the normal fragments, you could click it off and find what you were looking for anyways, because the API is the same as in the support library, then click it back on so you can browse the docs as usual for the rest of the API.

Sinestro
Oct 31, 2010

The perfect day needs the perfect set of wheels.
It is 2012, get another monitor. You can get a real, 1440p IPS 27" for literally 300 bucks. There is no excuse.

Doctor w-rw-rw-
Jun 24, 2008

Sinestro posted:

It is 2012, get another monitor. You can get a real, 1440p IPS 27" for literally 300 bucks. There is no excuse.

I suffered from neck problems when I had two monitors. Totally went away when I switched to one huge monitor instead. (though that screenshot is from my laptop not my work computer)

Glimm
Jul 27, 2005

Time is only gonna pass you by

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)

Lutha Mahtin
Oct 10, 2010

Your brokebrain sin is absolved...go and shitpost no more!

What is the least-ugly way of writing SQL for Android in Eclipse? Right now I'm putting each statement one-per-line in my strings.xml file like this:

XML code:
<string name="MicroJobsDatabase_onCreate">"
CREATE TABLE jobs (_id INTEGER PRIMARY KEY AUTOINCREMENT, employer_id INTEGER, title TEXT, [...]);
CREATE TABLE employers( _id INTEGER, employer_name TEXT, contact_name TEXT, website TEXT, [...]);
[...]
"</string>
and chopping the lines into an array of Java strings. However I'm pretty sure I will screw something up, either through mis-escaping something or misreading what I've written due to not using whitespace like I always have with SQL.

(code stolen from here)

Doctor w-rw-rw-
Jun 24, 2008

Lutha Mahtin posted:

What is the least-ugly way of writing SQL for Android in Eclipse? Right now I'm putting each statement one-per-line in my strings.xml file like this:

XML code:
<string name="MicroJobsDatabase_onCreate">"
CREATE TABLE jobs (_id INTEGER PRIMARY KEY AUTOINCREMENT, employer_id INTEGER, title TEXT, [...]);
CREATE TABLE employers( _id INTEGER, employer_name TEXT, contact_name TEXT, website TEXT, [...]);
[...]
"</string>
and chopping the lines into an array of Java strings. However I'm pretty sure I will screw something up, either through mis-escaping something or misreading what I've written due to not using whitespace like I always have with SQL.

(code stolen from here)

You could put your .sql files in the assets directory and write a class to load your SQL from that. I implemented migrations that way.

TheReverend
Jun 21, 2005

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 can't find any nice easy-to-use class within the Android SDK.
Is there anything I'm missing?

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

New stuff for devs:

On-device app encyrption.
Smart app updates that only send out the part of the apps that have changed.
Google Cloud Messaging which is C2DM on steroids.

Glimm
Jul 27, 2005

Time is only gonna pass you by

Thermopyle posted:

New stuff for devs:

On-device app encyrption.
Smart app updates that only send out the part of the apps that have changed.
Google Cloud Messaging which is C2DM on steroids.

To elaborate on this here is Google's dev page on 4.1:
http://developer.android.com/about/versions/jelly-bean.html#google

Glimm
Jul 27, 2005

Time is only gonna pass you by

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 can't find any nice easy-to-use class within the Android SDK.
Is there anything I'm missing?

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/

Lutha Mahtin
Oct 10, 2010

Your brokebrain sin is absolved...go and shitpost no more!

Doctor w-rw-rw- posted:

You could put your .sql files in the assets directory and write a class to load your SQL from that.

Does this involve writing like, half of a SQL lexical scanner? In the book I'm reading, the methods used to pass statements to SQLite (e.g. execSQL(String sql)) accept one statement at a time, so since I want to write .sql files with nice indentation and whitespace it seems I'd need to have a more complex tokenization process than my current scheme of String.split("\n").

Doctor w-rw-rw-
Jun 24, 2008

Lutha Mahtin posted:

Does this involve writing like, half of a SQL lexical scanner? In the book I'm reading, the methods used to pass statements to SQLite (e.g. execSQL(String sql)) accept one statement at a time, so since I want to write .sql files with nice indentation and whitespace it seems I'd need to have a more complex tokenization process than my current scheme of String.split("\n").

Quite possibly. I don't remember how exactly I solved this problem since it was about a year ago or so and it never made it into production. Having a sqlite database file rather than a list of queries to create the database might have been how I did it, but that doesn't lend itself to migrations, though I've always found it easier to just dump the database since I use it as a cache and people are jerks and wait for several versions before updating for no reason.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Anyone used or have any comments about Crittercism? Looks like something along the lines of BugSense, but with more features.

What has my interest piqued is that the feature list mention an in-app support forum for your apps...which sounds like a cool idea.

NoDamage
Dec 2, 2000
Just curious, how are you guys dealing with this? 90% of devices are still below 3.0.

Are we stuck using ActionBarSherlock and the compatibility library? It seems like I might as well pretend that Honeycomb/Ice Cream Sandwich/Jelly Bean don't even exist, if I'm pretty much forced to code against 2.3 anyway.

Only registered members can see post attachments!

zeekner
Jul 14, 2007

NoDamage posted:

Just curious, how are you guys dealing with this? 90% of devices are still below 3.0.

Are we stuck using ActionBarSherlock and the compatibility library? It seems like I might as well pretend that Honeycomb/Ice Cream Sandwich/Jelly Bean don't even exist, if I'm pretty much forced to code against 2.3 anyway.


For me it's pretty much ActionbarSherlock, maintaining 2-3 UI styles isn't worth it. Check out Awful Betamax (link in op) to get an idea.

Glimm
Jul 27, 2005

Time is only gonna pass you by

NoDamage posted:

Just curious, how are you guys dealing with this? 90% of devices are still below 3.0.

Are we stuck using ActionBarSherlock and the compatibility library? It seems like I might as well pretend that Honeycomb/Ice Cream Sandwich/Jelly Bean don't even exist, if I'm pretty much forced to code against 2.3 anyway.



ActionBarSherlock all the way. It is pretty seamless for the most part.

ADINSX
Sep 9, 2003

Wanna run with my crew huh? Rule cyberspace and crunch numbers like I do?

We have an application that has a bunch of different activities reachable by a main menu. Pretty standard stuff.

Our customer likes that for phones, but for the tablet version they want all of these unrelated activities jammed into the same page (yes I know this is dumb, its not up to me). I've been reading about fragments but this doesn't seem to be the typical use case for them... What I want is something like a group of iframes on a webpage, with all of the activities in a single group running together with no knowledge of each other. Whats the best way to accomplish this?

NoDamage
Dec 2, 2000

Glimm posted:

ActionBarSherlock all the way. It is pretty seamless for the most part.
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.

NoDamage
Dec 2, 2000

ADINSX posted:

We have an application that has a bunch of different activities reachable by a main menu. Pretty standard stuff.

Our customer likes that for phones, but for the tablet version they want all of these unrelated activities jammed into the same page (yes I know this is dumb, its not up to me). I've been reading about fragments but this doesn't seem to be the typical use case for them... What I want is something like a group of iframes on a webpage, with all of the activities in a single group running together with no knowledge of each other. Whats the best way to accomplish this?
Er, this sounds like exactly the use case for fragments.

Glimm
Jul 27, 2005

Time is only gonna pass you by

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.

zeekner
Jul 14, 2007

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.

ActionbarSherlock is great, but there is a big gotcha you need to watch out for:
Whenever you have the Sherlock version of a class available, use it instead of the official android one. This'll bite you if your not careful. For example, you have to use Sherlock's Window.FLAG_XXX instead of the official android one, because their "Activity.addFlag()" function takes a long instead of an int (they couldn't override the method).

Don't let that stop you, just watch your import list. Seriously, ActionbarSherlock makes a unified, compatible UI so much easier.

Suran37
Feb 28, 2009
Hey, I have a question about certificates. I am trying to parse some xml, but the site I read it from is HTTPS, so when I try to run it on the emulator I get an error saying, "Not trusted server certificate." Do I need to get their certificate and install it on users devices or what?

UraniumAnchor
May 21, 2006

Not a walrus.
Edit: Never mind, I think I fixed it.

UraniumAnchor fucked around with this message at 20:55 on Jun 29, 2012

Scaevolus
Apr 16, 2007

Thermopyle posted:

Smart app updates that only send out the part of the apps that have changed.
They say it makes the average update 1/3 as large, but hopefully it's better for big apps where most updates are minor code changes.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Scaevolus posted:

They say it makes the average update 1/3 as large, but hopefully it's better for big apps where most updates are minor code changes.

Yeah, that seems likely.

duck monster
Dec 15, 2004

NoDamage posted:

Just curious, how are you guys dealing with this? 90% of devices are still below 3.0.

Are we stuck using ActionBarSherlock and the compatibility library? It seems like I might as well pretend that Honeycomb/Ice Cream Sandwich/Jelly Bean don't even exist, if I'm pretty much forced to code against 2.3 anyway.



This, by the way, is why we have so much trouble at work with android compared to IOS. For whatever reason (I suspect its the demographics of IOS buyers, as well as apples tighter control over the software delivery chain) the IOS adoption rate of new versions is extremely high. Something like 80%+ are now on IOS5 or the high end of IOS 4. That makes adopting apples funkier new technologies much easier to adopt in terms of making sure our software has an audience.

But god drat it, we still have people complaining to us about not being able to use poo poo on there Android 1.x devices
:negative:
And its a shame. Most of the poo poo that made me hate android back when v2 was still a barely new thing has been resolved, more or less, except this one loving problem.

Still it could be worse. Symbian :suicide:

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

duck monster posted:

This, by the way, is why we have so much trouble at work with android compared to IOS. For whatever reason (I suspect its the demographics of IOS buyers, as well as apples tighter control over the software delivery chain)

Most people just can't upgrade their devices to newer versions. The manufactuers haven't released updates for their devices. Like...Google just came out with Android 4.1. The great majority of devices on the market today will never even have the option of getting that update.

Suran37
Feb 28, 2009

Thermopyle posted:

Most people just can't upgrade their devices to newer versions. The manufactuers haven't released updates for their devices. Like...Google just came out with Android 4.1. The great majority of devices on the market today will never even have the option of getting that update.

Also, I wonder if people who can upgrade even know. I just found out my Droid RAZR has an update from 2.3.6 to 4.0.4 that has been available for over a week know and my phone never notified me. The only reason I knew was because I just randomly checked for an update, which is something I know most people probably never do.

Adbot
ADBOT LOVES YOU

Safe and Secure!
Jun 14, 2008

OFFICIAL SA THREAD RUINER
SPRING 2013
One of my friends is not a technical person at all and had no idea that her phone had the option to update OTA from Froyo to Gingerbread. She didn't even know what Froyo or Gingerbread were. It's an ATT Samsung Infuse, some weird Galaxy S II thing with half the CPU cores and half the RAM, so it's not incredibly ancient.

I would surprise if more than the small amount of people willing to stick to Nexus phones for software actually knew anything about their phone OSes other than "it's an Android".

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply