|
Are there any 'tricks' for getting content onto the device/emulator faster? The time it takes to package/sign an apk and upload it is really cutting into a code=>test=>debug cycle. This is a fairly large app that uses the NDK but isn't a NativeActivity.
|
# ? Jul 9, 2013 14:36 |
|
|
# ? May 27, 2024 04:00 |
|
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!
|
# ? Jul 9, 2013 19:04 |
|
So I'm just getting started with some android development, building a little app that will get lots of data over a bluetooth serial port. The UI is very simple, and I'm fairly familiar with Java, so I'm not super worried about that end. But as far as how to handle IO without callbacks, I'm picturing something like this: 1) The main UI thread. 2) A thread that blocks against the InputStream of the BluetoothSocket. As the data stream is parsed and packets are received, it will build some kind of message object and pass them into a Concurrent queue. 3) A thread that consumes the queue, handles statistical analysis of packets received, and updates the UI's data structures (for populating a listview). I'm not sure really the best way to update android UI elements from background threads. The best analogy to the program would be a network packet sniffer. (It's basically sniffing a moderate speed serial control network.) So a couple questions: 1) Is this the right way to handle it? Is there a better abstraction for a background producer thread that spends most of its time blocked? 2) Blocking operations against an InputStream don't have timeout. What's the 'right' way to clean up a background thread that's blocked? 3) Any tips for UI updating? I'm more used to C# .NET where serial streams and the like all have callbacks, and automatic data binding of the UI to application objects eliminates about 90% of this stuff.
|
# ? Jul 13, 2013 18:03 |
|
Thermopyle posted:So, anyway, are there any libraries like that? I think what you want is Index Scrolling as shown on the Android Developers site? Except you don't want alphabetical sections, you want section names. But actually that's just a less specific example of the same thing (note how the Contacts app has "Me" at the top. As far as I can work out you need to set fastScrollEnabled to true on your ListView and then implement SectionIndexer .
|
# ? Jul 18, 2013 16:42 |
|
Tunga posted:This reply is kind of late and I'm only just learning Android so I might be off here. Yes, this is it! Thanks.
|
# ? Jul 18, 2013 20:53 |
|
Anyone know of a decent Android A/B testing service? Something on the lightweight/inexpensive side (i.e. not swerve) preferred... edit: is the clutch.io base really awful or what? admiraldennis fucked around with this message at 03:34 on Jul 22, 2013 |
# ? Jul 22, 2013 03:19 |
|
http://android-developers.blogspot.com/2013/07/android-43-and-updated-developer-tools.htmlquote:Last, we’ve updated the Android Support Library (r18) with several key APIs to help you build great apps with broad compatibility. Most important, we've added an Action Bar API to let you build this essential Android design pattern into your app with compatibility back to Android 2.1. 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.
|
# ? Jul 24, 2013 17:52 |
|
kitten smoothie posted:http://android-developers.blogspot.com/2013/07/android-43-and-updated-developer-tools.html 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.
|
# ? Jul 24, 2013 19:50 |
|
A couple of Android developer advocates were asked about this on G+ or something, I saw it recently. Their answer was that if you're already using ABS then there's no great requirement to recode your app, but for new apps you should probably use Google's version since you know it'll keep working in the future.
|
# ? Jul 24, 2013 19:51 |
|
Tunga posted:A couple of Android developer advocates were asked about this on G+ or something, I saw it recently. Their answer was that if you're already using ABS then there's no great requirement to recode your app, but for new apps you should probably use Google's version since you know it'll keep working in the future. But isn't it just dropping the ABS, including the library and removing all the Sherlock prefixes?
|
# ? Jul 24, 2013 23:18 |
|
Sereri posted:But isn't it just dropping the ABS, including the library and removing all the Sherlock prefixes? It should be, but different code is different code and if you stick by "don't fix what ain't broke" (and conveniently ignore that Android itself is often broken), just stick with what you were already using. I haven't taken a look at Android in a while, but one useful thing I could imagine remaining useful is VPI (ViewPagerIndicator).
|
# ? Jul 25, 2013 08:10 |
|
I updated the SDK but Android Studio doesn't offer 4.3 as a targetable API level. Do I need to do something else before it'll show up? I'm new to all of this.
|
# ? Jul 27, 2013 11:58 |
|
Tunga posted:I updated the SDK but Android Studio doesn't offer 4.3 as a targetable API level. Do I need to do something else before it'll show up? I'm new to all of this. Are you using 0.2.2 that came out two days ago? http://tools.android.com/recent/androidstudio022released
|
# ? Jul 27, 2013 16:45 |
|
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.
|
# ? Jul 27, 2013 18:34 |
|
Tunga posted:I wasn't, but now I am, and it doesn't seem to have made a difference. Do you have multiple SDKs installed? Android Studio comes with its own SDK I think, maybe your pointing at the wrong one?
|
# ? Jul 27, 2013 19:23 |
|
I'm having a lot of trouble getting a ListView working. I've tried using two different adapters (LazyAdapter and then a custom SimpleAdapter) My app takes JSON data and then parses it into a listview (simple enough). But I'm also using the ImageLoader library from nostra13 ( https://github.com/nostra13/Android-Universal-Image-Loader ) to take a dynamically generated URL and download an image. I'm getting NullPointerExceptions, and just now got this when using the custom SimpleAdapter: code:
https://gist.github.com/verkaufer/985a7f4e0f145a729e0b (Results.Java) https://gist.github.com/verkaufer/28ae68336f8b698affec (MyAdapter.java - the new adapter that generated the above error) https://gist.github.com/verkaufer/63d9764dc80c2fa09d10 (LazyAdapter.java - old adapter that I was using but pokeman on line 72 always remained null) Should I keep using my LazyAdapter? I tried the other one because I was stumped on why pokeman wasn't populating (even using breakpoints, it stayed null the entire time).
|
# ? Jul 28, 2013 01:05 |
|
Fluue posted:I'm having a lot of trouble getting a ListView working. I've tried using two different adapters (LazyAdapter and then a custom SimpleAdapter) In results.java, you are referencing the listview but you never grab a reference with findViewById(); Specifically, somewhere before: code:
code:
|
# ? Jul 28, 2013 01:43 |
|
Whoops! I must have deleted that line when refactoring.. I'm still receiving the same error though. I tried a solution provided on StackOverflow (changing my activity name for Results.java to .Results in AndroidManifest.xml) but that still results in the same error and app crash. Is there a specific debug method I should look at to determine where things are going wrong?
|
# ? Jul 28, 2013 19:24 |
|
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. 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?
|
# ? Jul 30, 2013 21:55 |
|
Fluue posted:Whoops! I must have deleted that line when refactoring.. Debug the code and look at why it is null. You need to find out where you assign it a value and why that code isn't executing, or where it is set to null. If you only set things using setter methods then this is relatively easy. Also I would check out Volley for image loading and caching. It has a NetworkImageView that handles everything real nice for you including caching. If you (or anyone) has any Volley questions just ask because I've been looking at it quite extensively recently.
|
# ? Jul 31, 2013 04:02 |
|
Angryhead posted:Ugh, spent a while trying to figure out why my app was crashing on a friend's phone. 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
|
# ? Jul 31, 2013 15:27 |
|
Glimm posted: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. 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. e: No change. Angryhead fucked around with this message at 17:08 on Jul 31, 2013 |
# ? Jul 31, 2013 16:23 |
|
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. 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.
|
# ? Jul 31, 2013 16:29 |
|
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. Looks like setScaleX is implemented in the support library, kind of. See, e.g., android.support.v4.view.viewPager. Speaking of which, has anyone gotten the backported android.support.v7.widget.ShareActionProvider to work? After inflating the menu in onCreateOptionsMenu(), I try to get a reference to the ShareActionProvider and instead get null. XML looks like this: code:
code:
Running almost identical code using the ICS classes (android.widget.ShareActionProvider) works fine.
|
# ? Jul 31, 2013 17:23 |
|
Where is MenuItemCompat coming from? Is that a static call?
|
# ? Jul 31, 2013 17:25 |
|
Sereri posted:Where is MenuItemCompat coming from? Is that a static call? It's coming from android.support.v4.view.MenuItemCompat, and it is indeed a static function.
|
# ? Jul 31, 2013 17:28 |
|
All right, I figured it out. When using the support lib, you have to change the XML schema of the Action-related XML elements. In addition, you need to be subclassing ActionBarActivity rather than Activity, and of course import android.support.v7.app.ActionBarActivity. You'll also need android.support.v4.app.MenuItemCompat. (While you're at it, you can go ahead and make the little action bar "back" button work through the support library on older devices) So, here's the working XML: code:
code:
code:
|
# ? Aug 1, 2013 04:30 |
|
Can I reference an existing string in strings.xml when I define another string? For example:XML code:
|
# ? Aug 2, 2013 17:05 |
|
Karthe posted:Can I reference an existing string in strings.xml when I define another string? For example: XML code:
Java code:
|
# ? Aug 2, 2013 17:36 |
|
Is there a good or common directory that apps can write files to? I'm planning on implementing a feature that will let users export vocabulary lists from my app. I want them to be able to easily find and copy them off the device afterwards.
|
# ? Aug 3, 2013 06:57 |
|
Karthe posted:Is there a good or common directory that apps can write files to? I'm planning on implementing a feature that will let users export vocabulary lists from my app. I want them to be able to easily find and copy them off the device afterwards. External storage typically fills that role, you can create a folder and save your files there. Most devices will offer a method to read from that storage via USB, so they don't even need to pull a card or use a separate app to get to it. It's up to the device whether that storage will be an SD card or dedicated partition with USB access, so don't explicitly state that it's on the SD card or it might confuse the user.
|
# ? Aug 3, 2013 07:04 |
|
Are there any real good resources for NDK development out there? It honestly feels like I'm on the bleeding edge of things with the hoops needed to go through to get things to run correctly.
|
# ? Aug 3, 2013 19:10 |
|
Do any of you guys have any experience with the Play Store's third-party translation services? I translated the UI of my Japanese dictionary app into Japanese but want someone native to proof-read it. I'm feeling bad asking friends to proof my stuff for free, so I'm considering shelling out a bit of cash up front to get a bona fide translation in place before launch.
|
# ? Aug 6, 2013 06:00 |
|
Karthe posted:Do any of you guys have any experience with the Play Store's third-party translation services? I translated the UI of my Japanese dictionary app into Japanese but want someone native to proof-read it. I'm feeling bad asking friends to proof my stuff for free, so I'm considering shelling out a bit of cash up front to get a bona fide translation in place before launch. PM tarepanda. He should be fluent and know a thing or two about apps, I think.
|
# ? Aug 6, 2013 11:05 |
|
Angryhead posted:Ugh, spent a while trying to figure out why my app was crashing on a friend's phone. This has burned me more than once Android Studio picks up on these issues though.
|
# ? Aug 10, 2013 19:44 |
|
Any idea if there is a way for me to get my hands on a physical copy of the Android SDK documentation, short of just printing it out and putting it in a binder? I'm not in a location with regular access to the internet and am starting the dive into Android development. I have about 6 years in C++ (surprised it took me this long to go mobile) and have already purchased the O'Reilly book from Amazon. Looking for good offline resources that can keep me going long enough until I get back home.
|
# ? Aug 15, 2013 12:08 |
|
PicnicBasket posted:Any idea if there is a way for me to get my hands on a physical copy of the Android SDK documentation, short of just printing it out and putting it in a binder?
|
# ? Aug 15, 2013 12:17 |
|
Tunga posted:There should be a docs folder in your SDK root. offline.html, well I'm mildly embarrassed. This will do, thank you!
|
# ? Aug 15, 2013 12:41 |
|
I'm trying to create an action bar which looks something like the one in the AOSP Contacts app. The main bar is blue, the icons and text are white, and the overflow menu is white with dark text. In my case I'm using purple rather than blue but the principle should be the same. The problem is that if I use Theme.Holo.Light as my base theme then the overflow icon turns dark grey which looks rubbish on a solid colour, it should be white. If I use Theme.Holo.Light.DarkActionBar then the icon is white (good) but the overflow menu will have a black background (bad). Which of these things is it easier for me to manually override and how do I go about it? I'm struggling to find any decent API documentation for the Widget.Holo.blabla stuff so I don't even know what it is that I should be overriding. Here's my code right now: code:
Tunga fucked around with this message at 18:30 on Aug 18, 2013 |
# ? Aug 18, 2013 18:26 |
|
|
# ? May 27, 2024 04:00 |
|
Tunga posted:I'm trying to create an action bar which looks something like the one in the AOSP Contacts app. The main bar is blue, the icons and text are white, and the overflow menu is white with dark text. Give this a shot: http://jgilfelt.github.io/android-actionbarstylegenerator/ It has an option to customize the overflow menu color (but it's flaky in ABS, I've been meaning to try it in ABC). I forget the exact method to customize that color, but you can set a unique color in that utility and look at the results. I think it might have involved a 9-patch image as well, so look at the resources.
|
# ? Aug 18, 2013 21:59 |