|
Karthe posted:What's a good way to hardcode a "no ads" mode into my app so that ads are disabled on any device from which I personally run the app?
|
# ? Dec 26, 2013 20:18 |
|
|
# ? May 11, 2024 10:42 |
|
Tunga posted:I guess you could check the Google accounts on the device against a hardcoded whitelist. Alternately, add your device's serial number to a string array in resources and check against that. code:
|
# ? Dec 26, 2013 20:58 |
|
Ulysses S. Grant posted:Alternately, add your device's serial number to a string array in resources and check against that.
|
# ? Dec 26, 2013 22:01 |
|
I'm trying to get a list of printers working properly, but for some reason, my refresh button doesn't work. The refresh button triggers the getPrinters function, but when it reaches the mService.go(), mService is null. I don't understand what the problem is, as I did a very similar thing in another project. Also, the onServiceConnected() in the ServiceConnection is never called. Why is this? http://goo.gl/uQnt65 I hope my code is a little bit understandable. Boz0r fucked around with this message at 12:47 on Dec 31, 2013 |
# ? Dec 30, 2013 23:28 |
|
When would you use the fragment backstack instead of the regular activty backstack? What is the Android way?
|
# ? Jan 3, 2014 16:02 |
|
Jarl posted:When would you use the fragment backstack instead of the regular activty backstack? What is the Android way? I wouldn't use the fragment backstack because it throws away fragment state.
|
# ? Jan 3, 2014 17:01 |
|
I have been using webdings and windings for some assets in my app. Now, I am getting ready to release it. Does anyone know if it is all good or am I setting myself up for a licensing problem or ip infringement case in the future? For example I use the open book webding or wingding for a category icon. Perhaps I should remake all of the assets idk.
|
# ? Jan 3, 2014 19:30 |
|
Infomaniac posted:I have been using webdings and windings for some assets in my app. Now, I am getting ready to release it. Does anyone know if it is all good or am I setting myself up for a licensing problem or ip infringement case in the future? For example I use the open book webding or wingding for a category icon. Are you using those fonts to make PNG icons? You can look at http://fontawesome.io/. It has most of the common symbols you would want, and the license looks pretty much perfect for your needs. I just use it to generate icons in photoshop. e: Just install the font to your PC and copy/paste from the cheatsheet.
|
# ? Jan 3, 2014 19:38 |
|
Yes, I ran them through the androind asset studio icon generator, and some of them were modified a bit after the fact. One of the reasons I used wingdings and webdings is that they are the among the available fonts in the dropdown so I figured it might be kosher/ cleared somehow through Google. Definitely downloading fontawesome, thanks for the recommendation.
|
# ? Jan 3, 2014 20:46 |
|
Further checking led me to a post about the webdings eula. Apparently, it is all good to create and distribute static graphic images png, gif, jpg to create printed t shirts etc... I found the actual eula and I think it's all good, but it is nice to have a backup plan.
|
# ? Jan 3, 2014 23:31 |
|
Doctor w-rw-rw- posted:I wouldn't use the fragment backstack because it throws away fragment state. But fragment has onSaveInstanceState just like activity. Besides making it possible to save the state, even if the fragment is killed while another activity is active, this, to me, also implies that a fragment on the fragment-backstack is retained in memory until killing it becomes necessary. Am I misunderstanding this?
|
# ? Jan 6, 2014 12:21 |
|
Jarl posted:But fragment has onSaveInstanceState just like activity. Besides making it possible to save the state, even if the fragment is killed while another activity is active, this, to me, also implies that a fragment on the fragment-backstack is retained in memory until killing it becomes necessary. It isn't called in all situations. It's been a couple of years since I wrestled with this, but this might have been because of view pagers or fragment pager adapters not calling the state-saving methods - I don't specifically recall. Or perhaps some interaction with launching activities. In any case, I found it unreliable and broken.
|
# ? Jan 7, 2014 05:21 |
|
Is there a way to read a single file from a ZIP file store in the /assets/ directory? I want to use ZipFile.getEntry() to dynamically grab a specific file, but I can't figure out how to get the ZIP file in a position to do that. A lot of guides and SO articles related to this use ZipInputStream to read the contents of a given ZIP file, but that involves iterating over every single compressed file to find the one you want. The ZIP file I'm working with has almost 6700 SVG files in it, that's not feasible. EDIT: Nevermind, I'm just going to dump the SVG files into the main OBB file and read them using Google's APKExpansionSupport library. IAmKale fucked around with this message at 23:15 on Jan 9, 2014 |
# ? Jan 9, 2014 22:18 |
|
Karthe posted:Is there a way to read a single file from a ZIP file store in the /assets/ directory? I want to use ZipFile.getEntry() to dynamically grab a specific file, but I can't figure out how to get the ZIP file in a position to do that. A lot of guides and SO articles related to this use ZipInputStream to read the contents of a given ZIP file, but that involves iterating over every single compressed file to find the one you want. The ZIP file I'm working with has almost 6700 SVG files in it, that's not feasible. Iterating over 6700 small entries in a small contiguous range of bytes is not necessarily expensive, especially not if it's done once at startup and you cache the zip entries. In any case, assets are actually already accessed directly from within the APK, which is a compressed zip file, so you really don't gain anything by accessing a file-within-a-zip-within-a-zip. What is your rationale for zipping it up vs, say, putting it in a subdirectory of the assets folder vs. packaging it separately?
|
# ? Jan 10, 2014 01:32 |
|
I have a stack A_1->A_2->A_3->B (A_1, A_2 and A_3 are all instances of the same activity A) and I want to pop back to the A_1 (root activity you will) without it being restarted it (i.e. onCreate being run), and hence with the rest of the stack finishing. Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK doesn't work, since it restarts the activity and Intent.FLAG_ACTIVITY_CLEAR_TOP doesn't work either since it also restarts the activity. I just want it to be like if the user had used the back button until they were back at A_1.
|
# ? Jan 10, 2014 16:40 |
|
Doctor w-rw-rw- posted:In any case, assets are actually already accessed directly from within the APK, which is a compressed zip file, so you really don't gain anything by accessing a file-within-a-zip-within-a-zip. What is your rationale for zipping it up vs, say, putting it in a subdirectory of the assets folder vs. packaging it separately? I hadn't made the connection that since APK's are already compressed it doesn't matter if I dump a bunch of files into it since they'll get compressed as well. In the interest of keeping updates fairly small in size, I've decided that storing the static (in the sense that it's not updated very often) collection of drawings in the main expansion file is the way to go. And instead of ZIP files inside ZIP files, I just dumped the files themselves into the root of the OBB file since it gets compressed anyway.
|
# ? Jan 10, 2014 17:04 |
|
Jarl posted:I have a stack A_1->A_2->A_3->B (A_1, A_2 and A_3 are all instances of the same activity A) and I want to pop back to the A_1 (root activity you will) without it being restarted it (i.e. onCreate being run), and hence with the rest of the stack finishing. Start the activities with an intent that includes a counter, and finish with a result code that signals the chain of activities should finish themselves until they hit the original counter of 0? Or just destructively do it as you start activities by finishing the predecessor at the same time, if I understand correctly.
|
# ? Jan 10, 2014 19:11 |
|
Doctor w-rw-rw- posted:Start the activities with an intent that includes a counter, and finish with a result code that signals the chain of activities should finish themselves until they hit the original counter of 0? Or just destructively do it as you start activities by finishing the predecessor at the same time, if I understand correctly. What I need is a HOME button (you know, the "up carret" next to the app icon in the top right) that pops the activity-instances back to the first activity-instance (not a new instance of the first activity), and if I continuously do something to make this possible, then it must NOT mess up the stack, because that mess up the regular back button which pops one activity-instance at a time. Thus killing the predecessor as I go along is not an option, since the back button wont work as intended (i.e. it wont work as it is always expected by the user to work), AND the HOME button will not get you back to the original root activity-instance, but instead a new instance. The chain you talk about would mean that EVERY activity and activity-call I have needs to follow this scheme with no exception. I cannot understand why such a basic thing as "get me back to the original activity-instance on the stack" needs an extensive and/or hack solution. I mean it is right there at the bottom of the activity-stack, and if I as a user push the back button enough times I can get there. So why can't this be accomplished programmatically? EDIT: This might be what I need to know, but haven't tried it yet: http://developer.android.com/training/implementing-navigation/ancestral.html Jarl fucked around with this message at 11:28 on Jan 13, 2014 |
# ? Jan 11, 2014 21:42 |
|
Are you trying to pop off the entire stack to get back to the first activity, or are you trying to add the first activity to the top of the stack with the same state it had before? If it's the former you won't be interfering with the user's experience, you're effectively just pressing the back button for them I don't know if it'll help at all but it might be worth looking at fragments, especially choosing what gets added to the stack http://developer.android.com/guide/components/fragments.html#Transactions You might just want to have fragment 1 get added and recreate its state
|
# ? Jan 13, 2014 05:23 |
|
baka kaba posted:Are you trying to pop off the entire stack to get back to the first activity That is what I'm trying to do, BUT there are multiple instances on the stack of the first activity, so it should be "back to the BOTTOM activity-intance", and the activity should NOT be recreated. baka kaba posted:If it's the former you won't be interfering with the user's experience, you're effectively just pressing the back button for them Exactly, which is why I expected it to be supported. EDIT: http://developer.android.com/training/implementing-navigation/ancestral.html sadly this wont be a solution since it under the hood does one of the things I've already tried. code:
Jarl fucked around with this message at 11:29 on Jan 13, 2014 |
# ? Jan 13, 2014 09:21 |
|
I have solved it by doing:code:
code:
|
# ? Jan 13, 2014 15:17 |
|
I want to use the stock 'pop' touch sound in my app from KitKat. Is it possibly without rooting and copying the actual sound file into my resources? I know you can access the factory ring tone via RingtoneManager, but what about the 'pop' touch sound?
|
# ? Jan 22, 2014 04:48 |
|
Using the following image I want to be able to overlay other images onto the slots in the upper-half of the image (and eventually the lower-half). I was thinking maybe a GridLayout, but I'm not sure if it's the best option since I'm not real experienced with android. Currently, I just have the image set as the background, but I can change that if needed. Any tips would be appreciated.
|
# ? Jan 23, 2014 09:35 |
|
Is there any way to exit an Android application in the oncreate method in a class that extends Application? System.exit(0) does not work. I need it when a check fail, that only need to be run once when the application starts. A hack would be to set a static boolean and check it in my home activity's oncreate method, where I can then call finish, but then the check wont be made again until the user manually shutdown the application and restarts it. Another way would be to put the check itself in the home activty, but the activty is used in multiple instances, and isn't always just the home activity, so it would clutter the code. Still if it is the only way, then it is the only way. EDIT: Have decided to put the check in the activity, where it is run if it is the home activity instance. Jarl fucked around with this message at 12:26 on Jan 24, 2014 |
# ? Jan 24, 2014 11:46 |
|
Developer console really messed up today, blocking any updates for one of my apks. Frustrating because I completed a rewrite of my apps description and am unable to update. Fingers crossed that every thing gets worked through the system. Upside the chat support was very fast with a response for me.
|
# ? Feb 6, 2014 09:58 |
|
Anybody who knows why on earth there only is a horizontal viewpager? There are hacks on the net and selfmade vertical viewpagers, but this is such a fundamental thing that it obviously should be natively supported. Is it possibly a design philosophy by Google?
|
# ? Feb 6, 2014 17:07 |
|
Jarl posted:Anybody who knows why on earth there only is a horizontal viewpager? There are hacks on the net and selfmade vertical viewpagers, but this is such a fundamental thing that it obviously should be natively supported. Is it possibly a design philosophy by Google? They don't have a horizontal listview either. There are a lot of obvious view elements that should exist but don't, it's pretty frustrating. You might be able to hack jump-by-page functionality into listview, but that doesn't sound fun at all.
|
# ? Feb 6, 2014 17:11 |
|
Uncomfortable Gaze posted:They don't have a horizontal listview either. The worst part is not even that is is annoying to make/hack these things. Instead it is that it's very likely it will suddenly break with Android 4.5 or something. Also the improvements/fixes made to the ordinary ViewPager is not automatically put into your own homemade VerticalViewPager. *sigh* Come on Google.
|
# ? Feb 6, 2014 17:32 |
|
What's your use case? A vertical ViewPager sounds like a fairly horrible piece of UX, which is probably why it doesn't exist by standard. (Reminds me of a question I came across recently on SO which was basically "how do I make swiping scroll the other way" and all the answers were "oh god why would you do this?")
|
# ? Feb 6, 2014 17:59 |
|
Tunga posted:What's your use case? A vertical ViewPager sounds like a fairly horrible piece of UX, which is probably why it doesn't exist by standard. Imagine a number of "span"-pages which you traverse horizontally. Each "span"-page consists of pages you can traverse vertically. This can all be done. Now however you also want thumbnails to all these pages that you can call up. Each "span"-page's thumbnails (one for each page) fit in a VerticalViewPager, which in turn is in a HorizontalViewPager. Now you can horizonally swipe through the thumbnails for each "span"-page, while you also can swipe vertically in a "span"-page's thumbnails with swipes. When you touch a thumbnail, that becomes the current page. EDIT: Each # is a thumbnail. You can only see 3,5 x 2 thumbnails at a time. In column 8 you might want to swipe down to number 4. The other "span"-pages wont scroll along. code:
Jarl fucked around with this message at 20:27 on Feb 6, 2014 |
# ? Feb 6, 2014 20:19 |
|
Right, but that's a description of a vertical ViewPager. What are you actually trying to use it for? I assume the thumbnails link to something? Why can't I just flick-scroll down through each column and tap on the thing that I want to view rather than having to swipe swipe swipe once per thing? Look at something like Currents or Newsstand. I might be missing something specific about why your content should work that way.
|
# ? Feb 6, 2014 20:31 |
|
Tunga posted:Right, but that's a description of a vertical ViewPager. What are you actually trying to use it for? I assume the thumbnails link to something? Why can't I just flick-scroll down through each column and tap on the thing that I want to view rather than having to swipe swipe swipe once per thing? Look at something like Currents or Newsstand. I might be missing something specific about why your content should work that way. I'm no designer and hence did not decide this. I suppose you could use a flick-scroller without a side bar with how far down you are (sans side bar would be necessary). EDIT: On the other hand by that logic why even use a horizontal ViewPager? EDIT2: The pages are pages in a digital-magazine, so I think the reason is that it doesn't fit with how an article in a magazine should be consumed. Still, when you use thumbnails to jump to a page, it shouldn't matter that you might see too much too fast. You are already jumping into it and thus skipping something. Again, not the designer so I'm just guessing. Jarl fucked around with this message at 21:07 on Feb 6, 2014 |
# ? Feb 6, 2014 20:52 |
|
Okay having looked at it again the pages are navigated with horizontal- and vertical-viewpager, and that is a good thing (you swipe through pages). However the thumbnails are navigated likewise, and that is a bad thing, but the reason was that ordinary scroll would load all the pictures from the get go and with 100 pages that used to much RAM.
|
# ? Feb 7, 2014 10:06 |
|
As far as I understand, if you put them in a ListView it will recycle the views as you scroll. Load the images then rather than all at the start.
|
# ? Feb 7, 2014 10:33 |
|
Tunga posted:As far as I understand, if you put them in a ListView it will recycle the views as you scroll. Only the thumbnails shown and those right next to the shown should be loaded. So they should be loaded and removed dynamically. Do you think that would be the case?
|
# ? Feb 7, 2014 15:17 |
|
Tunga posted:As far as I understand, if you put them in a ListView it will recycle the views as you scroll. This is what ListView and Adapters are designed to do. They're a pain in the butt to work with, but they're effective for reducing memory consumption and loading jank in long lists of Views. They will organize caching and reloading of View content above and below what's currently displayed. Writing a ListView Adapter for your custom ViewGroup is probably the way to go.
|
# ? Feb 8, 2014 08:19 |
|
I have a newbie question (sorry). If I wanted to write a simple app that would work on both Android and iOS, do I create it on one platform (e.g. XCode on Mac) and then "rewrite" it for Java (as an example) or is there an application that would handle conversion "automatically". I know literally nothing about Android (and Java), so apologies if what I'm asking is retarded.
|
# ? Feb 14, 2014 20:23 |
|
There are cross-platform frameworks such as Xamarin but otherwise you have to rewrite it. Try use the appropriate UX patterns for each platform unless you hate your users.
|
# ? Feb 14, 2014 20:39 |
|
Unexpected posted:I have a newbie question (sorry). If I wanted to write a simple app that would work on both Android and iOS, do I create it on one platform (e.g. XCode on Mac) and then "rewrite" it for Java (as an example) or is there an application that would handle conversion "automatically". I know literally nothing about Android (and Java), so apologies if what I'm asking is retarded. Xamarin is the only environment with a realistic approach to writing native apps for each platform using the same language (without resorting to C/C++). The other environments typically offer you variations on a HTML/JS/CSS kind of environment, but it'll generally be very difficult even for moderately experienced developers to make a quality app that feels native on both. Having developed extensively for both Android and iOS. I can't recommend strongly enough that you should _not_ start on Android for a first platform if the choice is between Android and iOS. iOS is easier to get started on, more profitable, and more fun. Completely worth the price of admission.
|
# ? Feb 14, 2014 20:47 |
|
|
# ? May 11, 2024 10:42 |
|
As an android developer transitioning to iOS, I can't stress enough that each platform has it's own design patterns and idioms, and it's both easy and annoying for your users to spot a crappy port. If you can, write for each, not both.
|
# ? Feb 14, 2014 21:22 |