|
What is the least-ugly way of writing SQL for Android in Eclipse? Right now I'm putting each statement one-per-line in my strings.xml file like this:XML code:
(code stolen from here)
|
# ¿ Jun 25, 2012 20:29 |
|
|
# ¿ May 3, 2024 01:06 |
|
Doctor w-rw-rw- posted:You could put your .sql files in the assets directory and write a class to load your SQL from that. Does this involve writing like, half of a SQL lexical scanner? In the book I'm reading, the methods used to pass statements to SQLite (e.g. execSQL(String sql)) accept one statement at a time, so since I want to write .sql files with nice indentation and whitespace it seems I'd need to have a more complex tokenization process than my current scheme of String.split("\n").
|
# ¿ Jun 27, 2012 18:27 |
|
Zaldron posted:Hi, I'm a newbie Android developer doing a project for college. It's coming along pretty nicely, except for the fact that it looks completely uninteresting. Could someone point me to some resources/guides/whatever I could use as a crash course on styling my text based Android 2.3 application? There is a design section in the official docs, though I'm not sure if that's what you're looking for. I'm a newbie too and the Metrics and Grids page was enlightening, e.g.:
|
# ¿ Jul 23, 2012 20:28 |
|
mugrim posted:I did some VERY minor programming in high school (C++ class for like a year), would it be absolutely insane to try and learn how to make an Android App? It depends on how complicated an app you want to make, and how much time and effort you're willing to invest. Do you want to make a 3D real-time game, and you've never studied higher-level math? Then you'll probably have a tough time. Do you want to make a fart noise app? Sure, go hog wild.
|
# ¿ Jul 27, 2012 21:53 |
|
Zero The Hero posted:Hey guys, looking for some advice here. I'm trying to do some type of persistent data storage in my app, [...] all I have is a LinearLayout with a series of CheckBoxes. I just need an efficient way to save the data, which is the only way a checklist is ever going to be useful. SQLite, man.
|
# ¿ Aug 15, 2012 01:42 |
|
Saying "I hate Obj-C and Java, but I like C#" is either really dumb or really incomplete. Dumb if you're referring to syntax itself, given their similarities; incomplete if you're really talking about standard libraries, runtimes, or other things.
|
# ¿ Sep 26, 2012 06:44 |
|
I'm working on this free "learn android coding" class and I cannot bring myself to copy/paste the example code they gave me for this one lesson. I know, it's just example code for a tutorial app and who gives a poo poo, but I can't bring myself to do it. The lesson is "make your CursorLoader more efficient by using database projections!" Here is the diff for the example code but the relevant bit is this: Java code:
|
# ¿ Nov 22, 2016 04:25 |
|
nah the example app does use relations, and the SQLite/ContentProvider stuff is just in there to teach you it. also i know sql and relational algebra anyway so that part of it was EZ to learn basically my question was just like "i'm sure there is a data structure class in the java standard library somewhere that basically solves this" but i'm still just grossing out that someone would suggest that gross brittle crap
|
# ¿ Nov 22, 2016 04:51 |
|
Splinter posted:Where is the proper place to store API keys? Right now I just have it in the app code, but that means it'll be publicly viewable if I ever put the project on github, and also had the thought that it might be possible to decompile the APK to grab it. For my spare time teach-yourself-Android projects, I keep Web service APIs in a separate XML resource file, and I put that filename in a .gitignore
|
# ¿ Mar 29, 2017 20:57 |
|
kitten smoothie posted:A slightly cleaner (at least because you're not ignoring an XML deep into your code tree) is to lean on Gradle tooling to do this. Edit your gradle.properties (which you .gitignore) The only differences I see between this way and mine is that (1) I'm ignoring a different file and (2) the string reference in the code will be named a bit differently. Is it really considered "less clean" to ignore /app/src/main/res/values/totallysecret.xml versus doing the Gradle thing? My way still gives me fields to use in my code, the only difference is that instead of your BuildConfig.SECRETSQUIRREL I put on my robe and R.string.SECRETSQUIRREL hat.
|
# ¿ Mar 30, 2017 03:17 |
|
are you familiar with the relational algebra
|
# ¿ Apr 12, 2017 03:23 |
|
relational algebra is the mathematical framework from which SQL is derived, yeah to be honest, you being stumped on how to create features such as "have more than one tag per image" and "be notified when an image is deleted" leads me to suspect that you don't really have the most robust knowledge of relational data models. i apologize if that sounds pretty blunt but i say it in the hopes that it might save you a lot of banging your head against the wall. having a relationship such as "one image can have zero or more tags" is what you will find described in the literature as a "one to many" relationship, and it's one of the basic building blocks that a person is almost required to know in order to create a successful and well-functioning SQL database. my advice for you is to go read more about relational databases, and more specifically the topics of: data modeling, keys, triggers, and updates/deletes (specifically: updates and deletes that "cascade").
|
# ¿ May 2, 2017 00:48 |
|
american watches default to hands at 10 and 2. french watches default to pencil-thin hands at 4 and 8 with an eyeroll complication. this might be your problem joke answer
|
# ¿ May 2, 2017 23:11 |
|
so it's just a different syntax? if so, lol @ u nerds spurtin about it
|
# ¿ May 18, 2017 05:44 |
|
Mezzanine posted:I think it's worth it just for the "import kotlinx.android.synthetic.main.activity_foo.* " thing that handles all of the "private TextView mTextFoo;" and "mTextFoo = (TextView) findViewById(R.id.textFoo);" boilerplate with just one import line for the entire layout. if you want to win people over, maybe don't mention the fact that you're a fan of wildcard imports
|
# ¿ May 31, 2017 00:37 |
|
i honestly don't know how to respond to either of those posts. one of them implies that the poster only uses 1970s text editors without any kind of IDE functionality. the other implies the poster doesn't understand the basics of predicate logic. both of them defend wildcard imports. i'm really out of my depth in a situation where people are that ignorant and yet are insistent that their ignorance is correct and valid
|
# ¿ May 31, 2017 02:39 |
|
Shadow0 posted:I'm try to make popup calendars to select a day+month+year or to select a month+year or to select a year, so I looked at the Picker class, which then directed me to the DatePickerDialog. are those the only date-picking classes in the whole android api? DatePickerDialog and DatePicker are from API level 1. i don't know much at all about this area of the API but there have definitely been some date/time pickers added over the years. for example, the clock-face time picker used in the AOSP Clock app was added (i think) sometime in the android 4.x-6.x range
|
# ¿ Jan 17, 2019 04:46 |
|
Does that mean it is possible to provide what OP is asking for simply through layout/style?
|
# ¿ Jan 17, 2019 05:56 |
|
code:
|
# ¿ May 3, 2019 22:54 |
|
i was hoping i'd be able to pick it apart just by skimming, but i haven't been doing any android programming for months so i don't remember any tips and tricks when it comes to the process lifecycle. you can tell i'm really good at android programming because i didn't notice a pretty obvious "oh this must be related to stuff they stripped out of the post" bit of code
|
# ¿ May 3, 2019 23:23 |
|
brand engager posted:Been working on a bug at work where a ContentProvider is dying or not being started up or something. The app is split into multiple processes so it's probably some awful concurrency bullshit. I think we also have parts of the code that just get the database itself and then interact with it which might be a nono. Anyone got some dos+don'ts for working with these that arent in the official ContentProvider guide? What do you mean by "multiple processes"? A lot of commonly-used stuff in the standard Android API uses multithreading. The UI of your app (if it has one) is on a separate thread, AsyncTask calls use a background thread, etc. Is that what you're talking about?
|
# ¿ May 21, 2019 02:05 |
|
Volguus posted:On the other hand, let's look at what help can we get when we're stuck: are you trolling or are you really this dumb
|
# ¿ May 21, 2019 21:19 |
|
Volguus posted:While I'm sure that you are a very popular and persuasive developer, you are underestimating the power of the google behemoth: Lutha Mahtin posted:are you trolling or are you really this dumb
|
# ¿ May 22, 2019 06:14 |
|
SQLite has auto increment row keys but I believe these are generated per table. It sounds like OP might be having an issue where they are spawning notifications and need something more unique than "oh this came from row 35" when the user taps on the notification to launch the app?
|
# ¿ Aug 27, 2019 01:07 |
|
Some classes in the Android standard library (e.g. CursorAdapter) always require inclusion of the standard SQLite "_id" row, but I don't know if that would ever matter in the case of tables also having an indexed UUID column.
|
# ¿ Aug 27, 2019 01:39 |
|
one potential pitfall i can think of, for generating UUIDs on client devices locally, is that proper random number generation is an area that a lot of hardware and software makers tend to screw up. it sounds like it wouldn't be the most critical failure in your case, compared to e.g. implementing cryptography, but with the sheer number of cut-rate android devices out there, it might be something worth keeping an eye out for
|
# ¿ Aug 27, 2019 16:22 |
|
netcat posted:Does anyone know how to get the boot animation to display in landscape mode rather than portrait (for an AOSP build, Android 9)? can you just... rotate the image?
|
# ¿ Sep 6, 2019 20:18 |
|
Anne Bonny posted:edit: Apparently my initial release was compatible with 0 devices. I've just submitted a new version which should show up soon. welcome to android development, chief
|
# ¿ Sep 17, 2019 21:59 |
|
|
# ¿ May 3, 2024 01:06 |
|
Is this honestly the first time that all of you geniuses are hearing about Android app stores other than Google Play? I don't know if I'd trust Android dev advice from anyone who isn't aware of that, holy crap
|
# ¿ Oct 5, 2019 01:32 |