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

jkyuusai
Jun 26, 2008

homegrown man milk

more like dICK posted:

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

Based on my reading, this break occurs because of some rearranging of the build tools location in the Android SDK (Xavier Ducrochet explained in the New Android Build System panel on Friday that this was meant to decouple build tool version from SDK version) and Intellij does not seem to be aware of this change. There's a hacky fix linked in the issue involving symlinks. Surprised they haven't patched it yet. Maybe all the devs were at I/O, heh.

I apologize for my short, out of context posts over the last few days. Been posting from my phone (still am) as I run across things but I realize I was falling for the "Get it out quick, details be damned!" lovely tech journalist mentality. I will strive to do better in the future.

Efb;
E: Also in that panel, Xavier gave his official proclamation that all new apps from here on out should be built with the new Gradle based tools. The official line currently is that Ant is going to be deprecated at some point so it's best to get off it as soon as you can.

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.

jkyuusai fucked around with this message at 18:58 on May 18, 2013

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:

Doctor w-rw-rw-
Jun 24, 2008

jkyuusai posted:

The "what the hell is Android going to do about new Java features since Oracle hates you" question came up during the keynote

Hey now, I didn't phrase it nearly so harshly at the keynote. >:/ though I agree, it was totally dodged. Sad. I hope that the questions get them to think harder about the problem, at least. That was my intention, anyway.

Sereri
Sep 30, 2008

awwwrigami

Doctor w-rw-rw- posted:

Hey now, I didn't phrase it nearly so harshly at the keynote. >:/ though I agree, it was totally dodged. Sad. I hope that the questions get them to think harder about the problem, at least. That was my intention, anyway.

Wait, that was you?

Doctor w-rw-rw-
Jun 24, 2008

Sereri posted:

Wait, that was you?

Yes.

zeekner
Jul 14, 2007


Haha, nice.

I'm going through the volley library now. It seems pretty cool, but the lack of examples is pretty annoying. It'll be nice to ditch the network service pattern I've been using.

Switching existing code to the new structure is pretty straightforward, I'll probably switch for my current project.

jkyuusai
Jun 26, 2008

homegrown man milk

Doctor w-rw-rw- posted:

Hey now, I didn't phrase it nearly so harshly at the keynote. >:/ though I agree, it was totally dodged. Sad. I hope that the questions get them to think harder about the problem, at least. That was my intention, anyway.

Out of the variations I heard, yours was certainly the politest. :)

Also, we should totally have done an I/O meet up!

QuarkJets
Sep 8, 2008

Perhaps Google will provide expanded Python support and give Oracle the finger

Doctor w-rw-rw-
Jun 24, 2008

QuarkJets posted:

Perhaps Google will provide expanded Python support and give Oracle the finger

I doubt it and would hate for this to happen. I think the right move forward is to build a LLVM-based solution. Not only could they build first-class support* for writing Android apps on top of their already-present NDK platform (which already supports LLVM iirc), but if they could tie PNaCl in somehow, they could make the ChromeOS story instantly very compelling by providing a porting path between Android and ChromeOS. Python and other languages could simply sit atop LLVM and do their thing.

* As in, not just a bridge

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).

IAmKale
Jun 7, 2007

やらないか

Fun Shoe
Is there a way to assign a margin to part of a spannable? I want to underline certain words in a Japanese sentence, but without any kind of white space around the underlined words, it's hard to tell when one word ends and another begins. I'm already using a spannable to apply underlines to the individual words, but the lack of a slight gap makes it hard to tell where one word ends and the other begins.

For example, this sentence...

quote:

部長の都合が悪くなってしまったので、飲み会の日程は仕切り直しだね。

...currently looks like this...

quote:

部長都合が悪くなってしまったので、飲み会日程仕切り直しだね。

but I want it to look something like this:

quote:

部長都合が悪く なって しまった ので、飲み会日程仕切り 直し だね。

IAmKale fucked around with this message at 20:28 on May 20, 2013

bonds0097
Oct 23, 2010

I would cry but I don't think I can spare the moisture.
Pillbug
Has anyone gotten Cydia Substrate to work on their device? I'm stuck with the 'Frowny Pants' toast on every device I try to install it.

Tamba
Apr 5, 2010

Karthe posted:

I want to underline certain words in a Japanese sentence, but without any kind of white space around the underlined words, it's hard to tell when one word ends and another begins.


https://mecab.googlecode.com/svn/trunk/mecab/doc/index.html
Mecab seems to have an option that just adds spaces around everything (-O, or search for "わかち書きをする" on that page)

I can't find an android version, and the java-version just seems to call the library via JNI, so might have to screw around with compiling that library for android if you need to use it on the device itself.

IAmKale
Jun 7, 2007

やらないか

Fun Shoe

Tamba posted:

https://mecab.googlecode.com/svn/trunk/mecab/doc/index.html
Mecab seems to have an option that just adds spaces around everything (-O, or search for "わかち書きをする" on that page)

I can't find an android version, and the java-version just seems to call the library via JNI, so might have to screw around with compiling that library for android if you need to use it on the device itself.
Oh man, this is way overkill for what I'm doing. I already have the individual vocabulary words in each sentence, I was more focused on a way to format them. I stumbled upon a great way to do so, though, so I think for now my issue has been resolved.

Edit: Now that I look at its usage, I can see this coming in handy for a future feature...

Tamba
Apr 5, 2010

Yeah, it's quite powerful, but if the task is "insert spaces around japanese words", you probably won't get around parsing the sentence to understand where the words are.

If you only need spaces around whatever you're trying to underline, then adding a space for every word you find shouldn't be too difficult?

IAmKale
Jun 7, 2007

やらないか

Fun Shoe

Tamba posted:

Yeah, it's quite powerful, but if the task is "insert spaces around japanese words", you probably won't get around parsing the sentence to understand where the words are.

If you only need spaces around whatever you're trying to underline, then adding a space for every word you find shouldn't be too difficult?
The way spannable strings work (my understanding, anyway), is that you tell it a range of characters to apply a style to and it goes and does its thing. There's no real way to insert characters at the same time.

Of course as I type this up I realize that I could find a particular word, insert spaces before and after it, and then apply the style via the spannable (with a +/- 1 offset to take into account the new spaces). That said, I'm now using alternating text colors instead and it's working out surprisingly well:

Tamba
Apr 5, 2010

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.

IAmKale
Jun 7, 2007

やらないか

Fun Shoe

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 hadn't perceived it as such but I see your point. I'm considering replacing the blue with a darker orange, maybe that'll help break things up without causing confusion as to why some words are blue and some are orange.

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.

IAmKale
Jun 7, 2007

やらないか

Fun Shoe
Is there a library that lets you easily load additional information to a listview once you've scrolled to the bottom? The idea being you query only X records at a time and query for X more on-demand. I could've swore I came across something like that but I can't remember where.

Edit: I just remembered it was CWAC's Endless library.

IAmKale fucked around with this message at 00:50 on May 22, 2013

zeekner
Jul 14, 2007

Karthe posted:

Is there a library that lets you easily load additional information to a listview once you've scrolled to the bottom? The idea being you query only X records at a time and query for X more on-demand. I could've swore I came across something like that but I can't remember where.

Edit: I just remembered it was CWAC's Endless library.

Hey, keep in mind this caveat from that page:

quote:

Note that this has been tested with ArrayAdapter extensively but may not work with other adapter types, particularly SimpleAdapter. It also will only work with a ListView or possibly other one-View-at-a-time AdapterView implementations.

It watches the getView function for a request on the last position, then starts a load.

An alternative would be to implement it yourself using the ListView OnScrollListener interface. You also have the flexibility of starting the load before you hit the end of the page, like starting the next load 5 items before the end.

e: Misread that, it'll work fine with ArrayAdapter, I was mistaking it with one of the issues with CursorAdapter.

zeekner fucked around with this message at 02:29 on May 22, 2013

IAmKale
Jun 7, 2007

やらないか

Fun Shoe
Edit: Nevermind

IAmKale fucked around with this message at 17:05 on May 23, 2013

Soviet Canuckistan
Oct 24, 2010
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.

Sereri
Sep 30, 2008

awwwrigami

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.

I think this is what you're looking for.

Soviet Canuckistan
Oct 24, 2010

Sereri posted:

I think this is what you're looking for.

That's not quite it; this lets me register a receiver for a share event (ie. adding it to the list of apps that appear when I share a link), but I'm looking for something one level earlier, where I choose which app is responsible for rendering the list of share targets, something like this:



I've looked at an existing app that someone made to capture as many intents as possible: https://github.com/intrications/intent-intercept/blob/master/IntentIntercept/AndroidManifest.xml, but even that doesn't capture what I need to override.

Soviet Canuckistan fucked around with this message at 21:16 on May 25, 2013

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

Sereri
Sep 30, 2008

awwwrigami

Glimm posted:

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

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.

Soviet Canuckistan
Oct 24, 2010
I figured it out - I was trying to do this via a <receiver>, whereas what I actually want is an <activity>; the actual <intent-filter> is android.intent.action.CHOOSER

Soviet Canuckistan fucked around with this message at 21:44 on May 25, 2013

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.

Hot Yellow KoolAid
Aug 17, 2012
I'm having an impossible time deducing the cause of a missing R.java file. I assume it disappeared during cleaning and Eclipse was unable to regenerate it during build. I am using the android ADT version of eclipse, and the minimum SDK of 11.

I suspect that the culprit is some kind of snafu in an XML file, but so far I have been unable to locate anything. The only errors in my entire project (that I can find) are limited to .Java files. I tried an experiment where I made another blank android application and coppied over its original "activity_main.xml" with the one from my project, and it broke it as well.

jkyuusai
Jun 26, 2008

homegrown man milk

Hot Yellow KoolAid posted:

I'm having an impossible time deducing the cause of a missing R.java file. I assume it disappeared during cleaning and Eclipse was unable to regenerate it during build. I am using the android ADT version of eclipse, and the minimum SDK of 11.

I suspect that the culprit is some kind of snafu in an XML file, but so far I have been unable to locate anything. The only errors in my entire project (that I can find) are limited to .Java files. I tried an experiment where I made another blank android application and coppied over its original "activity_main.xml" with the one from my project, and it broke it as well.

Have you updated the Android SDK or Eclipse recently by any chance?
If so, can you compile and run a sample project just to make sure all your global settings/SDK/tools are working correctly?

e: Yeah, so after updating MY Android SDK (including the new build tools chunk, plus an additional point revision to the SDK) and ADT, Eclipse claims to not see anything inside my android-sdk folder. Un/Re installed ADT to no avail. gently caress. Here I come IntelliJ!

e2: Annnnd after un/re-installing everything at least twice, closing my left eye and hopping around, it finally started seeing the SDK again. Ugh. Actually, it was all down to missing a trailing slash at the end of the directory, which doesn't get inserted if you set it via Windows Explorer. Jesus.

jkyuusai fucked around with this message at 18:17 on May 29, 2013

Cruseydr
May 18, 2010

I am not an atomic playboy.
Have any of you guys played around with AIDE? It was the easiest dev environment I've ever set up. I don't know how useful it would be for coding from my phone but it would probably be pretty great if you had a tablet and a BT keyboard.

User0015
Nov 24, 2007

Please don't talk about your sexuality unless it serves the ~narrative~!
Does anyone have experience using Mono for Android? I'm developing a (hopefully) cross-platform app, and as per the OP, I prefer Brainfuck/MUMPS/LOLCODE over Java. Actually, I'd prefer pretty much anything over Java, when it comes down to it.

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

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.

User0015
Nov 24, 2007

Please don't talk about your sexuality unless it serves the ~narrative~!
Cross platform might not even be realistic, so I'll gladly take anything that isn't Java. This would also be my first Android app, so making things easier is good with me.

IAmKale
Jun 7, 2007

やらないか

Fun Shoe
I've just hooked up a spinner in the Action Bar to a CursorAdapter (I'm cheating right now and am using a SimpleCursorAdapter, but will replace it with something custom). When an item in the spinner is selected, onNavigationItemSelected(int position, long id) is called. I know position is the tapped item's location in the list of items, but what is id? Is it whatever I returned as the _id column when I selected rows from the database?

Doctor w-rw-rw-
Jun 24, 2008

Karthe posted:

I've just hooked up a spinner in the Action Bar to a CursorAdapter (I'm cheating right now and am using a SimpleCursorAdapter, but will replace it with something custom). When an item in the spinner is selected, onNavigationItemSelected(int position, long id) is called. I know position is the tapped item's location in the list of items, but what is id? Is it whatever I returned as the _id column when I selected rows from the database?

it's the primary key by which the item is identified. I just had an auto_increment field, I think. I'm not sure anymore what it's used for, but the most common error I've had with non-unique IDs and UI controls is the wrong UI control responding because it got called earlier than the one you intended to respond, because they have identical IDs.

If you want something custom, try an ArrayAdapter subclass?

IAmKale
Jun 7, 2007

やらないか

Fun Shoe

Doctor w-rw-rw- posted:

it's the primary key by which the item is identified. I just had an auto_increment field, I think. I'm not sure anymore what it's used for, but the most common error I've had with non-unique IDs and UI controls is the wrong UI control responding because it got called earlier than the one you intended to respond, because they have identical IDs.
That's what I figured. In my case it's the row's _id column, which is perfect since I need to reference that when a particular spinner item is tapped.

As for the custom class, I'm using a CursorAdapter because the items I'm pulling are stored in a database. The user can create, update, and delete these items at will, so I can't work with static lists.

Adbot
ADBOT LOVES YOU

Doctor w-rw-rw-
Jun 24, 2008

Karthe posted:

That's what I figured. In my case it's the row's _id column, which is perfect since I need to reference that when a particular spinner item is tapped.

As for the custom class, I'm using a CursorAdapter because the items I'm pulling are stored in a database. The user can create, update, and delete these items at will, so I can't work with static lists.

ArrayAdapters don't have to be static lists. In fact, the only way I've ever used them is as a destination for API-backed calls. No overhead of reading/writing to a database, just memory. It also frees you from being inseparably married to your SQLite code for any kind of data manipulation.

That said, do what is simplest for what you need. POJO-backed lists is not necessarily that.

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