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
Peanut and the Gang
Aug 24, 2009

by exmarx

Ranma posted:

<string name="email_app_links"><![CDATA[<a href=\"poop://poop\">Android</a>]]></string>

I haven't tested this but it should work
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:

Adbot
ADBOT LOVES YOU

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.

melon cat
Jan 21, 2010

Nap Ghost
I'm doing Team Treehouse's Android development course. Part of it involves creating an AVD (I realize that Genymotion's the better way to do so, but I'm just doing this to follow the course). I'm getting this error message:

"Error: Target location is not inside the SDK. Failed to set image path properties in the AVD folder."

http://i.imgur.com/UfeQbfg.jpg

Any suggested fix for this? I tried searching for a fix online, but everything I've tries so far hasn't fixed it.

EDIT: Found a fix. It turns out that the Android SDK package they included with the course isn't the best one to use. Went straight to the official Android Development site for the package.

melon cat fucked around with this message at 21:19 on Sep 8, 2013

Jarl
Nov 8, 2007

So what if I'm not for the ever offended?
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.

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.

melon cat
Jan 21, 2010

Nap Ghost
I'm trying to pick up on Android development, and quite frankly I'm finding Team Treehouse's to be quite bad. They really don't explain the core concepts that are necessary to do their exercises ("Here's a weird pizza anology to illustrate method and classes. Now, Initialize the getAnswerButton variable using the findViewById()!")

I realize that the OP includes a few learning resources, but have any others cropped up ever since the OP's last update?

\/ Thanks!

melon cat fucked around with this message at 02:33 on Sep 11, 2013

IAmKale
Jun 7, 2007

やらないか

Fun Shoe

melon cat posted:

I'm trying to pick up on Android development, and quite frankly I'm finding Team Treehouse's to be quite bad. They really don't explain the core concepts that are necessary to do their exercises ("Here's a weird pizza anology to illustrate method and classes. Now, Initialize the getAnswerButton variable using the findViewById()!")

I realize that the OP includes a few learning resources, but have any others cropped up ever since the OP's last update?
I'd highly recommend poring over the official Android developer documentation. It has incredibly detailed write-ups and includes lots of sample code you can use to see the nuts and bolts of how everything works. I personally think it does a great job of getting you into the "Android" mindset with respect to app design and functionality expectations as well. I got my start reading through them, and I think, for a free resource, nothing beats knowledge straight from the horse's mouth.

Jarl
Nov 8, 2007

So what if I'm not for the ever offended?

Glimm posted:

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.

Okay, I thought the default icons were dictated, and hence they would fit best with whatever look Android x.y would have. Disappointing, but it does explain why it is recommended to make a local copy, which seemed odd, since it otherwise would have been way more generic to leverage the default icons.

EDIT:
When I in Android Studio look in External Libraries -> Android 4.2.2 -> android.jar I find both ic_menu_delete and ic_menu_archive, but when trying to use them as icons in a menu by android:drawable/ic_menu_delete and android:drawable/ic_menu_archive, then for the archive one the compiler claims that it is not public. What gives?

Also ic_menu_delete in 4.2.2 is (found using google pictures search) , but the standard apps that comes with 4.0.4 version of android for tablets as well as the Android OS itself uses something that look like this (there are two lines instead of three on the barrel). Why do they not adhere to their own default icons? To me this seems like the old default icons. If I make an app that use android:drawable/ic_menu_delete, I get the new icons, even though the OS as mentioned use the other one.

Jarl fucked around with this message at 09:52 on Sep 10, 2013

TheReverend
Jun 21, 2005

So I'm a .NET ~*Compact Framework*~ developer.

I've been that for the past 7 years oh so (holy poo poo :( ).

Anyways as terrible as WindowsMobile is to use, developing for it was so super easy!
I'm having the exact opposite problem with android. Maybe it's just because it's new to me. Maybe I'm a dumb baby.

Anyways, I request advice on the following things:

1)SQL Lite. I've got the basics down. But one thing I'm going to need to do is read the databases from a desktop application over USB. Any ideas how to do that?

2)UI. The eclipse "designer" sucks poo poo(at least for me. I just want something simple). I really miss Visual Studio when it comes to "form designing". I hate the XML editor. What can I do? Suck it up? Is there a good third party form editor?

3)ListView. I can add stuff to my list view from a database. What I would like to do is also keep track of the unique ID in the database for each item in the listview. But I don't want to display it? Any tips?

4)Why is this so terrible? Is this terrible for everyone else? It took me forever to get a "google maps api for android" sample app running. Not to code it, but to setup eclipse. How does everyone feel about android development in general? I LOVE using android devices but so far I'm not that keen on developing for them.

zeekner
Jul 14, 2007

TheReverend posted:

So I'm a .NET ~*Compact Framework*~ developer.

I've been that for the past 7 years oh so (holy poo poo :( ).

Anyways as terrible as WindowsMobile is to use, developing for it was so super easy!
I'm having the exact opposite problem with android. Maybe it's just because it's new to me. Maybe I'm a dumb baby.

Anyways, I request advice on the following things:

1)SQL Lite. I've got the basics down. But one thing I'm going to need to do is read the databases from a desktop application over USB. Any ideas how to do that?

2)UI. The eclipse "designer" sucks poo poo(at least for me. I just want something simple). I really miss Visual Studio when it comes to "form designing". I hate the XML editor. What can I do? Suck it up? Is there a good third party form editor?

3)ListView. I can add stuff to my list view from a database. What I would like to do is also keep track of the unique ID in the database for each item in the listview. But I don't want to display it? Any tips?

4)Why is this so terrible? Is this terrible for everyone else? It took me forever to get a "google maps api for android" sample app running. Not to code it, but to setup eclipse. How does everyone feel about android development in general? I LOVE using android devices but so far I'm not that keen on developing for them.

0) Ditch eclipse for the official android studio. Don't worry about the preview label, it's based on the very stable and complete IntelliJ IDE and is way better than eclipse.

1) I don't know of an easy way or officially supported way to do that via USB within android. You may need to fall back to a network based approach.

2) Android studio is better for this, but it's not perfect.

3) Are you using a CursorAdapter? It manages the ID internally. If you are just manually pulling data from your cursor and putting it straight into a separate adapter it's probably worth switching to a CursorAdapter.

4) You'll get the hang of it. There are some things that are well designed, and others that are plain dumb. Coming from a Microsoft platform is probably jarring since they are a bit more consistent and tend to integrate everything together more smoothly.

bonds0097
Oct 23, 2010

I would cry but I don't think I can spare the moisture.
Pillbug

melon cat posted:

I'm trying to pick up on Android development, and quite frankly I'm finding Team Treehouse's to be quite bad. They really don't explain the core concepts that are necessary to do their exercises ("Here's a weird pizza anology to illustrate method and classes. Now, Initialize the getAnswerButton variable using the findViewById()!")

I realize that the OP includes a few learning resources, but have any others cropped up ever since the OP's last update?

\/ Thanks!

I thought the Big Nerd Ranch Android book was very good. It's available on Safari Books Online if you subscribe to that.

Jarl
Nov 8, 2007

So what if I'm not for the ever offended?
On developer.android.com have I been able to find information about how an icon should look if it is enabled or disabled, but I have not been able to find information about what if it is selected; i.e. I want to toggle a feature and I want the icon to look the official way a toggled icon should look, whatever that may be.

Sereri
Sep 30, 2008

awwwrigami

Jarl posted:

On developer.android.com have I been able to find information about how an icon should look if it is enabled or disabled, but I have not been able to find information about what if it is selected; i.e. I want to toggle a feature and I want the icon to look the official way a toggled icon should look, whatever that may be.

This isn't really a thing in holo. You could either make the icon different for either state, make it obvious which option is activate (maybe a toast or something, changing the option text) or roll your own non-holo option which uses an activated state with a special color, like the holo blue that signals it's active.

Example would be in gmail where it toggles between a read and unread button.

TheReverend
Jun 21, 2005


Thanks for the tips. I'll definitely check all that out. I'm not sure how well the network thing will do because this will be for "remote farm area" stuff but who knows theres got to be Starbucks around somewhere, right?

Jarl
Nov 8, 2007

So what if I'm not for the ever offended?

Sereri posted:

This isn't really a thing in holo. You could either make the icon different for either state, make it obvious which option is activate (maybe a toast or something, changing the option text) or roll your own non-holo option which uses an activated state with a special color, like the holo blue that signals it's active.

Example would be in gmail where it toggles between a read and unread button.

Thanks for the information. I don't get what you mean with "maybe a toast" though.

Sereri
Sep 30, 2008

awwwrigami

Jarl posted:

Thanks for the information. I don't get what you mean with "maybe a toast" though.

Like a toast that goes "X enabled" or something. That's probably the worst option though.

IAmKale
Jun 7, 2007

やらないか

Fun Shoe

Jarl posted:

Thanks for the information. I don't get what you mean with "maybe a toast" though.
If you're still not sure what Sereri's talking about, "toasts" are little pop-up messages. They're the alert() of Android.

TheReverend
Jun 21, 2005

Karthe posted:

"toasts" are little pop-up messages.

:lsd: Oh man I get it now... I feel really stupid. I've been using them for a while and always thought to myself "toast is kind of a random word to use".

zeekner
Jul 14, 2007

TheReverend posted:

Thanks for the tips. I'll definitely check all that out. I'm not sure how well the network thing will do because this will be for "remote farm area" stuff but who knows theres got to be Starbucks around somewhere, right?

I didn't want to suggest it, but there are ways to smuggle data via ADB. You can use ADB port forwarding to establish a socket, then pass data over it. That route requires ADB on the PC side (you can bundle the executable with your PC app) and the phone must have USB debugging enabled. Enabling debugging on recent versions of android is hard for normal users, it's a really annoying thing where you have to tap a specific area 7 times just to show the debug options then you have to approve the RSA fingerprint once you connect.

It's hardly ideal, and it's always possible for Google to change something and break it, but it is a way to do local USB communications on a PC.

TheReverend
Jun 21, 2005

That's a good suggestion but a bit of a technical stretch for our intended users (which is country grandpas).

404notfound
Mar 5, 2006

stop staring at me

TheReverend posted:

:lsd: Oh man I get it now... I feel really stupid. I've been using them for a while and always thought to myself "toast is kind of a random word to use".

Because in some implementations, it slides up from the corner of the screen like a piece of toast coming out of the toaster. :v:

TheReverend
Jun 21, 2005

I have one more question (and I don't mean to hog this thread, honest!):


-I have a popupwindow and I want to click outside of the window to close it. I found out that setting the popupWindow drawable to an empty drawable will make this happen. I also learned that setting it to null will kill all other UI activity except for the popupWindow.
What I don't understand is...why does this happen?

zeekner
Jul 14, 2007

TheReverend posted:

I have one more question (and I don't mean to hog this thread, honest!):


-I have a popupwindow and I want to click outside of the window to close it. I found out that setting the popupWindow drawable to an empty drawable will make this happen. I also learned that setting it to null will kill all other UI activity except for the popupWindow.
What I don't understand is...why does this happen?

PopupWindow is a little odd, I had to mess around a while to get the functionality you would expect.

You don't need to do anything with the background, you can set the background to whatever you want to use.

For auto-dismiss, you can add:
code:
popup.setOutsideTouchable(true);
This will allow the popup to respond to the touch event happening outside its borders, and the default action for that is to self-dismiss.

You can also add a dismiss listener so you will get a callback when that happens:
code:
popup.setOnDismissListener(new PopupWindow.OnDismissListener() {
                @Override
                public void onDismiss() {
                    //cleanup stuff
                }
            });
e: I'm not sure why setting the background to null would intercept all touch events, maybe that causes it to silently extend the popup background to cover the whole screen? PopupWindow is one of the poorly designed elements that date back to really early Android, and it can be pretty finicky at times.

zeekner fucked around with this message at 05:47 on Sep 12, 2013

Jarl
Nov 8, 2007

So what if I'm not for the ever offended?
I might not be looking the right place, but it seems to me that developer.android.com lacks good information about the xml side of things. Especially because there is not a one-to-one correspondence with how you access the same elements in java code (the same problem WPF's XAML has). Yes, the corresponding class can be found and there the xml attributes, but it would be nice with something dedicated to the xml side of things, describing tag hierarchy and so on.

Hughlander
May 11, 2005

Anyone ever make a main apk expansion for an NDK based app? Looking for suggestions on things like keeping all the .SOs in the .apk, how you handle hiding the download/install time of the expansion etc...

TheReverend
Jun 21, 2005

I'm haveing an issue with an Exception
code:
 
E/AndroidRuntime(3565): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
So the way my Activity works is that It takes information from a BT sensor and when it receives data it populates a popupWindow where you can edit the data and save it.

If you click on the graphical representation of the data, it populates the popupwindow with the saved data.

I can save new data and view old data just fine until I rotate the tablet. Then I can view data all I like, but new data causes this exception.

For the life of me I can't figure out what's going on.

Harik
Sep 9, 2001

From the hard streets of Moscow
First dog to touch the stars


Plaster Town Cop

Salvador Dalvik posted:

0) Ditch eclipse for the official android studio. Don't worry about the preview label, it's based on the very stable and complete IntelliJ IDE and is way better than eclipse.

This is not good advice, the preview label is absolutely accurate. Since people have been talking up the new AS, I just spent 12 hours trying to get android studio to simply build an app that's already working under eclipse. It's insanely ridiculously slow, burns 100% CPU on two cores at all times, throws even more obscure build errors than Eclipse and has a "project"/"module" concept so awful it makes Visual Studio 'solutions' look brilliant.

It doesn't even work out of the box, so be prepared to diagnose a huge clusterfuck of halfassed integration. First off, they ship a known-broken version that requires you to update before you do anything. Oh, but they "helpfully" start up in a "wizard" mode that makes you make a project with a known-broken version before opening up the main screen that lets you use help->update. Because it makes perfect sense to not bother updating your download link, you see.

Secondly, if you don't have a working gradle install it provides one - but it builds vs android-18 which the SDK doesn't come with, so you have to drop into the SDK manager and add 18 before you can even get started. Add about a dozen other little gotchas that I had to deal with just to get it going.

Finally, once you do all that you're left with a fairly basic IDE that loses a lot of the polish and features of Eclipse. There's no tool for AndroidManifest, for instance, so it's back to hand-editing XML. All the build property options are gone aside from paths, so you have to hand-edit the build.gradle file. You may have to reload the project for build.gradle changes to take effect, I don't know. I could never get a sense of if it was detecting file changes or not, and there's no file-save to know that your changes hit the disk: what you see is not necessarily what the build-process sees. The layout renderer is basically unchanged from the eclipse plugin (unsurprising) except it looks much more primitive - it's lost the preview images of the widgets that they had in Eclipse. As for actually doing work in it:

code:
  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND    
13192 harik     20   0 2461096 347252  35604 S 173.3  4.2   0:54.35 java       
Typing feels like a terminal session cross-country over a 300 baud modem. Lots of lag and stutters when "idle". Keyboard shortcuts don't register 50-75% of the time, so you have to get off the keyboard, grab the mouse, go to the menus and select the action you want there. It's a real frustration when you're just trying to get work done; I don't have an 8GB quad-core 3ghz machine for text input to be slow!

The project I was attempting to import isn't even complex. It's basically written for 4.1, except using HoloEverywhere prefixes so it runs on older devices. HoloEverywhere themselves have dumped Eclipse support and only target AS preview, so it's surprising that their build doesn't work either.

So yes, it's very much a pre-alpha preview and it's not a very promising preview at that. The only thing it's got going for it is it's entirely self-contained, so it doesn't poo poo up your working Eclipse SDK. I'll give it another shot in a few more releases and try it for all-fresh code and no back-compatibility library to see if it works better then.

For doing development in Eclipse: the last working version of the SDK is 21.1. All SDK development effort in 22.x has gone to the AS preview, so there's a lot of bitrot in the Eclipse integration. I think it still works out-of-the-box for HelloWorld.app but as you add code you suddenly and randomly end up with things like error messages pointing to the middle of comments and NullPointerExceptions thrown in the build process.

http://qdevarena.blogspot.com/2010/05/download-android-sdk-standalone-for.html has instructions on how to grab older versions, just change the build in the URLs from 18.x to 21.1.

Harik fucked around with this message at 00:40 on Sep 20, 2013

Tunga
May 7, 2004

Grimey Drawer
We use IntelliJ at work and I've poked around with Android Studio at home. It definitely has a few issues right now, especially around getting it set up, and doesn't have a lot of benefits over just using IntelliJ (which I prefer to Eclipse but that's personal preference). It seems fairly promising though, if Google ever bother to put some serious effort into it, which they probably won't.

zeekner
Jul 14, 2007

Harik posted:

This is not good advice, the preview label is absolutely accurate. Since people have been talking up the new AS, I just spent 12 hours trying to get android studio to simply build an app that's already working under eclipse. It's insanely ridiculously slow, burns 100% CPU on two cores at all times, throws even more obscure build errors than Eclipse and has a "project"/"module" concept so awful it makes Visual Studio 'solutions' look brilliant.

It doesn't even work out of the box, so be prepared to diagnose a huge clusterfuck of halfassed integration. First off, they ship a known-broken version that requires you to update before you do anything. Oh, but they "helpfully" start up in a "wizard" mode that makes you make a project with a known-broken version before opening up the main screen that lets you use help->update. Because it makes perfect sense to not bother updating your download link, you see.

Secondly, if you don't have a working gradle install it provides one - but it builds vs android-18 which the SDK doesn't come with, so you have to drop into the SDK manager and add 18 before you can even get started. Add about a dozen other little gotchas that I had to deal with just to get it going.

Finally, once you do all that you're left with a fairly basic IDE that loses a lot of the polish and features of Eclipse. There's no tool for AndroidManifest, for instance, so it's back to hand-editing XML. All the build property options are gone aside from paths, so you have to hand-edit the build.gradle file. You may have to reload the project for build.gradle changes to take effect, I don't know. I could never get a sense of if it was detecting file changes or not, and there's no file-save to know that your changes hit the disk: what you see is not necessarily what the build-process sees. The layout renderer is basically unchanged from the eclipse plugin (unsurprising) except it looks much more primitive - it's lost the preview images of the widgets that they had in Eclipse. As for actually doing work in it:

code:
  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND    
13192 harik     20   0 2461096 347252  35604 S 173.3  4.2   0:54.35 java       
Typing feels like a terminal session cross-country over a 300 baud modem. Lots of lag and stutters when "idle". Keyboard shortcuts don't register 50-75% of the time, so you have to get off the keyboard, grab the mouse, go to the menus and select the action you want there. It's a real frustration when you're just trying to get work done; I don't have an 8GB quad-core 3ghz machine for text input to be slow!

The project I was attempting to import isn't even complex. It's basically written for 4.1, except using HoloEverywhere prefixes so it runs on older devices. HoloEverywhere themselves have dumped Eclipse support and only target AS preview, so it's surprising that their build doesn't work either.

So yes, it's very much a pre-alpha preview and it's not a very promising preview at that. The only thing it's got going for it is it's entirely self-contained, so it doesn't poo poo up your working Eclipse SDK. I'll give it another shot in a few more releases and try it for all-fresh code and no back-compatibility library to see if it works better then.

For doing development in Eclipse: the last working version of the SDK is 21.1. All SDK development effort in 22.x has gone to the AS preview, so there's a lot of bitrot in the Eclipse integration. I think it still works out-of-the-box for HelloWorld.app but as you add code you suddenly and randomly end up with things like error messages pointing to the middle of comments and NullPointerExceptions thrown in the build process.

http://qdevarena.blogspot.com/2010/05/download-android-sdk-standalone-for.html has instructions on how to grab older versions, just change the build in the URLs from 18.x to 21.1.

I haven't used the gradle integration yet, because I figured gradle was still too new to be stable (and that seems to be the case). IntelliJ/AS has very good legacy Android build support, where it'll manage the project setup and handle the build process just fine (even with proguard). I transitioned in from IntelliJ, and it was so seamless I was able to keep the existing project config files. The project/module/dependency system is far better than 'just throw everything in the same workspace'. AS is built upon an functional, modern IDE. No more having to manually refresh folder contents, or manually triggering a workspace clean because Eclipse can't track state worth a poo poo. It even tracks GIT/SVN/ect without a broken third party plugin.

Losing the AndroidManifest tool wasn't a big deal, the contextual XML autocomplete makes up for it. That tool would often completely screw up the formatting of that XML file and broke way too easily. Not to mention all the cases where the layout tool would desync from the XML file and you would end up in a world of pain until you restarted Eclipse.

I'm not sure what is so special about your setup that you managed to run into every sharp corner, but I have had the exact opposite experience. I found eclipse to be extremely slow, painful, and out of date. Eclipse was my primary IDE for many years I am so glad to be rid of it.

It also sounds like Google shouldn't be pushing gradle in its current state, I'm happy enough with Ant/jenkins for now.

Doctor w-rw-rw-
Jun 24, 2008
Facebook's been using and improving Buck: http://facebook.github.io/buck/setup/quickstart.html

Which can generate IntelliJ projects and is apparently working out really well so far. Just putting that out there.

Harik
Sep 9, 2001

From the hard streets of Moscow
First dog to touch the stars


Plaster Town Cop

Salvador Dalvik posted:

I haven't used the gradle integration yet, because I figured gradle was still too new to be stable (and that seems to be the case). IntelliJ/AS has very good legacy Android build support, where it'll manage the project setup and handle the build process just fine (even with proguard). I transitioned in from IntelliJ, and it was so seamless I was able to keep the existing project config files. The project/module/dependency system is far better than 'just throw everything in the same workspace'. AS is built upon an functional, modern IDE. No more having to manually refresh folder contents, or manually triggering a workspace clean because Eclipse can't track state worth a poo poo. It even tracks GIT/SVN/ect without a broken third party plugin.

Losing the AndroidManifest tool wasn't a big deal, the contextual XML autocomplete makes up for it. That tool would often completely screw up the formatting of that XML file and broke way too easily. Not to mention all the cases where the layout tool would desync from the XML file and you would end up in a world of pain until you restarted Eclipse.

I'm not sure what is so special about your setup that you managed to run into every sharp corner, but I have had the exact opposite experience. I found eclipse to be extremely slow, painful, and out of date. Eclipse was my primary IDE for many years I am so glad to be rid of it.

It also sounds like Google shouldn't be pushing gradle in its current state, I'm happy enough with Ant/jenkins for now.

That's like the bizarro-world of my experience - IntelliJ demanded to restart because files had changed and it couldn't cope with that, it wouldn't find code that I copied into the src directory until I refreshed, it was attempting to force all my code into a single repository due to it's one root restriction, and it would hork repeatedly and not redraw the window for a few seconds at a time. Whereas aside from google deliberately breaking the ADT plugin, Eclipse was responsive, built the project cleanly (on the java side, anyway - the DX conversion was frequently problematic) and didn't care if I was moving files around underneath it. The main problem with building in Eclipse is how bad the ADT plugin is. It silently fails on malformed XML so it never generates R.java and then you have 10,000 errors in your project with the root cause unreported. Or it fails because you have a .png and .svg with the same name. Or really any of a dozen other reasons - all entirely at the feet of Google. Rather fix their own mess, they just squirreled off in a completely different direction, changing both the development environment and the build process at one time.

I think if I'd been using IntelliJ before this and was used to it's quirks and knew my way around it as well as I know Eclipse I'd have a much more positive reaction. I agree with you on one part though: there must be something wrong with my install. Anything this slow and glitchy isn't shippable, and I can't imagine every developer that uses IntelliJ has Stockholm syndrome. I have no idea how "untar, run in the java VM" failed, but I guess it did.

As for gradle, unfortunately I'm arc-welded to it if I try to use AS, since the HoloEverywhere version that works with the new build paths in the 22.x SDK only supports gradle. Looking at the diffs on HE, part of the problem was they restructured their code at the same time they changed development environments, so I was fighting a double uphill battle. Fortunately I was able to roll everything back to June and build everything in Eclipse.

TheReverend
Jun 21, 2005

RE SQL Lite:

I'm storing coordinates like 83.76832892 into a REAL column in my SQLite DB.
It's coming out rounded a few places like 83.768.

What is going on? REAL is for floating point numbers right?

Tunga
May 7, 2004

Grimey Drawer
If the values need to be stored precisely then you should use TEXT because REAL does not guarantee accuracy for decimal numbers (due to binary vs. decimal). Unless you're doing mathematical operations on these numbers within the database, that's probably the best option.

Having said that, it shouldn't be rounding to three decimals. How are you retrieving the values?

TheReverend
Jun 21, 2005

Oh okay. That sounds kinda silly though!

It's more like 5 decimal places, but still!

Edit: never-mind I'm dumb and realized I was reading wrong from the cursor.

TheReverend fucked around with this message at 21:36 on Sep 20, 2013

A COMPUTER GUY
Aug 23, 2007

I can't spare this man - he fights.

TheReverend posted:

I'm haveing an issue with an Exception
code:
 
E/AndroidRuntime(3565): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
So the way my Activity works is that It takes information from a BT sensor and when it receives data it populates a popupWindow where you can edit the data and save it.

If you click on the graphical representation of the data, it populates the popupwindow with the saved data.

I can save new data and view old data just fine until I rotate the tablet. Then I can view data all I like, but new data causes this exception.

For the life of me I can't figure out what's going on.

Since nobody is answering you - my bet is that when you rotate your device, the activity is destroyed and relocated, and whatever populates the popupWindow is retaining the Context to the previous instance of the activity. Set your activity to handle rotation by adding android:configChanges="orientation" to its activity declaration in the Manifest and by implementing OnConfigurationChanged() in your activity. Or just have your activity pass along a new Context when it's recreated.

TheReverend
Jun 21, 2005

Ulysses S. Grant posted:

Since nobody is answering you - my bet is that when you rotate your device, the activity is destroyed and relocated, and whatever populates the popupWindow is retaining the Context to the previous instance of the activity. Set your activity to handle rotation by adding android:configChanges="orientation" to its activity declaration in the Manifest and by implementing OnConfigurationChanged() in your activity. Or just have your activity pass along a new Context when it's recreated.

Thanks for the reply.
I should have edited but I fond a solution.
I'd like to share with you though so maybe I can understand better.

So in the background thread I had the popupwindow run with "runonuithread(APredefinedRunnable)".

I got it to work by using a Handler and then using Handler.SendEmptyMessage(0);


I had a bunch of code in OnResume() to specifically handle recreating all threads etc so I'm not sure why Runnable=bad but Handler=good.

Harik
Sep 9, 2001

From the hard streets of Moscow
First dog to touch the stars


Plaster Town Cop
code:
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGBUS (0x7) at pc=0x00007ff3aa430a82, pid=31678, tid=140683549202176
#
# JRE version: 7.0_21-b11
# Java VM: Java HotSpot(TM) 64-Bit Server VM (23.21-b01 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libzip.so+0x4a82]  newEntry+0x62
Come on, Oracle, this is ridiculous. It's also android related, since the build process races itself on modifying some jar file while reading it that causes the explosion. Seriously, kill me now.

code:
Stack: [0x00007ff370e9d000,0x00007ff370f9e000],  sp=0x00007ff370f9b400,  free space=1017k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libzip.so+0x4a82]  newEntry+0x62
C  [libzip.so+0x51c8]  ZIP_GetEntry+0xd8
C  [libzip.so+0x4041]  Java_java_util_zip_ZipFile_getEntry+0xf1
J  java.util.zip.ZipFile.getEntry(J[BZ)J
j  java.util.zip.ZipFile.getInputStream(Ljava/util/zip/ZipEntry;)Ljava/io/InputStream;+88
j  com.android.dx.cf.direct.ClassPathOpener.processArchive(Ljava/io/File;)Z+118
j  com.android.dx.cf.direct.ClassPathOpener.processOne(Ljava/io/File;Z)Z+48
j  com.android.dx.cf.direct.ClassPathOpener.process()Z+15
j  com.android.dx.command.dexer.Main.processOne(Ljava/lang/String;)Z+18
j  com.android.dx.command.dexer.Main.processAllFiles()Z+100
j  com.android.dx.command.dexer.Main.run(Lcom/android/dx/command/dexer/Main$Arguments;)I+84
Good job Google!

Is there any way to get arguments out of a java crashdump?

Edit: Ahh, found it. Googling for the top frame gets a ton of errors related to Oracle's hideously bad libzip.so, googling for the com.android.dx line finds the android specific problem, which is "you can't export with auto-build turned on because it races and crashes".

Simple fix, uncheck auto-build, build all, export. Works like a charm.

Harik fucked around with this message at 17:26 on Sep 26, 2013

kitten smoothie
Dec 29, 2001

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?

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.

Adbot
ADBOT LOVES YOU

kitten smoothie
Dec 29, 2001

Glimm posted:

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.

Not a dumb question, in fact it was the correct answer. Thanks.

I'm all caught up with Android Studio updates, so I guess they haven't fixed this. This is my first time using this, and even in spite of weirdness like that I'm still preferring it to Eclipse.

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