|
e: probably not the best thread for this; moved to general thread.
|
# ? Apr 7, 2015 10:35 |
|
|
# ? May 14, 2024 11:02 |
|
I'm trying to get twitter embedding working in Awful. I mostly just updated the SALR JavaScript that was split from the chrome version ages ago. Problem is, only half of it it works. The script looks for Twitter links, parses them and asks the twitter json api for information. These contain an embed code that I inject into Awful's thread view. This works, however it also contains a JavaScript link which styles the whole thing (by turning the div into an iframe IIRC). This never happens and I don't quite understand why. I have already updated the webview settings to allow universal file access where needed so I don't think that's it. Any ideas?
|
# ? Apr 29, 2015 09:03 |
|
Probably a stupid beginner's question, but: I'm trying to get two columns of data from the call log displayed, like (number) : (date) (number2) : (date2) ... etc. I thought a GridView with two columns would be the obvious thing to use, but I can't work out what to use as the 'to' parameter in SimpleCursorAdapter (Context context, int layout, Cursor c, String[] from, int[] to, int flags) quote:to : The views that should display column in the "from" parameter. These should all be TextViews. The first N views in this list are given the values of the first N columns in the from parameter. Can be null if the cursor is not available yet. I can get the id for the GridView but passing that just fills in all the cells with the phone number. Does each column have an id I can get? Or am I doing this completely wrong? Here's the relevant bit of what I've got at the moment: code:
|
# ? May 1, 2015 20:43 |
|
You're probably better off putting them in a RecyclerView with each item being made up of a custom view containing the two TextViews (or whatever they are). GridView is good for when you want to display a grid of items but don't know how many rows/columns you want (e.g. on different sized devices).
|
# ? May 1, 2015 23:23 |
|
Tunga posted:You're probably better off putting them in a RecyclerView with each item being made up of a custom view containing the two TextViews (or whatever they are). GridView is good for when you want to display a grid of items but don't know how many rows/columns you want (e.g. on different sized devices). Thanks. I'm going to have to do that at some point, but I've just realised that for now I can use 'android.R.layout.simple_list_item_2' to get what I wanted
|
# ? May 2, 2015 00:47 |
|
I'm developing an application that depends on a webservice that it is still undeployed and as such, it is only running on my local machine on localhost:5000. So far so good. In the chrome://inspect/#devices page, I can set up port forwarding (I set up 5000 to localhost:5000) and in Chrome it works quite well. The Devices page also warns that Chrome must remain open for the forwarding to work, but that's OK, I guess. The problem that I'm having is that when I switch out from Chrome to my application, the forwarding stops working and Chrome stops showing up on the Devices page on the host computer. My best guess is that Chrome must be always in the foreground if I need the forwarding to work, but then I can't test my application this way. Is there any way for that to work? Having Chrome open in the background is fine, but I can't test my application if it has to be open on the foreground. Of course, I can just deploy the webservice, but
|
# ? May 4, 2015 17:42 |
|
HardDisk posted:I'm developing an application that depends on a webservice that it is still undeployed and as such, it is only running on my local machine on localhost:5000. So far so good. adb forward lets you port forward if that's the bottleneck. Otherwise, run an emulator on your desktop if you can do the hardware acceleration and virtualization.
|
# ? May 5, 2015 02:00 |
|
HardDisk posted:Of course, I can just deploy the webservice, but ngrok makes it trivial to make a local development server publicly accessible.
|
# ? May 5, 2015 03:42 |
|
Volmarias posted:adb forward lets you port forward if that's the bottleneck. Otherwise, run an emulator on your desktop if you can do the hardware acceleration and virtualization. Thanks, didn't know about adb forward. Houston Rockets posted:ngrok makes it trivial to make a local development server publicly accessible. This sounds amazing as well. Thank you. Volmarias posted:judicious use of adb commands also allows neat stuff like wireless debugging Space Kablooey fucked around with this message at 19:02 on May 5, 2015 |
# ? May 5, 2015 13:30 |
|
HardDisk posted:Thanks, didn't know about adb forward. judicious use of adb commands also allows neat stuff like wireless debugging
|
# ? May 5, 2015 17:08 |
|
Volmarias posted:judicious use of adb commands also allows neat stuff like wireless debugging Just wanted to say that I tried this and For completeness sake, you have to first get the IP adress of your device, restart the adb daemon in network mode using adb tcip <PORT> and then connect to your device using adb connect <IP>:<PORT> and Android Studio should pick it up.
|
# ? May 10, 2015 15:59 |
|
Is there any on-device way to simulate a poo poo network? I know you can do this in the official emulator, but I want to do this on a real device. If it needs to be rooted, that's fine, my development device already is. I like how iOS has the Network Link Conditioner built into the phone. I'm almost about to just go buy a prepaid T-Mobile SIM and lock the phone to EDGE only.
|
# ? May 10, 2015 16:08 |
|
kitten smoothie posted:Is there any on-device way to simulate a poo poo network? I know you can do this in the official emulator, but I want to do this on a real device. If it needs to be rooted, that's fine, my development device already is. Facebook put out something recently to simulate awful network conditions with latency and packet loss, though I don't know how well it works.
|
# ? May 10, 2015 16:38 |
Can anyone tell me if the Android source build image system.img changes during runtime? I'm trying to calculate a CRC32 across the system.img located on my boards eMMC. But I'm getting differing results at build time running CRC32 across it and then after booting to my Android build I recalculate the CRC32 across the system.img and it ends up different. I dumped the system.img as a raw binary and diffed it against the build time image and a only a couple values differ. But I can't tell if either my runtime CRC32 program is incorrect or the eMMC is being corrupted. So is it expected that Android would change values or something in the system.img blob during bootup? Popete fucked around with this message at 07:09 on May 11, 2015 |
|
# ? May 11, 2015 07:06 |
|
My understanding is that OTAs now checksum the entire system image to verify that it isn't modified so it wouldn't make much sense if it could ever be modified by the system running. But I don't actually know that as a fact.
|
# ? May 11, 2015 08:47 |
|
Tunga posted:My understanding is that OTAs now checksum the entire system image to verify that it isn't modified so it wouldn't make much sense if it could ever be modified by the system running. But I don't actually know that as a fact. From looking at the OTA update scripts and the recovery source, it looks like it actually computes a SHA1 hash of the filesystem superblock, and validates that against a known value to say "hey you remounted this r/w, re-flash to update." Then before patching it also checks a combined hash of all the parts of the image it cares about patching, I imagine just to be sure. The new OTA scheme literally patches chunks of the block device rather than the filesystem. As I understand it the act of mounting the filesystem r/w will update the mount time in the superblock, which breaks the first hash. So even if you were to have restored the file structure of the system partition after modifying it, or you did nothing at all but mount the filesystem r/w once and then unmount it, the validation will fail. So we can then figure from this that the system partition shouldn't be different from boot to boot, or from device to device, unless it was mounted r/w on boot. kitten smoothie fucked around with this message at 17:10 on May 11, 2015 |
# ? May 11, 2015 17:05 |
|
Coming back to Android after spending a long time with Java on the server. I have an existing Java client for a REST API that uses Apache HttpComponents, is there any issue using this instead of okhttp/retrofit? Related question, is there a good place to stay up to date on Android libraries and design?
|
# ? May 12, 2015 23:23 |
|
more like dICK posted:Coming back to Android after spending a long time with Java on the server. I have an existing Java client for a REST API that uses Apache HttpComponents, is there any issue using this instead of okhttp/retrofit? Related question, is there a good place to stay up to date on Android libraries and design? The apache libraries were deprecated in Android a couple years ago and will not be maintained going forward. Use the new hotness libraries instead.
|
# ? May 13, 2015 04:59 |
|
Does anyone have a good idea for implementing something like this aside from a PopupWindow containing a Viewpager with 2 Fragments?
|
# ? May 13, 2015 17:52 |
|
Sereri posted:Does anyone have a good idea for implementing something like this aside from a PopupWindow containing a Viewpager with 2 Fragments? I vaguely remember there being a library for this, but it might have been even pre-HC, so a PopupWindow with a ViewPager and 2 Fragments (or 2 Views even) might be your best bet.
|
# ? May 15, 2015 03:53 |
|
That's what I feared. While I'm on it, is there a way to prevent my edittext from losing its selection when touching a menuitem in the action bar? Is it even suppose to do that? e: never mind, I just added an item to the theme that lets the contextual action bar overlap the actual toolbar. This way the button isn't visible now anyway. Sereri fucked around with this message at 15:20 on May 15, 2015 |
# ? May 15, 2015 15:11 |
|
I have what is probably an easy question, but I cannot find any answer: I want to install an app in Android Studio, onto a hardware device. Background info: 1) I am using Android Studio on Win7 x64 2) the app is already written and works as intended on both the ARM image (I have an AMD CPU) and a connected Android device--see #3 below (the project has a warning about a depreciated activity bar or something, but the app is just a joke thing for my own device so that's not real important) 3) the device is an Acer 7" B1-730HD tablet running Android 4.2.2 4) I can already TEST the app on the above tablet, so that much works properly. The ADB USB driver is installed, the device developer options is enabled, USB debugging is turned on and "install from unknown sources" is turned on. I want to install the app on the device now and apparently (?) there is a way, but I cannot find any pages that say how to do it with the current version of Android Studio. This page shows it on an Apple computer, but I cannot find ANY popup window that has the "Android Application Installer" option at all: https://wiki.appcelerator.org/display/guides2/Deploying+to+Android+devices What did this guy do to get that thing to show???? A lot of the pages claiming to show how to do this are using Eclipse, which isn't helpful. Most other pages claiming to show how to do this using Android Studio are incorrect: they aren't explaining how to INSTALL the app, they are only explaining how to test-run the app on the connected device--and I'm already past that part. Is there any up-to-date page that explains how to do this?
|
# ? May 15, 2015 23:48 |
|
When you run it it gets installed, that's probably why you're having trouble finding anything! If it's not showing up in your launcher, you'll probably need to add this to your manifest: http://developer.android.com/training/basics/activity-lifecycle/starting.html#launching-activity XML code:
|
# ? May 16, 2015 00:10 |
|
baka kaba posted:When you run it it gets installed, that's probably why you're having trouble finding anything! ... Other people asking this question always get referred to this page: http://developer.android.com/tools/device.html but that page doesn't mention that the app gets installed upon running it on the device.... I never had any android device before a couple days ago, and so a lot of aspects seem,,,,, odd. Like, why is there no file explorer program on there?.... Or is there? (I know you can get file explorer apps, but it would seem to be a necessary thing to have anyway, so why is one not already there?) When you connect it to the PC it is detected as a USB storage device and you can put files on it that way, but then [apparently] Android can't do anything with them. I don't get the reasoning here --- ????:>| I did notice however that all of the apps it came pre-loaded with, were 'cloud' stuff. As in, NOTHING you do gets stored on the tablet. You have to open an account with whatever-website the thing works with, and all your sh*t gets stored online somewhere.
|
# ? May 16, 2015 02:40 |
|
Welcome to mobile in 2015, mobile operating systems try to obscure the concept of files away and represent things as objects and activities. A document in an app is just that, and the user isn't meant to know or care about anything lower level than that. Apps can provide documents and content to other apps through defined interfaces but the concept of a file lying around somewhere named blahblah.doc doesn't surface. Personally I agree with the idea, if you've got to open an actual filesystem browser on a phone then something has gone horribly wrong.
|
# ? May 16, 2015 02:54 |
|
edmund745 posted:Yea it did install it. It just has a generic icon (I didn't provide any icon). And the page doesn't say it installed it. There's no concept of an installer vs a standalone binary such as in the Windows or OS X world; everything is packaged into your application, which you install via telling the device's package manager to install it (which you do via clicking "run" in Android Studio, or by clicking "install" in the Play store, etc). When you're "test-running" the app, you're installing it, or re-installing it if it was already installed. I'm not quite sure what you mean by "Android can't do anything with them." Android definitely can do something with them, but in the mobile world the concept of file browsers is somewhat archaic; applications know what files they need to know about and run them. Android, in particular, handles this design by having applications specify what kind of files they handle via intent filters (see the data tag you put in the intent-filter tags). A calling application will "open" a file by creating an Intent with a VIEW action (or whatever action is most appropriate) and the file as a uri. If you've installed a file browser application, attempting to open files will do exactly this. Additionally, content is registered with the MediaStore (either explicitly or passively), which exposes it to other applications who can find it by querying the MediaStore for content (Music, Photos, etc). This is how the Gallery apps work; they don't scan your filesystem, they're vended a ContentProvider with a list of image uris to display to the user. As far as things being stored online, well, it really just depends on the apps. Your camera stores its photos/videos locally. You can/should download your music and store it locally. If you install Kindle, Audible, etc, that content gets downloaded. But, we are in general moving towards a world that lives more and more online. Mobile just happens to be the leading edge here.
|
# ? May 16, 2015 03:17 |
|
edmund745 posted:Yea it did install it. It just has a generic icon (I didn't provide any icon). And the page doesn't say it installed it. For the love of God, don't rely on USB storage for messing with files if you're doing development. It uses something called MTP, which is basically the worst. You have to mess around with the media store and folders show up as empty files and it's awful. Use some kind of file explorer - I just use Airdroid because that's fine for me As far as I'm aware you need to root your device to get full filesystem access in the development environment - emulators have it by default, but it's a security measure on real devices. There's a kind of explorer in DDMS if you want to take a look (if you're using Android Studio, it's in the Tools>Android menu - I forget the name, Android Device Monitor maybe) If you're new to Android... well it depends what you're up to. If you're just going to be a user then you don't need to worry too much about how it all works, the general idea is that anything you download gets handled by the apps that know what it is. So say you have a video file, if you open it (maybe from the Downloads app) then you'll get a list of everything that can handle that type of file, and you can set a default if you like. And if you open a video player app, it should show you all the videos you have on the device. The idea is that you don't need to worry about where things are or exactly what they are. It's a bit weird if you're coming from desktop computers, but you'll get used to it If you're actually doing any development... there's a lot to learn! You need to understand a lot of the mechanics of the operating system to make things happen - and the average person doesn't need to know or worry about any of this at all. If you just want to get an icon set up for your app, that's cool
|
# ? May 16, 2015 04:03 |
|
Do you guys know of any good lightweight libraries for representing information as a graph? I really only need bare minimum functionality, like plotting a few data points on simple line and bar graphs. I also only need to be able to generate a static depiction of the information, as in it won't change while the graph is being displayed, and there will be no animation.
|
# ? May 19, 2015 01:40 |
|
Fergus Mac Roich posted:Do you guys know of any good lightweight libraries for representing information as a graph? I really only need bare minimum functionality, like plotting a few data points on simple line and bar graphs. I also only need to be able to generate a static depiction of the information, as in it won't change while the graph is being displayed, and there will be no animation. http://androidplot.com/
|
# ? May 19, 2015 06:17 |
|
Fergus Mac Roich posted:Do you guys know of any good lightweight libraries for representing information as a graph? I really only need bare minimum functionality, like plotting a few data points on simple line and bar graphs. I also only need to be able to generate a static depiction of the information, as in it won't change while the graph is being displayed, and there will be no animation. I'm using AChartEngine in an old app of mine, but MPAndroidChart is impressively pretty and I should switch someday.
|
# ? May 19, 2015 18:27 |
|
I got my idiot game thing working, sort of. As far as I've gotten into it anyway.... One question: I keep getting errors in the Android Studio editor because I get capitalizations wrong in the Java language. ,,, Like for example, trying to use "If" instead of 'if' in an if-else statement,,, and then spending five minutes trying to figure out why it says "this 'else' statement requires an if statement" Is there any setting to get it to autocorrect capitalization errors for Java-language keywords? It tries to warn me about spelling errors in my chosen variable names, but it is ignoring the keyword capitalizations and just flagging them as an error. I looked around in the editor/default settings/java options but didn't see anything as simple as this. :| (I did google this matter but there is fifty million page results about people trying to get the auto-capitalization on their Android devices either turned on or turned off,,, so I could not find anything relevant)
|
# ? May 26, 2015 23:10 |
|
I haven't seen anything like that in Android Studio(or other IDEs that I've used). The thing is that while extremely dismaying, it's technically legal Java to call a variable, say, "If" or "Class". I don't know if that's the real answer, just conjecture.
|
# ? May 27, 2015 01:08 |
|
Fergus Mac Roich posted:I haven't seen anything like that in Android Studio(or other IDEs that I've used). The thing is that while extremely dismaying, it's technically legal Java to call a variable, say, "If" or "Class". I don't know if that's the real answer, just conjecture. This is it. Java is case sensitive and most IDEs aren't going to bother precompiling the code far enough to see that you're using an identifier in a position where only an operator is valid.
|
# ? May 27, 2015 01:49 |
|
edmund745 posted:I got my idiot game thing working, sort of. As far as I've gotten into it anyway.... This is probably a "tough cookies" kind of situation. The general rule of thumb is that language syntax is always lowercase, classes are CamelCase (first letter uppercase), and methods are camelCase (first letter lowercase). After a little while, you'll get used to the expected syntax and this will cease to be a problem. You should be getting a nice red squiggly under your if statement's line, so look there. There's the Oracle and Google (and Android!) style guides, which you can try following to keep the rest of your code consistent.
|
# ? May 27, 2015 02:05 |
|
You might want to look at some different editor themes too. If you have subtle underline colours or keywords that don't stick out as keywords, it'll be harder to notice when you make a mistake - any help you can get, y'know? You can use any of these: http://www.ideacolorthemes.org/home/
|
# ? May 27, 2015 03:51 |
|
Design support library, with things like FAB, snackbar, etc. Thank loving god.
|
# ? May 29, 2015 01:52 |
|
kitten smoothie posted:Design support library, with things like FAB, snackbar, etc. Thank loving god. Plus a rewrite of the layout editor to help simplify working with gigantic xml files.
|
# ? May 29, 2015 05:27 |
|
Data binding looks really interesting: https://developer.android.com/tools/data-binding/guide.html
|
# ? May 29, 2015 12:33 |
|
Here's a demo of all the design support library hotness. https://github.com/chrisbanes/cheesesquare/ Also, there's a bug with the FAB as shipped in the support library. Looks like you need to set app:borderWidth="0dp" if you don't want your poo poo to break on some devices. The bug is evident even in the demo I linked - on lollipop the FAB's elevation doesn't render right. kitten smoothie fucked around with this message at 18:11 on May 29, 2015 |
# ? May 29, 2015 18:08 |
|
|
# ? May 14, 2024 11:02 |
|
I have a standard listview and a "+" button that goes to a NewItemActivity in which the user enters the name of the new item and presses a "Done" button to create a new item. That works fine. Instead of this I want a new item to appear when the user presses the "+" button without leaving the listview, and the user to be able to edit the title of the item in place. What's the best way to go on about implementing this? Are there any good tutorials for it?
|
# ? Jun 1, 2015 01:49 |