|
I'm trying to figure out if I'm going to run into problems down the road in my app. In my app I have a class called ServerListManager. Basically its just a global dispatch class that keeps a list of server sockets synced across the app. When a socket changes state or a user adds/removes a server from the "paired" list, the Manager will remove or update the Socket/IP from the SharedPreference file and dispatch an event to all registered listeners. Because I've built this pretty much waterfall style and have no test bed in place to test out the networking , I'm not sure what will happen when sockets start changing state. In particular I recently realized that I couldn't just create a thread and fire off an event that would update my ListAdapter (Can't edit views from threads outside the UI thread). From the user side, such as when the user adds/removes an IP from the list, the Adapter will trigger an update event which passes along a Context that I can cast back to an Activity (I pass around getActivity() as the context). The networking side however is tied to a service which spawns a new thread and passes the Service into the thread as the Context. Am I understanding the docs right and that I'm still okay since Services exists inside the main app's thread? Or will I get casting exceptions or some other exception when the network thread tries to cast the Service's context/activity and call runOnUiThread()? Hope that makes sense.
|
# ? May 14, 2014 09:22 |
|
|
# ? May 28, 2024 14:49 |
|
kitten smoothie posted:In Results' onCreate method: I have a custom adapter setup because I have a defined row layout (Therefore I have a listview and a row xml file) I am using a (probably lovely) adapter called LazyAdapter from a tutorial site just so I can get a hang of using an adapter. If I got my resource IDs correct, the adapter should just take in ArrayList<HashMap<string, string>> right? Relevant code, including my views: https://gist.github.com/verkaufer/578af362176847e29970 Googling for transferring an ArrayList<HashMap<>> data type into a ListView has been fruitless so far. If there's a tutorial I'm overlooking (and I've looked at Vogella), please direct me to it.
|
# ? May 14, 2014 19:53 |
|
Fluue posted:I have a custom adapter setup because I have a defined row layout (Therefore I have a listview and a row xml file) Here's how I setup a ListView for an app of mine (snipped for relevant parts): Java code:
Evil_Greven fucked around with this message at 21:47 on May 14, 2014 |
# ? May 14, 2014 21:41 |
|
Evil_Greven posted:Here's how I setup a ListView for an app of mine (snipped for relevant parts):
|
# ? May 14, 2014 21:55 |
|
Fluue posted:So you're skipping a custom implementation and just using ArrayAdapter? You're going about getting the list reference the wrong way, or at least atypically. As far as I'm aware the typical use is: 1) you need to make your activity extend ListActivity rather than Activity; I missed this on your code before. 2) you are limited to one list, called (as previously) "@android:id/list" in the layout XML. 3) you can then use setListAdapter(adapter); to... yeah. Try changing just these bits of your activity first, rather than your custom adapter. e: Of course, before that, you should fix what kitten smoothie mentioned if you haven't: R.layout.list_generated_pokemon points to your layout file R.id.list_row is the list itself Evil_Greven fucked around with this message at 22:51 on May 14, 2014 |
# ? May 14, 2014 22:46 |
|
Evil_Greven posted:In that example, yeah - it's just a line of text for the Quake summary; I don't need a custom implementation for that. What you're doing is more advanced than that - but that's beside the point. There's little reason to extend ListActivity, all it does is grab a reference to the listview and provide helpers for adapter functions. Everything it does can be replicated with a simple findViewById and setting the adapter directly. ListView itself is pretty simple, and ListActivity only automates the easiest part. The real annoying complexity is in the adapter, and doubly so if you want multiple item types and ViewHolders for more efficient recycling. I ended up creating a custom adapter that handled most of that annoying stuff automatically, but it still requires a little work defining item layouts and functionality.
|
# ? May 14, 2014 22:56 |
|
I'm working on an app right now, and I'm often switching between identical development environments on my desktop and my laptop depending on when and where I want to work. Is it possible to use a single certificate on both machines to sign debug builds so that I don't have to always uninstall/reinstall my app when the certs don't match?
|
# ? May 15, 2014 18:26 |
|
If you are using gradle, just use your release key to sign the debug build. Then you'll never get the inconsistent signing error.code:
|
# ? May 15, 2014 18:30 |
|
Karthe posted:Is it possible to use a single certificate on both machines to sign debug builds so that I don't have to always uninstall/reinstall my app when the certs don't match? Yep! efb;
|
# ? May 15, 2014 18:32 |
|
So my app got suspended from the market after submitting it. It's apparently because of Impersonation and Intellectual Property infringement (for Pokemon). When I look up "Pokemon" in the Play Store I get at least 20 other apps that use the Pokeball, the name, or a combination of both. I am definitely not trying to pass off my app as official.. so what's Google's beef? Has anyone had success appealing an app suspension?
|
# ? May 17, 2014 21:23 |
|
From the stories out there on the blogs, appeal requests are nearly immediately denied, and resubmitting the app will be another strike against you. Three strikes and you are banned for life from the store. They warn you not to create additional Google accounts and resubmit because those are subject to banning on sight. With the kind of data they have, they probably have lots of analysis procedures for identifying accounts held by the same person.
|
# ? May 17, 2014 21:48 |
|
Fluue posted:When I look up "Pokemon" in the Play Store I get at least 20 other apps that use the Pokeball, the name, or a combination of both. I am definitely not trying to pass off my app as official.. so what's Google's beef?
|
# ? May 18, 2014 01:00 |
|
kitten smoothie posted:Three strikes and you are banned for life from the store. According to what I've read this does not only apply to the developer side but they'll ban your entire Google account (mail, g+, play store purchases, etc). For life.
|
# ? May 18, 2014 09:38 |
|
Tunga posted:What, exactly, does your app do? It allows users to generate/display a team of 6 Pokémon. It's basically just an information app.. There are other Pokémon apps that have way more information and do more than mine. I'm not sure why it got banned. It's basically an app implementation of this: http://wyncorporation.com/pokemon Fluue fucked around with this message at 19:22 on May 18, 2014 |
# ? May 18, 2014 18:48 |
|
I have a WebView with a WebChromeClient. When testing on a 4.2.2 or 4.3 device the WebChromeClient's onShowCustomView is invoked, when something wants to go full screen. However with 4.4.2 (devices Nexus 7 and Galaxy S4) it has worked with HTML 5 videos, but flash videos wanting to go full screen does not invoke onShowCustomView. I haven't been able to find confirmation that there is a problem or a change somewhere between 4.3 and 4.4.2. Anybody here who knows what's up?
|
# ? May 21, 2014 15:26 |
|
Jarl posted:I have a WebView with a WebChromeClient. When testing on a 4.2.2 or 4.3 device the WebChromeClient's onShowCustomView is invoked, when something wants to go full screen. However with 4.4.2 (devices Nexus 7 and Galaxy S4) it has worked with HTML 5 videos, but flash videos wanting to go full screen does not invoke onShowCustomView. WebView is backed by Chrome in Android 4.4+: http://developer.android.com/guide/webapps/migrating.html
|
# ? May 24, 2014 05:50 |
|
Is there a guide for how to architect an Android application? I've seen people have one activity that controls many fragments, one activity for each fragment, and probably variations of both. What is the "right" behavior? How do fragments communicate with each other? I can't find one set answer on what to do. Sadly Android doesn't easily conform to MVC
|
# ? May 24, 2014 20:08 |
|
scanlonman posted:Is there a guide for how to architect an Android application? I've seen people have one activity that controls many fragments, one activity for each fragment, and probably variations of both. What is the "right" behavior? How do fragments communicate with each other? For fragment communication, the way that is "anointed" is to pass interfaces around between fragments. Problem with that is that you've adopted the overhead of maintaining an interface from the outset, possibly before you even know what you're building. So I used to use (it's been a loooong time since I did Android) a weak reference to the owning activity instead, and call methods as necessary. Other tips - * Don't stack fragments if fragment state is important. Back-stack state restoration is unreliable (did they ever fix this?) * When creating and launching a new activity, it's pretty convenient to stick the info you used to launch the activity in the intent. It's immutable and if your activity's state gets reset, it still has access to the intent used to make it and can reconstruct its original state pretty easily. * If you're dealing with video views inside fragments, HERE BE DRAGONS. Video views have a lifecycle of their own. Dealing with activity and fragment lifecycles on top of that is scary.
|
# ? May 24, 2014 20:57 |
|
How crazy am I for wanting to try and make a mobile game without using a game library? As in, I just use regular Android like with any other non-game app. I want to make a simple turn-based game, and while most games use Unity or the like, it seems a bit overkill for something as basic as what I have in mind. Should I just quit bitching and learn to Unity?
|
# ? May 25, 2014 04:56 |
|
Karthe posted:How crazy am I for wanting to try and make a mobile game without using a game library?
|
# ? May 25, 2014 10:26 |
|
Karthe posted:How crazy am I for wanting to try and make a mobile game without using a game library? As in, I just use regular Android like with any other non-game app. I want to make a simple turn-based game, and while most games use Unity or the like, it seems a bit overkill for something as basic as what I have in mind. If you're going to make a simple game engine and you can represent your game state in standard views, not crazy at all. That said, you may well decide to at a minimum make your own surfaceview implementation, which lends itself towards you writing at least a minimal engine.
|
# ? May 25, 2014 18:00 |
|
In my app I would like to have some backup functionality. So I was thinking of exporting/importing the SQLite database file. However, so far I have managed to keep my app clean of any permissions and if possible would like to keep it this way. Is there a way to delegate this somehow through an Intent to a file manager or something what you can do with the camera and mail sending? Claeaus fucked around with this message at 20:59 on Jun 6, 2014 |
# ? Jun 6, 2014 20:55 |
|
You can write to internal storage with no permissions. I would just write a complete db dump as a csv every once in a while. You can always access the files you create from within your own app. http://developer.android.com/training/basics/data-storage/files.html You will have to do some extra stuff if you want to attach it to an email or something. https://developer.android.com/training/secure-file-sharing/share-file.html
|
# ? Jun 6, 2014 23:33 |
|
Infomaniac posted:You can write to internal storage with no permissions. I would just write a complete db dump as a csv every once in a while. You can always access the files you create from within your own app. Ah great! Also it seems that reading from external storage doesn't require any permissions for versions prior to 4.4. So I'm guessing with some fiddling around it should be possible. Thanks!
|
# ? Jun 7, 2014 07:38 |
|
Is there a way to disable the "swipe to bring up system bars" functionality in Kit-Kat's Immersive Mode? I'm trying to figure out some way of locking users into an app (a la "kiosk mode") without requiring root. Ideally I could enable Immersive Mode and then ignore the swipes down from the top or up from the bottom, but there doesn't appear to be an easy way to detect that (probably by design). Edit: Nevermind, according to Roman Nurik it looks like the app isn't notified when those actions are performed. IAmKale fucked around with this message at 19:32 on Jun 8, 2014 |
# ? Jun 8, 2014 19:25 |
|
How does Chrome implement full-screen scrolling? That is how does it animate the action bar to hide along with the finger? I have made my own implementation that consists of putting action bar into overlay mode and then capturing y-delta of pixels that a list scrolls by. This seems to work well as the list doesn't have to be re-laid out, but I am wondering if there is a widget created for this or some other standard way.
|
# ? Jun 8, 2014 22:59 |
|
I have an idea for an app that I want to start developing, but it will definitely require server component because it involves sharing data between multiple users and those users being able to send each other notifications and such. I'm very comfortable with Java and I've got a enough practice at SQL for the purposes of this app. What I've never done, however, is any programming involving client-server communication. If anyone can point me at some resources or tutorials to get me started at figuring that bit out, I'd be grateful. My two big questions are: * Without paying for hosting, how do I go about setting up some kind of server to code on and test against? For the purposes of development I think a server either running virtually on my PC or on a headless box on my home network would be fine, but I don't really know where to start in getting that set up. * Where can I go to get more information about communication between Android apps and a remote server?
|
# ? Jun 11, 2014 02:30 |
|
Android has HTTP client that you can use, so look up tutorials on that. HTTP is what you most likely what to use, but if not you can also directly use sockets and that would be standard Java.
|
# ? Jun 11, 2014 05:40 |
|
I'm trying to write a .sh script which will install an app. When i run the command "pm install *name of apk*.apk, it works fine. When I put that same line in a script, I get "failed: INVALID_URI", thats not the exact phrasing but something similar. Ive googled the poo poo out of that error and seen tons of questions and only a few answers, all of which say its some fundamental rom issue and to reflash the rom. That sounds crazy and not probable. Yes im doing this all in root. Ive tried changing permissions on all kinds of folders "/system, /data, /data/local, ect) and no dice. Anyone have any experience which what Im trying to do? How do you install an apk from a script (not just terminal emulator)?
|
# ? Jun 11, 2014 15:32 |
|
Gozinbulx posted:I'm trying to write a .sh script which will install an app. When i run the command "pm install *name of apk*.apk, it works fine. When I put that same line in a script, I get "failed: INVALID_URI", thats not the exact phrasing but something similar. Ive googled the poo poo out of that error and seen tons of questions and only a few answers, all of which say its some fundamental rom issue and to reflash the rom. That sounds crazy and not probable. Yes im doing this all in root. Ive tried changing permissions on all kinds of folders "/system, /data, /data/local, ect) and no dice. Is the script running in the same directory as the apk? If not, you need to give the entire \path\to\the.apk in the script.
|
# ? Jun 11, 2014 15:39 |
|
LeftistMuslimObama posted:Is the script running in the same directory as the apk? If not, you need to give the entire \path\to\the.apk in the script. It is not, and I do indeed give the whole /path/to/apk.apk Is this appropriate syntax? : pm install /sdcard/temp/folder/target.apk
|
# ? Jun 11, 2014 17:30 |
|
Gozinbulx posted:It is not, and I do indeed give the whole /path/to/apk.apk I'd think that would work, but try maybe /mt/sdcard/.../target.apk, judging from this link http://www.all-things-android.com/content/understanding-android-file-hierarchy Also, does the script request elevated permissions at any point? I know on other flavors of *nix you'd need to sudo your install command.
|
# ? Jun 11, 2014 17:50 |
|
I believe it does. The way I execute the script is in Terminal emulator, cd'ing over to to the directory, giving a quick 'su' command (the phone is rooted) and then going './scriptname.sh' edit: Throwing an 'su' into the script just returns a [: not found, same for 'sudo'. Didn't think any of those would work but I just wanted to rule it out. Gozinbulx fucked around with this message at 18:02 on Jun 11, 2014 |
# ? Jun 11, 2014 17:59 |
|
So this thing is going on tomorrow, and I'm going back and forth on going. On the one hand, I'm certain I'd learn a lot, but on the other hand, it looks like they're expecting people good enough to create things quickly, and I'm nowhere near that adept at this stuff. Also, I have no loving clue what sort of functionality I'd like a watch or other wearable to have beyond just telling time, so even if i were knowledgeable enough to make something quickly, I wouldn't know what. My gut tells me to just go, and worst comes to worst, not participate as much as maybe the organizers would like, but I wanted to see if people who are maybe familiar with these sort of events would advise against that or not.
|
# ? Jun 11, 2014 18:17 |
|
Literally Elvis posted:So this thing is going on tomorrow, and I'm going back and forth on going. On the one hand, I'm certain I'd learn a lot, but on the other hand, it looks like they're expecting people good enough to create things quickly, and I'm nowhere near that adept at this stuff. Also, I have no loving clue what sort of functionality I'd like a watch or other wearable to have beyond just telling time, so even if i were knowledgeable enough to make something quickly, I wouldn't know what. They say you can collaborate with others, just go and at worst you can just jump in with someone else. These things aren't high pressure.
|
# ? Jun 11, 2014 18:35 |
|
LeftistMuslimObama posted:I have an idea for an app that I want to start developing, but it will definitely require server component because it involves sharing data between multiple users and those users being able to send each other notifications and such. I'm very comfortable with Java and I've got a enough practice at SQL for the purposes of this app. What I've never done, however, is any programming involving client-server communication. If anyone can point me at some resources or tutorials to get me started at figuring that bit out, I'd be grateful. My two big questions are: I would consider checking out some BaaS like CloudMine or Parse, then you can just use their APIs and not run a server yourself.
|
# ? Jun 11, 2014 23:19 |
|
Ranma posted:I would consider checking out some BaaS like CloudMine or Parse, then you can just use their APIs and not run a server yourself. Honestly, I think it would be fun to diy it, I'm just having trouble getting Google to cooperate with my attempts to find any guides to get started.
|
# ? Jun 12, 2014 00:51 |
|
LeftistMuslimObama posted:I have an idea for an app that I want to start developing, but it will definitely require server component because it involves sharing data between multiple users and those users being able to send each other notifications and such. I'm very comfortable with Java and I've got a enough practice at SQL for the purposes of this app. What I've never done, however, is any programming involving client-server communication. If anyone can point me at some resources or tutorials to get me started at figuring that bit out, I'd be grateful. My two big questions are: 1) Don't talk to your SQL directly from your Android app. Use a PHP (or some other equivalent) server-side interface. People can decrypt your .APK so... yeah. 2) Easiest way is probably through JSON and Apache HTTP calls. You'll need at least the Apache library installed (apache-mime4j-0.6.jar was what I used in this project). I built a system back for my final college project that consisted of a full (if rough) user registration and management system with file I/O via Web and Android app. That code is a bit ugly due to time issues and the fact that none of the other three assholes on my team did anything (between the 3 of them, maybe 5% of the coding), but here's a bit more cleaned up code for an app that reads and parses a simple webpage for a different project: code:
|
# ? Jun 12, 2014 01:32 |
|
Is there a site or book that has some good example projects to build up my Android skills? The Google tutorials definitely explain the api well, but the I feel like I need to do a few projects that build up the complexity so I can get a better feel for how it all fits together. I've always sucked at just making up projects for myself when I'm not programming something I actually need.
|
# ? Jun 12, 2014 23:53 |
|
|
# ? May 28, 2024 14:49 |
|
LeftistMuslimObama posted:Is there a site or book that has some good example projects to build up my Android skills? The Google tutorials definitely explain the api well, but the I feel like I need to do a few projects that build up the complexity so I can get a better feel for how it all fits together. I've always sucked at just making up projects for myself when I'm not programming something I actually need. The Big Nerd Ranch book seems pretty good, I think. http://www.bignerdranch.com/we-write/android-programming
|
# ? Jun 13, 2014 01:31 |