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

more like dICK posted:

So is Android in Intellij just going to be broken until December? http://youtrack.jetbrains.com/issue/IDEA-107311

Potentially, fortunately it looks like there is an easy work around, http://stackoverflow.com/a/16592563/104527:

Stack Overflow posted:


It appears that the latest update to the r22 SDK release moved aapt and the lib jar from the platform-tools to the build-tools directory. While we wait for JetBrains to release an update, here's a quick fix using a couple of symbolic links:

From your AndroidSDK/platform-tools directory, run the following:
code:
ln -s ../build-tools/17.0.0/aapt aapt
ln -s ../build-tools/17.0.0/lib lib

Adbot
ADBOT LOVES YOU

Glimm
Jul 27, 2005

Time is only gonna pass you by

jkyuusai posted:

E2: Last tidbit and then I'll shut up for awhile The "what the hell is Android going to do about new Java features since Oracle hates you" question came up during the keynote, the Android team fireside chat, and maybe the build panel. Every single time the question was soundly dodged. At the fireside chat they simply said "we're working on it" and refused to comment further.

Go based Android SDK in 2015?

:pray:

Glimm
Jul 27, 2005

Time is only gonna pass you by

Koush did a helpful breakdown of various image loading/network request APIs and posted his results to Google+ recently:
https://plus.google.com/103583939320326217147/posts/bfAFC5YZ3mq

Koush posted:

Picasso 12142/11892
UrlImage 7378/4525
Volley 8292/7520
Android-Universal-Image-Loader 14484/11243
AQuery 11341/9637 (this one seems to lock up the UI thread... don't use it)

He recommends Volley as the way to go in the future, I'm assuming because it handles lifecycle headaches a bit better than the other libraries tested.

Someone in the comments mentioned they might write a currying API around Volley to mimic Picasso (one of the prettiest APIs I've seen in awhile).

Glimm
Jul 27, 2005

Time is only gonna pass you by

Tamba posted:

I like that more, because reading Japanese with spaces feels kind of strange. But using different colors makes it seems like you're marking different things with each color, which could be confusing.

I totally agree. My Japanese is terrible but I think the colors are much better than spaces, especially on a mobile device.

Glimm
Jul 27, 2005

Time is only gonna pass you by

Soviet Canuckistan posted:

So here's a question: how do I hook the default share mechanism in Android? I know it's possible because apps like Andmade Share do it, but I can't figure out how to. Googling around just seems to recommend hooking android.intent.action.SEND, but that doesn't seem to do anything.

You're just trying to share stuff to other applications right? What exactly are you trying?

This is probably a good place to start: http://developer.android.com/training/sharing/shareaction.html

Glimm
Jul 27, 2005

Time is only gonna pass you by

Sereri posted:

If I'm understanding correctly have wants to replace the share dialog itself. Andmade proofs it's possible.

I guess you could always try to reverse engineer the app but this is going into :filez: territory.

Ooh, yeah I totally misunderstood.

Glimm
Jul 27, 2005

Time is only gonna pass you by

User0015 posted:

What cross-platform options are available that don't use Java?

I've played with Xamarin Studio (http://xamarin.com/studio) and it's actually pretty nice, but too pricey for me just messing around. You can make small apps and even sell them for free, so if you're into C# it's probably worth checking out. From what I understand it supports awesome features of C# like async/await that the WP8 SDK doesn't yet (at least, didn't when I checked in February) support.

I've done a bit more work with writing an Android application in Scala. I planned to do a write-up on it once I finished but I've gotten sidetracked. It's pretty straight forward to get going though if you're interested, ScalaIDE/AndroidProguardScala/standard Android SDK pretty much _just works_ and is a lot more fun than working in Java. This probably wont help at all going cross platform though.

Glimm
Jul 27, 2005

Time is only gonna pass you by

DreadCthulhu posted:

In Android, is there the ability to let users add custom repositories for one or two apps that will then become available to them and get updated automatically like Play store apps? I'm thinking along the lines of custom APT repositories.

No, but you can release beta apps to Android users that will install/update through the Play store.

https://support.google.com/googleplay/android-developer/answer/3131213?hl=en

Glimm
Jul 27, 2005

Time is only gonna pass you by

DreadCthulhu posted:

Interesting, thanks for the link. What's the closest I can get to actually being able to very rapidly iterate on an app in Android? There are a couple of not very ToS-friendly ways of achieving this with hundreds of users in iOS, and I was hoping there would be a more supported route in Android.

You can just send apks directly if you want. Host it yourself and tell your users when it is ready. Or do the beta thing which in my experience takes about an hour to get to testers.

Glimm
Jul 27, 2005

Time is only gonna pass you by

Salvador Dalvik posted:

There is literally no review process. Upload the apk and hit release and its available as soon as the servers catch up.

Of course, if you are creating a b2b app that you don't want to list on the market, you'll have to distribute directly. You can do this by hosting the apk yourself or going through a service like Hockeyapp. The end user will have to enable the "unknown sources" option, but android users are used to that kind of bullshit.

Actually the beta feature should work perfectly for this, right? Though it's not quite what it is intended for.

Within a company that uses Google Apps for Business it's possible to do releases through Play as well, though I haven't done that.

But yeah it's dead easy just to put the apk on a web site and let users download it, even send them a push notification when an update is ready. If you do the update through Google Play it's pretty quick as well. Much simpler than doing any of that with iOS for sure.

Glimm fucked around with this message at 05:06 on Jul 6, 2013

Glimm
Jul 27, 2005

Time is only gonna pass you by

Salvador Dalvik posted:

Yea, I wasn't sure about suggesting using beta for that, since it's a pretty new feature and I don't think Google's clarified if they're fine with using it like that.

Yeah, I haven't seen them say anything about it not being okay. I assume Google wouldn't be paying attention to things like that (it isn't like the developer is getting around some fee or anything).

Glimm
Jul 27, 2005

Time is only gonna pass you by

DreadCthulhu posted:

I'm honestly puzzled about why Apple hasn't removed their medieval review process yet if Android manages to get away without it. Are there been numerous cases of people getting malicious applications on their devices because of no human supervision? Doesn't sound like it from what I hear. Even then, I don't know how much a human reviewer can help against malicious logic.

Apple doesn't review just for malicious activity. They will also reject your application if it is crash prone, horribly violates the HIG (well, at least they used to - I haven't heard of rejections for this in quite awhile), or contains more adult themes than the developer claims. Sure, a lot of this could be gotten around by a savvy developer by depending on web services to change things up after a switch is flipped on the backend, but then Apple can pull the developers credentials.

Microsoft's review is for Windows 8 is even more thorough, and esoteric - I had an app get rejected because the charms bar had a button which opened the (required) privacy policy within the app, but the guidelines say the button should link to a web site containing the privacy policy. Kind of bizarre considering it is generally easier to randomly change a web site than a view within the app, but that's what Microsoft wanted.

Anyway I've certainly released apps on Android which (stupidly) crashed on various devices because I didn't test them and might have been a bit drunk (I'm a terrible developer), and Apple or Microsoft's semi-QA (they're not really QA) might have helped me there. There are definitely benefits and drawbacks to both systems. I prefer Android's but I don't see Apple (or Microsoft, or BlackBerry, or even Amazon.. well maybe Amazon) changing their ways.

Glimm
Jul 27, 2005

Time is only gonna pass you by

kitten smoothie posted:

There is a lot of crap on Google Play, stuff like this

Penis Size Calculator is my favorite app :colbert:

That's an interesting idea. It would be pretty cool if applications could be updated as quickly as they are currently, but only get the curated tag after passing a human review of some sort.

Glimm
Jul 27, 2005

Time is only gonna pass you by

Thermopyle posted:

I haven't done any Android development in like 18 months or something, but my grandma(!!) has been pestering me for a bible(!!!) app with easier/faster navigation than what she can find on the Play store.

I don't know the keywords to describe the library I'm looking for, so maybe someone can point me in the right direction.

I'm wanting a vertical scrollbar that pops up a tooltip to the left or right as you drag the bar up and down describing where the view will jump to when you let go of the bar. So, for example, if she's looking in the book of Matthew, when she starts scrolling on the right of the screen, it pops a tooltip-ish thing to the left of the scrollbar showing which book she will jump to when she lets go.

The scrollbar won't necessarily be connected to the text in the view as I might have each book or chapter or something be separate.

So, anyway, are there any libraries like that?

I might just have a slide out drawer on the right side with each book in a ListView, so she could swipe it open from the right and then select the book to jump to? Not quite the behavior you're asking for though.

Glimm
Jul 27, 2005

Time is only gonna pass you by

Android developer survey is up:
http://bit.ly/AndroidDevSurveyJuly2013

Feel free to fill it out and let Google know how you feel about the current state of Android development!

Glimm
Jul 27, 2005

Time is only gonna pass you by

kitten smoothie posted:

http://android-developers.blogspot.com/2013/07/android-43-and-updated-developer-tools.html


So is there any reason to use ABS anymore? I have an app I want to overhaul and I'm curious if I should bother with ABS or if this should nail what I need.

I think using the support library version is a better idea. No need to pull in a separate library project when the support library is already going to be used in your project.

Glimm
Jul 27, 2005

Time is only gonna pass you by

Tunga posted:

I wasn't, but now I am, and it doesn't seem to have made a difference.

I don't desperately need to target 4.3, it just seemed odd that I can't.

Do you have multiple SDKs installed? Android Studio comes with its own SDK I think, maybe your pointing at the wrong one?

Glimm
Jul 27, 2005

Time is only gonna pass you by

Angryhead posted:

Ugh, spent a while trying to figure out why my app was crashing on a friend's phone.
Apparently I was using methods that required an API that was newer than the minimum, which obviously gave no (explicit) warning from Eclipse. :suicide:

I assume you've updated to the latest SDK? Lint should catch things like that - which APIs were they? This is probably a bug that should be reported.

quote:

A question: is BitmapFactory.options.inSampleSize the best(only?) way to reduce memory size by images (that are being streamed from a web server) or is there a better way?

I don't know of a better way :(

Google's guide for handling this seems to rely on inSampleSize:

http://developer.android.com/training/displaying-bitmaps/load-bitmap.html

Glimm
Jul 27, 2005

Time is only gonna pass you by

Angryhead posted:

My android:minSdkVersion was set to "8" (and that was what the device was using) and I was using the View.setScaleX method, which was added in API level 11. App crashes with an java.lang.NoSuchMethodError.

No warning from either Eclipse or Lint. Found somebody on Stackoverflow with the same problem... back in December of 2012. No solution.

Thought it does seem like I'm missing the latest version of the SDK so I'll try updating and maybe this'll keep this from happening.

Yeah it's frustrating when the tools don't pick up issues like that :( I'll check later to see if Android Studio fixes it, I know they've been working at making sure API level issues are caught at the tooling level.

Glimm
Jul 27, 2005

Time is only gonna pass you by

rhag posted:

Or do I have to host a service myself that the application can use to download the content (and query for what's available)?

This would work, I think this is how SwiftKey etc. do language packs I think.

quote:

Am I missing something here? Is there a way to have Google Play host everything for me (the various packages) and for users to just buy them? I thought about just publishing different APKs (one the main service, and the rest as languages), but then how do I find out what's installed and what's not? The androidmarketapi library doesn't look very appealing since it's a 3rd party library that google can choose to break at any time.

This is another option. One can use the PackageManager API to determine what the user has installed. To share data between the packs and the main app you might want to use a shared user id. There might be better ways to handle that though - I've never done something like that.

Glimm
Jul 27, 2005

Time is only gonna pass you by

Looks like 4.4 KitKat has been announced, no SDK updates yet though:
http://www.android.com/kitkat/

Glimm
Jul 27, 2005

Time is only gonna pass you by

5TonsOfFlax posted:

Why would you do that, when you could actually use http and your real domain name? Then for public content with these urls, people with the app get the choice of opening it in the app and people without get a webpage you serve at that URL.

One reason to do that would be to have one link you can email out to all mobile users as iOS doesn't support redirecting http://foo to a particular application.

I'm not sure of a solution to this problem other than sending out two links, but I'd be interested in hearing what you come up with. Have you tried sending the email as html and having an explicit anchor tag?

Glimm fucked around with this message at 03:37 on Sep 5, 2013

Glimm
Jul 27, 2005

Time is only gonna pass you by

Another option is to have the email link to a web address which will redirect to your custom scheme. Will be a bit annoying since it means the browser has to open for a split second, but I don't really know another way to handle it.

Glimm
Jul 27, 2005

Time is only gonna pass you by

barbarianbob posted:

I actually tried forcing html email with <a href="poop://poop">Android</a> and android/iOS both removed the <a> tag as an invalid href before it went to the compose email screen :cry:

That's annoying. For what it is worth I believe the Gmail app (actually, the web app too) strips custom url schemes out even if the email is sent with html enabled (a friend of mine who has done something similar said they ran into that issue).

Most apps seem to go the redirect route.

Glimm
Jul 27, 2005

Time is only gonna pass you by

Jarl posted:

When using the Android default resources like ic_menu_add.png you can either copy it to your local res/drawable folder and reference it in your xml file like so "drawable/ic_menu_add", or you can choose not to copy it and instead reference it like so "@android:drawable/ic_menu_add". In the latter case will the app then use the default one on every android device (which depends on its version) or will it be the one in the SDK I compiled it with?

I hope @android:drawable/ic_menu_add means the default one, whatever that may be, on the different android devices it is installed, but since I hear you should make a copy of default resources you use for each version of android you support, I suspect this is not the case.

It will be the default one for that particular device. Major issues doing it that way are that you're trusting the manufacturer to make an icon that makes sense, or it could be a wrong size or just look terrible (Samsung). It's really recommended to copy the assets into your project so you know what you're getting.

This might have changed in 4.0+ since Google now requires manufacturers to ship all of holo with the OS, so maybe in 4.0+ you can expect all of the default platform icons to be available, but I'm not sure whether or not this is the case. It definitely isn't if you're supporting < 4.0.

Glimm
Jul 27, 2005

Time is only gonna pass you by

kitten smoothie posted:

Android Studio question: I've added the support library to my project's build.gradle file. I changed everything over and now things build and run on 2.3, so I'm building against the support library properly.

But Android Studio is giving me red text for all the classnames from the support library. Clearly I'm missing something here and there's some search path that IntelliJ wants?

Maybe a dumb question, did you close and re-launch Android Studio? Do a ./gradlew clean/assemble?

I think recent updates were supposed to make this unnecessary, but earlier versions required closing/re-launching Android Studio after adding a library.

Glimm
Jul 27, 2005

Time is only gonna pass you by

Anyone at Droidcon UK? PM me if you want to meet up! I'm the nerd wearing Glass.

Glimm
Jul 27, 2005

Time is only gonna pass you by

Karthe posted:

What would you do if you needed to give the user the ability to select, say, a particular method of input before entering something into an ActionBar SearchView? How would you design the UI? I'm in this situation right now and I haven't been able to come up with an elegant way of doing so that jives with the Holo design paradigm. The best I can think of is a checkable menu item, but I'm not sure how intuitive that would be.

Saw this and your post on G+. I gotta say I agree with Paul Burke's response:

Paul Burke posted:

Another approach would be to use a secondary Action Bar (Top Bar*) with a Spinner to expose category selection. You could make it so that it only shows when the SearchView is expanded. Default the Spinner selection to "all", or if one must be selected, default to the most common category (or the last one selected).

* http://developer.android.com/design/patterns/actionbar.html#considerations-split-action-bars&%2365279;

Glimm
Jul 27, 2005

Time is only gonna pass you by

Karthe posted:

I should have been more clear there, I was trying to be clever and keep things generic instead of specific to my use case. :downs:

What I really need to do is allow users to toggle on or off an in-app IME that I'm implementing. As a split ActionBar is way overkill for this scenario, I'm thinking about implementing a checkable menu item.

Oh right I see, I skimmed and missed the crucial difference there - sorry!

Glimm
Jul 27, 2005

Time is only gonna pass you by

Release notes for KitKat: http://developer.android.com/about/versions/kitkat.html

Android 4.4 KitKat Quick Overview posted:


Looks like there are now some ways to check if an app is running on a low end device and adjust things accordingly.

New NFC support, HCE (Host Card Emulation) for mimicking loyalty cards etc.

Storage access framework, rolls Dropbox, Box, Drive, etc. type services into one app, and an API to allow you to create apps that integrate into that app.

Built in step counting a la Moves

An actual SMS/MMS provider API.

New full screen mode, looks really cool - let your app take over the entire screen and users can do a swipe gesture to bring the system UI back.

Major additions to the animation framework.

Translucent system UI a la iOS7 (your app can go under the status bar/into the navigation bar)

:siren: CHROMIUM BASED WEBVIEW :siren:

Screen recording API

IR blasting Service/API

New tools for analyzing memory

Android Design in Action, new stuff in 4.4:
https://www.youtube.com/watch?v=6QHkv-bSlds

What's new in Android 4.4:
https://www.youtube.com/watch?v=sONcojECWXs

Playlist of a bunch of videos which go into specifics on many new APIs:
http://www.youtube.com/playlist?list=PLWz5rJ2EKKc-2quE-o0enpILZF3nBZg_K&feature=edit_ok

Check out the API diffs here:
http://developer.android.com/sdk/api_diff/19/changes.html


It feels like Christmas in here.

Glimm fucked around with this message at 19:48 on Oct 31, 2013

Glimm
Jul 27, 2005

Time is only gonna pass you by

Ulysses S. Grant posted:

Yay, WebView will be less unusably bad now :toot: I anxiously await 2015 when 4.4 makes up 40% of the market

Yeah, I'm wondering what the chances of this being backported are.

Waiting for 4.4 to drop in AOSP now, might shed some light on the feasibility of just that.

Glimm
Jul 27, 2005

Time is only gonna pass you by

Feral Integral posted:

Is it possible to create a toolbar type app in android that will stay on the screen even if another app is currently on screen? I want to create a permanent overlay that will stay up on the phone all the time, if possible.

Is it correct that android pretty much runs one app at a time, but uses intents to create interactions between programs? Does that mean that this kind of thing won't work?

This should work pretty well actually. A really popular example would be Facebook Messenger and its (in?)famous chatheads.

The accepted answer on this StackOverflow post goes into some detail on the how this is done:
http://stackoverflow.com/questions/15975988/what-apis-in-android-is-facebook-using-to-create-chat-heads

Glimm fucked around with this message at 00:47 on Nov 11, 2013

Glimm
Jul 27, 2005

Time is only gonna pass you by

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.

Glimm
Jul 27, 2005

Time is only gonna pass you by

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.

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?

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

Glimm
Jul 27, 2005

Time is only gonna pass you by

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.

Glimm
Jul 27, 2005

Time is only gonna pass you by

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

Glimm
Jul 27, 2005

Time is only gonna pass you by

NoDamage posted:

So onRetainNonConfigurationInstance() is deprecated, which I was using to store my AsyncTasks when my Activities are re-created during rotation. The suggested solution is to store it in Fragment with setRetainInstance(true), which seems a bit bizarre to me. Is this really the recommended method for saving AsyncTasks between configuration changes? Shove it in an interface-less Fragment?

Bleh, personally I recommend using something decoupled from the Activity lifecycle like Android Priority Jobqueue, or maybe RxJava (good post on RxJava here: http://mttkay.github.io/blog/2013/08/25/functional-reactive-programming-on-android-with-rxjava/) and just posting when operations are done via Otto or some other EventBus.

You could do that with an AsyncTask as well, just make sure the reference isn't tied to a particular Activity.

Glimm
Jul 27, 2005

Time is only gonna pass you by

Karthe posted:

What are my options if I want to implement a two-column ListView? A single-column ListView will waste too much space on larger devices like a Nexus 7, so I'd like to switch to a two-column mode on them. Something like this:

Phones
code:
[     List	]
|	A	|
|	B	|
|	C	|
|	D	|
[_______E_______]
Tablets
code:
[	       List		]
|	  A	||	  B	|
|	  C	||	  D	|
|	  E	|		|
[_______________________________]
Would it be as simple as loading a tablet layout that has a GridView instead of a ListView?

Yeah using the GridView in the tablet layout is the way to go, you should even be able to reuse your adapter!

Glimm
Jul 27, 2005

Time is only gonna pass you by

Karthe posted:

My god, that was easier than I could have imagined. After making the new layout the only thing I had to change in my code was to switch references of ListView to AbsListView instead. Thanks!

Yeah, this is definitely a strength of the Android framework :)

Adbot
ADBOT LOVES YOU

Glimm
Jul 27, 2005

Time is only gonna pass you by

http://lucasr.org/2014/05/12/custom-layouts-on-android/

Neat article on making custom views on Android. Particularly interesting to me was the custom async view bit near the end inspired by the async node framework the Facebook Paper team did.

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