|
Material Design compatibility guide posted:The material theme is only available in the Android L Developer Preview. To configure your app to use the material theme on devices running the Android L Developer Preview and an older theme on devices running earlier versions of Android: Yeah I bet this will catch on very soon.
|
# ? Jun 26, 2014 22:27 |
|
|
# ? May 13, 2024 09:18 |
|
They'll probably make that setup a default for new apps, at least. It would be nice to backport the Material stuff so we can just use the exact same theme, I have to believe this is the plan. Right Google? Right?
|
# ? Jun 27, 2014 02:18 |
|
I'm playing with an alarm application and I want to make the dismiss screen stick around until a specific action takes place. However, you can simply press the home button or restart the phone to get around it now. What are some ways of forcing the activity to remain open? I was thinking of either: 1) Disabling back button or home button 2) Scheduling a repeating activity unless the action takes place, in which case I cancel it (not sure how to do this) 3) Trying to override the finish/onPause methods to prevent the activity from stopping, if thats even possible. Any ideas on what would be the best way to accomplish this? How can I ensure that its the same instance of the activity that gets relaunched, if a scheduler is the best option?
|
# ? Jul 8, 2014 21:26 |
|
FateFree posted:I'm playing with an alarm application and I want to make the dismiss screen stick around until a specific action takes place. However, you can simply press the home button or restart the phone to get around it now. What are some ways of forcing the activity to remain open? The best way to handle this would be to set up your app to check for completion of "a specific action" in your main Activity's onStart() and then re-display the dismiss screen. You can also use setCancelable() in your dismiss screen (if it's a Dialog) to prevent it from being closed via the Back button or by touching outside of the window.
|
# ? Jul 9, 2014 16:00 |
|
Put the alarm sounding part in a service and have it display an ongoing notification. Then bind to the service with the activity and let the user dismiss it via the button / maths problems / whatever gimmick your alarm app has. If the user minimises the app, it'll keep sounding until they go back to the app which they can do either with the task switcher or via the notification. This is how the stock clock/alarm app works.
|
# ? Jul 9, 2014 16:09 |
|
Tunga posted:Put the alarm sounding part in a service and have it display an ongoing notification. Then bind to the service with the activity and let the user dismiss it via the button / maths problems / whatever gimmick your alarm app has. If the user minimises the app, it'll keep sounding until they go back to the app which they can do either with the task switcher or via the notification. This is how the stock clock/alarm app works.
|
# ? Jul 9, 2014 16:34 |
|
Karthe posted:I...I have so much to learn http://developer.android.com/guide/components/services.html
|
# ? Jul 9, 2014 16:55 |
|
There ARE ways to make your UI always be on top, but it's generally not a good thing for you to do.
|
# ? Jul 9, 2014 17:43 |
|
Tunga posted:If you've never touched services before, now is a good time to learn because what you're doing here is actually relatively simple and a really good example of when you would use a service to run something in the background and then bind an activity to it. I am not an expert in this stuff but I'm pretty sure this is the most appropriate workflow for what you are describing.
|
# ? Jul 9, 2014 17:47 |
|
Karthe posted:FateFree was the one with the app question, I was just offering up some (seemingly poor) advice. Regarding list item number two, you can schedule activities to launch at a specific time. It's not a thing you'd normally want to do because that's a good way to infuriate your user, but in the case of an alarm clock app it would be entirely reasonable. https://developer.android.com/training/scheduling/alarms.html http://www.steventrigg.com/alarm-manager-create-an-alarm-clock-in-android-tutorial-part-6/ However, you definitely shouldn't use this to constantly pop up an Activity until something happens, that would be terrible. Tunga fucked around with this message at 19:09 on Jul 9, 2014 |
# ? Jul 9, 2014 19:03 |
|
Tunga posted:However, you definitely shouldn't use this to constantly pop up an Activity until something happens, that would be terrible. Yeah, that sounds like the mechanism this piece of ransomware uses. Background service that just waits 5 seconds after an activity goes away and spawns a new one. http://labs.bitdefender.com/2014/05/reveton-icepol-ransomware-moves-to-android/
|
# ? Jul 9, 2014 20:07 |
|
This is from ages ago but I'm working on this problem again and I'm still trying to decide what the best way to approach it would be.Tunga posted:I'm looking at using AccountManager with a custom AccountAuthenticator and SyncAdapter to sync some data with a fairly simple REST interface. The server doesn't support HTTPS or auth tokens so I need to send the username/password each time. Should I have #getAuthToken return the password as a kind of fake token, or should I have the SyncAdapter request the password directly (which will be allowed since it's in the same package) and have #getAuthToken throw an UnsupportedOperationException (or similar)? Both of these break the rules somewhat but I feel that the second option is probably the better of the two since it doesn't expose the user's password to other apps. Or is there a better way to handle this?
|
# ? Jul 15, 2014 16:42 |
|
Maybe someone can help me figure out what's up with my build. I've been getting a lot of "class not found" and "NoClassDefFound" errors recently. My android project in Eclipse imports another Java project and uses some of the classes in that. Till now I've been able to simply go into the Java Build Path on the droid project and add it to the "Projects" and then go to "Order and Export" and check it. However recently when I try to build and run the app in the emulator I'm getting a ton of errors saying it can't find the classes, almost as if they aren't getting exported. Here's the weird part, if you pull the same repo down on my Mac machine and build&run, it works fine! I've tried tons of stuff. Cleaning, rebuild, reordering exports, deleting/reinstalling eclipse, clearing workspace settings, etc. with no luck. Some info that might help diagnose the issue. My java project uses maven to build (Droid project doesn't), but I've checked to make sure the classes do build and they are in the folders, again this works on Mac no prob. JDK version: 1.7.0_02 JRE ver: 1.7.0_55 I'd love to get my windows machine building again, but at this rate I'm half tempted to format and resintall. Any ideas? Kenishi fucked around with this message at 11:36 on Jul 16, 2014 |
# ? Jul 16, 2014 11:34 |
|
Kenishi posted:However recently when I try to build and run the app in the emulator I'm getting a ton of errors saying it can't find the classes, almost as if they aren't getting exported. That's because they're probably not. If you use baksmali or something similar on the apk, you'll probably find them missing. As to why, the answer is usually Because Eclipse. I'm not sure what else to suggest to you without being able to see what your actual project setup is, sorry. It's possible that something weird with maven is going on, where it thinks that it's exporting the artifact but actually isn't. Also, "Droid" is a Verizon marketing term. The word you are thinking of is "Android"
|
# ? Jul 16, 2014 12:50 |
|
Are there any good resources on designing functionality that let users toggle between a light theme and a dark theme? I understand the basics of switching between two themes, but I'm stumped on how to change out the color palettes and icons that are loaded for each theme. Right now my app uses a Theme.Holo.Light-based theme, and so the ActionBar icons and Navigation Drawer use icons and colors themes that account for the predominantly off-white appearance. However, when I set the app theme's parent to Theme.Holo, the ActionBar icons are hard to see and the Navigation Drawer is still white (because of the @color I set it to). Do themes support something like refs.xml does, in that you can specify different drawables or layouts for a particular value (i.e. for sw600dp devices, @layout/activity_layout in Activity.java instead uses @layout/activity_layout_two_columns)? If not, what can I do so that @color/nav_drawer_bgcolor or @drawable/ac_icon returns one color or icon for one theme, and a different color or icon for another?
|
# ? Jul 16, 2014 17:53 |
|
Karthe posted:Are there any good resources on designing functionality that let users toggle between a light theme and a dark theme? I understand the basics of switching between two themes, but I'm stumped on how to change out the color palettes and icons that are loaded for each theme. Right now my app uses a Theme.Holo.Light-based theme, and so the ActionBar icons and Navigation Drawer use icons and colors themes that account for the predominantly off-white appearance. However, when I set the app theme's parent to Theme.Holo, the ActionBar icons are hard to see and the Navigation Drawer is still white (because of the @color I set it to). Are you specifying attribute values? Example: Make an attrs.xml in your values folder, then add something like this: code:
code:
code:
code:
|
# ? Jul 16, 2014 18:15 |
|
Volmarias posted:That's because they're probably not. If you use baksmali or something similar on the apk, you'll probably find them missing.
|
# ? Jul 16, 2014 21:49 |
|
So I needed to work on an Android thing again yesterday. No big deal fire up eclipse, etc. Oh look some android component needs updating, updates, breaks other things, update those, endless cycle.....broken eclipse. So I redownload the latest eclipse and ADT thing, get that going. Projects are starting to build. The only problem is that graphical editor for the layouts isn't working. It'll display the layout but won't let me add UI elements to it in a drag and drop manner. So my questions are 1)Am I just being a whiny baby for wanting a visual studio style UI thing? Should it even matter and just "XML or go home"? 2)I know the non-eclipse IDE is "beta" but Google will often leave the beta designation on things that work really reliably (like Maps and Earth for the longest time). So.... are you guys using eclipse still or am I an old fogey and need to get with the times? I spend like 5% of my time doing Android things so sometimes I get left out in the dust.
|
# ? Jul 25, 2014 17:06 |
|
If you want Android Studio without the beta tag, just use IntelliJ. It has a much better UI editor than Eclipse, for a start. Though I still mostly end up writing the XML myself it can be useful to figure out why something isn't displaying like I expected, or which particular component I need to edit.
|
# ? Jul 25, 2014 17:32 |
|
Definitely try Android Studio, it's way better than eclipse in my experience. Now that it's in beta they promise not to make majorly breaking changes like they did in the past. It updates all the time (like, weekly) but it's good because they're fixing bugs and iterating on it quickly.
|
# ? Jul 25, 2014 18:53 |
|
I tried out Android studio in the really early preview stage and ended up switching back to Eclipse. Then tried AS about 2 months ago. I don't use Eclipse anymore once I got used to gradle and got my git situation worked out and integrated. I'm never going back, though I will probably purchase intelli j in the future.
|
# ? Jul 25, 2014 19:33 |
|
Android Studio is still very much a beta, but it's better than Eclipse at this point.
|
# ? Jul 26, 2014 01:18 |
|
So I'm trying to run this thing but I'm completely lost, I don't know where to run the script or what to put on line 37. http://java.dzone.com/articles/android-email-extraction-eml https://gist.github.com/rbramley/65261127dfb857b03bb6
|
# ? Jul 28, 2014 04:03 |
|
It seems weird that they're hardcoding an address for the "from" field (which is what's assigned in row 37) when I would assume the "fromList" would have the appropriate info to put there.
|
# ? Jul 28, 2014 04:08 |
|
kitten smoothie posted:It seems weird that they're hardcoding an address for the "from" field (which is what's assigned in row 37) when I would assume the "fromList" would have the appropriate info to put there. The thing I want all of the email from the inbox not just the ones from certain people.
|
# ? Jul 28, 2014 04:13 |
|
Volmarias posted:Android Studio is still very much a beta, but it's better than Eclipse at this point. I've been wanting to give this a try for awhile now, going to check it out tonight.
|
# ? Jul 29, 2014 19:16 |
|
I'm a designer and I'm making animations for an app. Think of something like this: https://dribbble.com/shots/1623679-Open-Close when you press a button (while still having it be a button). Unfortunately, I can't seem to find any resources explaining how to implement something like that. I can export it as a gif, png sequence, h264 .mov or .mp4 with transparency, or try to give my programmer instructions on how to recreate animations in code, but I think having to do so with every animation would end up being an inefficient use of his time. We're using Android Studio. Anyone have any experience with or could point me in the right direction?
|
# ? Aug 4, 2014 19:28 |
|
You probably want something like this I guess: http://developer.android.com/guide/topics/graphics/drawable-animation.html You can save your anims as a set of frames and define them in xml, and then have the code start the animation based on things like touch events. Your issue is that (from what I can see anyway) there aren't any callbacks for when an animation finishes, so your coder will have to come up with a way of handling the switch to a reverse animation. You could set a timer based on the animation's total duration, or do something in the opposite touch event, or something. AnimationDrawable seems a little lacking to be honest, you can even jump to a specific frame from what I can see, so depending on your needs you might need to expand on it a bit
|
# ? Aug 6, 2014 01:30 |
|
I was afraid that would be it. Oh well, thanks.
|
# ? Aug 7, 2014 17:05 |
|
Well just to be clear, the actual 'recreating animations' side involves you saving the frames to a folder or something, ordering them with a suffix (I'd imagine that's taken care of by every frame exporting program out there), and then an XML file needs to be generated for each group of frames, so that's something that can be automated to a large extent. And any extra code needed to get around the limitations of the animation API itself would be something you'd reuse where it's needed. So there might be some extra coding involved, but it doesn't need to mirror the work you're producing, you know? There might also be a few helpful libraries that already implement advanced animation functionality, someone else might be able to recommend some. And it's worth pointing out that Android will be seeing a major UI makeover soon with Android L, which uses something called Material Design which is visually based heavily on movement and transitions and stuff. There might be more robust animation APIs coming in that
|
# ? Aug 7, 2014 22:17 |
|
I'm starting up with Android development with I managed to find my system's avd folder, but I still have no idea on how to version it. It doesn't seem like I can change that folder easily.
|
# ? Aug 11, 2014 14:19 |
|
When you say "versioning", do you mean saving and loading the current device state? You can use snapshots to do this. Details on this SO.
|
# ? Aug 11, 2014 15:05 |
|
I mean in the sense of "sharing the exact same AVD between a team and propagate changes of its configuration, if any, automatically". Like you do with code + git. I thought about sticking a copy of the avd folder in the git repository, but that doesn't take care of any changes it might have throughout the project. Of course, I don't know if changes to the avd should happen anyway.
|
# ? Aug 11, 2014 15:48 |
|
My team just set up various emulator run configurations in the project in IntelliJ and named them according to how the AVD should be configured. The AVD name you are to use when configuring is the same as the run config name. For instance, "Nexus4-18-x86" for a 4.3 device using the Nexus 4 profile and x86 system image. We support 4.0.3 through 4.4, so we did this scheme run configs from API level 15 thru 19. Then that got committed to git since it's part of the project config in the IDE. If you join the team, then you just set up your AVDs based on that, name them the same way, and then you generally never end up screwing with them again otherwise. It's sort of on your honor that you set up the AVDs correctly, but it's not like it's really prone to problems since it's something you're not going to be changing going forward. We've got a team of probably eight developers and none of us have had any issues with this process when people come on board. kitten smoothie fucked around with this message at 16:37 on Aug 11, 2014 |
# ? Aug 11, 2014 16:35 |
|
I think that will work, then. Thank you.
|
# ? Aug 11, 2014 17:44 |
|
I've just finished a couple of modules on Java and I'd like to make small program for Android - a todo list or a simple game (thinking like a quiz or something because I've got very little experience with UI stuff). I'm particularly interested using the touchscreen and widgets since almost all the uni work I've done was text based. Should I use ADT with Eclipse or go straight to Studio? From reading the thread it seems like Studio is already better than Eclipse, but a lot of the tutorials I've seen have been Eclipse based. I basically just want to have an app on my phone that I can add to as my knowledge improves and to help me get a feel for the platform. Are those the two viable options nowadays? Chas McGill fucked around with this message at 17:21 on Aug 13, 2014 |
# ? Aug 13, 2014 17:18 |
|
If you're already comfortable with Eclipse then it's fine to go with that. Whatever you prefer really, both are fine. ItelliJ / AS do seem to be more popular for professional use (and are certainly my preference) but I've met various people who swear by each of the three.
|
# ? Aug 13, 2014 17:34 |
|
Tunga posted:If you're already comfortable with Eclipse then it's fine to go with that. Whatever you prefer really, both are fine. ItelliJ / AS do seem to be more popular for professional use (and are certainly my preference) but I've met various people who swear by each of the three.
|
# ? Aug 13, 2014 18:32 |
|
Chas McGill posted:The only IDE I've spent much time with is Netbeans so I'm not familiar with Eclipse either. I've installed Android Studio and I'm setting it up with Genymotion now. Seems pretty slick! The tutorial I'm going through is pretty out of date but the meat of the information is still relevant. Yeah, I'd go with Android Studio then. The default keybinds are stupid (which is IntelliJ's fault) but other than that there is no particularly compelling reason to favour Eclipse. Google have made it clear that they will continue to support both but it's obvious where their focus lies. As well as the official ones from Google, I also found Lars Vogel's tutorials useful: http://www.vogella.com/tutorials/Android/article.html https://developer.android.com/training/basics/firstapp/index.html
|
# ? Aug 13, 2014 20:49 |
|
|
# ? May 13, 2024 09:18 |
|
I really wish Google would just buy Genymotion already.
|
# ? Aug 13, 2014 22:25 |