|
5436 posted:Which IDE do people generally prefer? Eclipse or IntelliJ IDEA? I loving love IntelliJ IDEA. 12.0 added some much needed features in terms of matching the development capabilities of Eclipse. But it's still missing a few components which make it a deal breaker for me (at my job at least). 1. IntelliJ 12.0 doesn't support certain Lint warnings. For example, if you call a method that was added in one of the newer API's, say API level 14, but you're minSDK is API level 8, your poo poo will just break on older devices, all without any warnings from IntelliJ. This is the main reason I still use Eclipse. 2. Less importantly, the XML formatting in IntelliJ is balls compared to Eclipse. This can be considered nitpicking but IntelliJ still doesn't support the "official" XML formatting and ordering style for attributes. I guess a lot of people could't give a poo poo but my job is big on maintaining a uniform formatting style. Being able to auto-format with Eclipse is a huge time saver in that regard. Fortunately for me, both of these features are coming in 12.1. I can't loving wait.
|
# ? Dec 29, 2012 01:38 |
|
|
# ? May 13, 2024 07:05 |
|
I tried compiling an older app (it targets API8) today via the command line as per a write-up on the app's Google Code page. Unfortunately, compilation errors out when the build process attempts to call the (I've come to find out) deprecated apkbuilder tool in android-sdk\tools. What are my options at this point? I'm new to Android dev, let alone command line compiling, so I'm not sure what I can do from here to get the app compiled so I can test it.
|
# ? Jan 3, 2013 20:23 |
|
I really hate how fragmented android devices are, especially amongst different companies even on the same version of android. I work on an android app for my company and we support android 2.1 and up. Most of our clients are small businesses and naturally want to buy the cheapest devices possible. This ends up with us finding bugs with crazy devices from companies I have never heard of, and it wastes a lot of my time that could be spent developing new features. Its not always unknown devices that cause me problems though, the Samsung Galaxy Note, a very well known and popular device. Gave us a massive headache because if you decided to put a value into one input box, and then quickly move to the next, it would decide to put the entered value in the second input instead. The only way we could find to fix this was to deliberately do a deferred schedule (i.e. a timer set to 0) just after the user enter input. On a side note, I have found on my own phone (Samsung Galaxy S II) on ICS, that when using the default mail application, you cant use a email address that contains an apostrophe. I'm pretty sure there probably an exploit there that could be abused with that, but for such an important application, on a well known device, on the most recent OS they provide, to have a simple and common escaping issue with apostrophe's is pretty embarrassing.
|
# ? Jan 6, 2013 02:15 |
|
Gavinvin posted:On a side note, I have found on my own phone (Samsung Galaxy S II) on ICS, that when using the default mail application, you cant use a email address that contains an apostrophe. I'm pretty sure there probably an exploit there that could be abused with that, but for such an important application, on a well known device, on the most recent OS they provide, to have a simple and common escaping issue with apostrophe's is pretty embarrassing. Today I learned apostrophes in email addresses are perfectly valid per RFC822. Hopefully some other day Samsung's developers will.
|
# ? Jan 6, 2013 04:21 |
|
Karthe posted:I tried compiling an older app (it targets API8) today via the command line as per a write-up on the app's Google Code page. Unfortunately, compilation errors out when the build process attempts to call the (I've come to find out) deprecated apkbuilder tool in android-sdk\tools. You can run "android update project" from the command line to update the ant build files for that project. You can also import the project into Eclipse and build it using the export function (right click project -> export -> android). Just make sure they didn't do any weird customization in the build.xml, it'll get replaced when you run the update.
|
# ? Jan 6, 2013 08:58 |
|
Geekner posted:You can run "android update project" from the command line to update the ant build files for that project. You can also import the project into Eclipse and build it using the export function (right click project -> export -> android). I forget the name of the file, but there is a specific XML filename that will add and override goals specified in build.xml, if memory recalls.
|
# ? Jan 6, 2013 09:14 |
|
edit; Fixed
Sab669 fucked around with this message at 21:59 on Jan 7, 2013 |
# ? Jan 7, 2013 21:57 |
|
So this week I'm starting some minor Droid development at work. I'm much more comfortable with C# and I'd really like to use Mono, but I wonder if it's really worth it? Having the company spend $400 for a license, trying to find C# examples of whatever I'm trying to do, etc. I took a few Java courses in college but I didn't like it very much, never did anything sophisticated at all, just made some really bare-bone command line examples of some OO design patterns that I don't remember what so ever. Is the support for Mono big enough, or should I just tough it up and learn Java?
|
# ? Jan 11, 2013 20:40 |
|
Sab669 posted:So this week I'm starting some minor Droid development at work. I'm much more comfortable with C# and I'd really like to use Mono, but I wonder if it's really worth it? Having the company spend $400 for a license, trying to find C# examples of whatever I'm trying to do, etc. How different do you perceive Java being from C#? I thought I was in the iPhone thread at first when I read this. C# is really similar to Java in syntax/style, with most of the divergence being around types and collections, as far as I remember.
|
# ? Jan 11, 2013 21:52 |
|
It's similar enough, I just dislike Eclipse & Netbeans. I think I'm so skeptical because I only had 1 semester with Java as opposed to an entire year's worth of .NET between C# & ASP.
|
# ? Jan 11, 2013 22:10 |
|
Is it possible to create a reference to an existing layout file in a specialized layout folder? For example, on the Nexus 7 I want to use a two-column layout when in landscape mode but a single-column phone layout in portrait mode. Can I create a reference to /res/layout/activity_layout.xml in /res/layout-sw600dp-port/ so that I only have to edit one activity_layout.xml file instead of maintaining a copy of it within /res/layout-sw600dp-port/?
|
# ? Jan 11, 2013 22:25 |
|
Karthe posted:Is it possible to create a reference to an existing layout file in a specialized layout folder? For example, on the Nexus 7 I want to use a two-column layout when in landscape mode but a single-column phone layout in portrait mode. Can I create a reference to /res/layout/activity_layout.xml in /res/layout-sw600dp-port/ so that I only have to edit one activity_layout.xml file instead of maintaining a copy of it within /res/layout-sw600dp-port/? How SlidingMenu does it is how it's done. (https://github.com/jfeinstein10/SlidingMenu/tree/master/example/res/layout-large-land) You aren't going to be able to deduplicate the layout code but if you really really need to there is an include tag, I believe. If you have such need for ui reuse consider fragments.
|
# ? Jan 12, 2013 01:07 |
|
I have an issue with parsing text from a webpage. I have a function which reads the contents of a webpage and parses it into a String. I have tested the function in a Java console application and it works fine, so if I doJava code:
On Android however, doing Java code:
I have no idea why this is not working and it's quite a roadblock. I really don't have any prior experience to developing on Android so it's very likely I'm missing something that ought to be obvious, but I haven't had any luck in figuring out or finding what is causing the application not to parse, or at least return or display the text from the page.
|
# ? Jan 30, 2013 15:23 |
|
Are you trying to download something in the main thread? That's not allowed anymore, but it should produce this exception: https://developer.android.com/reference/android/os/NetworkOnMainThreadException.html
|
# ? Jan 30, 2013 15:58 |
|
That might be it, but in that case this should give me the string I put in the catch block, right?Java code:
|
# ? Jan 30, 2013 17:17 |
|
You should use Log.e/Log.w/ect, it makes that sort of testing really easy and unambiguous. I doubt the TextView has anything to do with the problem, I would look at your DownloadText function. Android is a pretty good clone of Java 6, it's not perfect. Some libraries are missing or don't function the exact same way. Here's a simple GET to String example (using the Apache HTTP and IO libraries): code:
code:
|
# ? Jan 30, 2013 17:49 |
|
Maybe it's just because I'm trying to learn how to integrate Facebook into Android before becoming fluent in Android, but figuring out exactly HOW Facebook wants you to authenticate is extremely frustrating. This code (called from my MainActivity)code:
code:
|
# ? Feb 6, 2013 10:07 |
|
it is posted:Maybe it's just because I'm trying to learn how to integrate Facebook into Android before becoming fluent in Android, but figuring out exactly HOW Facebook wants you to authenticate is extremely frustrating. This code (called from my MainActivity) Called from where in your MainActivity?
|
# ? Feb 6, 2013 23:40 |
|
onCreate
|
# ? Feb 7, 2013 01:44 |
|
it is posted:onCreate So you're creating another activity before one has had the chance to finish onCreate/onStart/onResume. This might not be a problem but it wouldn't hurt to check your assumptions. I would try creating a test button or menu that triggers the same function on that screen, then see if the same error is produced.
|
# ? Feb 7, 2013 02:08 |
|
Thanks for getting back to me. I pulled it out into another method and created a button to execute it. Same error.
|
# ? Feb 7, 2013 05:42 |
|
Hmm, I can't really say for sure. Perhaps you're missing an argument somewhere. Whatever's happening, it's obviously expecting some data that ain't there.
|
# ? Feb 7, 2013 07:33 |
|
I'm looking to develop in .NET for android. Is Xamarin's Mono for Android the most feature complete solution? I'm really wanting to spend as little time as possible porting. I'm also doing a little XNA development on the side, and it would be nice to port this over to Android as well. I understand ExEn runs on top of Xamarin's platform, are there other options for porting XNA to android? Again, I really want to avoid having to write platform-specific code as much as possible and I'm willing to pay for that convenience.
|
# ? Feb 7, 2013 20:16 |
|
Above Our Own posted:I'm looking to develop in .NET for android. Is Xamarin's Mono for Android the most feature complete solution? I'm really wanting to spend as little time as possible porting. Above Our Own posted:I'm also doing a little XNA development on the side, and it would be nice to port this over to Android as well. I understand ExEn runs on top of Xamarin's platform, are there other options for porting XNA to android? Again, I really want to avoid having to write platform-specific code as much as possible and I'm willing to pay for that convenience.
|
# ? Feb 8, 2013 05:08 |
|
Doctor w-rw-rw- posted:it'll save you from writing Java code. This sounds worth it.
|
# ? Feb 8, 2013 14:39 |
|
I've had to rediscover this for the third time or so, so I'm documenting it here. How to attach Source/Javadocs in Eclipse for those pesky jars in your libs folder http://stackoverflow.com/questions/9873152/how-to-attach-javadoc-or-sources-to-jars-in-libs-folder Two things to watch out for: Stick the sources and docs in a sub folder in libs (like /libs/docs) so that they're ignored and not bundled with your apk. The properties file has the same exact name as the jar including the .jar extension with a .properties tagged on the end. (gson.jar = gson.jar.properties) How to attach Android Sources in Eclipse Up to API 14 - Install Android Sources plugin from this update site and restart Eclipse - http://adt-addons.googlecode.com/svn/trunk/source/com.android.ide.eclipse.source.update/ More info here - http://code.google.com/p/adt-addons/ Sources for 15 and up - They're included as part of the SDK package, but you still have to link them in Eclipse. Make sure you downloaded the source through the SDK manager, then F3 on something and hit the Attach Source button. Select External Folder, and browse to the sources folder, highlight the proper android-** folder inside and hit open. Boom! Maybe restart if it's misbehaving.
|
# ? Feb 17, 2013 02:52 |
|
If I wanted to program a simple roulette wheel or audio visualizer(just bars), do I have to use OpenGL, or is the canvas view suitable?
|
# ? Feb 18, 2013 01:02 |
|
Pseudo-God posted:If I wanted to program a simple roulette wheel or audio visualizer(just bars), do I have to use OpenGL, or is the canvas view suitable? If it's just 2d and you won't need to animate more than 20fps, you can try a SurfaceView. Look at the LunarLander example code to see how it's implemented (get it here). It'll let you run a secondary thread to animate the view. If you run into performance issues, you can try to swap that for a GLSurfaceView. If you need more performance than that you'll want to look into the NDK+opengl. You could run a custom View and just override onDraw, but that method has a lot of limitations (especially for animation). You'll have to call invalidate() every time you want to refresh. Those invalidate calls are processed on a queue, so it's can get choppy if you're trying to animate motion.
|
# ? Feb 18, 2013 03:12 |
|
So I've been teaching an intro CS class using Android for the past year, and this semester I'm finally upgrading all my assignments' target SDKs from 2.2 to 4.0, while retaining as much compatibility as possible with other devices. One change I'm making is having students to more with action bars. So, I've created a menu that has 5 items, set showAsAction="always" on all of them. Overrode onCreateOptionsMenu to inflate it in my activity. On a 4.0 emulator, they all show up like I'd expect, and clicking them does the right thing. On a 2.2-2.3 emulator or device, the menu is loaded and appears properly when I click the Menu button, but clicking the items doesn't do anything. The menu doesn't even get dismissed. I tossed some logging statements in there, and onOptionsItemSelected is never being called. Even setting an onMenuItemClicked handler on the items themselves doesn't change anything. Has anyone seen this kind of behavior before? I'm not sure what's going on, and Googling has been futile so far. EDIT: I'm NOT using ActionBarSherlock or anything like that. Everything is standard Android APIs, and I'd rather not bring in third party libraries. Flobbster fucked around with this message at 03:18 on Feb 21, 2013 |
# ? Feb 21, 2013 03:15 |
|
Are you really teaching an intro CS class with Android? That sounds horrible.
|
# ? Feb 21, 2013 04:55 |
|
it is posted:Are you really teaching an intro CS class with Android? That sounds horrible. I mean I've heard arguments against Java as a teaching language, but "not-quite-Java" with weird Android crap on top?
|
# ? Feb 21, 2013 05:27 |
|
By "intro" I don't mean a first-semester CS course. It's Intro to Software Design and Data Structures, so they already have plenty of experience with the basics of Java and can move on to more advanced stuff. We've developed some nice abstractions for them to use that get rid of a lot of the Android grunt-work, inspired by and stealing/improving ideas from frameworks like Roboguice, but I don't want to derail the thread talking about that -- unless people are interested It works better than it might sound at first, though.
|
# ? Feb 21, 2013 05:41 |
|
Is it just me or is Eclipse terrible for debugging? I get an error like this in LogCat and I'm left feeling as though there should be more information attached to it to help me identify which part of the cited line is faulty:code:
Java code:
And would getView().getContext() return null from within a fragment? I'm trying to pass along the app's context to the helper class from within a fragment that will display the results of a SQL query.
|
# ? Feb 22, 2013 18:03 |
|
Karthe posted:Is it just me or is Eclipse terrible for debugging? I get an error like this in LogCat and I'm left feeling as though there should be more information attached to it to help me identify which part of the cited line is faulty: If that is the line, getView returns null and you try to call getContext on null which causes the NPE.
|
# ? Feb 22, 2013 18:07 |
|
Sereri posted:If that is the line, getView returns null and you try to call getContext on null which causes the NPE. Java code:
|
# ? Feb 22, 2013 18:15 |
|
getView() is null until you return from onCreateView(). The view you create there is the one that getView returns. Use getActivity to get a context.
|
# ? Feb 22, 2013 18:19 |
|
Salvador Dalvik posted:getView() is null until you return from onCreateView(). The view you create there is the one that getView returns. Use getActivity to get a context.
|
# ? Feb 22, 2013 18:35 |
|
Is a ContentProvider necessary when I'm just working with internal SQLite databases? I'm learning about them now and am left wondering if implementing one would be overkill; all I want to do is move database queries into a separate thread so the app won't hang. Right now I'm only querying static databases, though I will eventually implement another database that will be populated with user-generated content produced from within the app. I want to handle all of the database-related stuff in a database helper class, but everything I've read about introducing threading into the process points me to implementing a CP. If ContentProviders are something I need to learn if I'm going to be working with SQLite, then can someone help me understand how to best craft URI's? I've skimmed a few ContentProvider tutorials and still can't wrap my head around how I'm supposed to craft URI's for my various use cases. I'm afraid I'll gently caress up and create a CP that's too limited in scope (or go the other way and set up too many URI's) and that'll force me to go back and rewrite large sections of code.
|
# ? Feb 25, 2013 22:30 |
|
Karthe posted:Is a ContentProvider necessary when I'm just working with internal SQLite databases? I'm learning about them now and am left wondering if implementing one would be overkill; all I want to do is move database queries into a separate thread so the app won't hang. Right now I'm only querying static databases, though I will eventually implement another database that will be populated with user-generated content produced from within the app. I want to handle all of the database-related stuff in a database helper class, but everything I've read about introducing threading into the process points me to implementing a CP. Skip 'em to start with. If you need to load them asynchronously, there's a loader framework library by CommonsWare for providerless cursors.
|
# ? Feb 26, 2013 02:58 |
|
|
# ? May 13, 2024 07:05 |
|
Karthe posted:Is a ContentProvider necessary when I'm just working with internal SQLite databases? I'm learning about them now and am left wondering if implementing one would be overkill; all I want to do is move database queries into a separate thread so the app won't hang. Right now I'm only querying static databases, though I will eventually implement another database that will be populated with user-generated content produced from within the app. I want to handle all of the database-related stuff in a database helper class, but everything I've read about introducing threading into the process points me to implementing a CP. Nothing wrong with just calling rawQuery on a SQLiteDatabase object until you start to have more complex queries. The CommonsWare library is ace for asynchronous SQLite queries, but you may not actually need it.
|
# ? Feb 26, 2013 05:07 |