[Q] Info on Database programming on Android - General Questions and Answers

Ok, I'm trying to build my first app that interacts with a Database. Essentially I'm going to have a list of parts with a name, location, and serial number stored in a database. I would like to add, delete, and update rows. I tried following the Notepad example but I'm having trouble following. Not really understanding why and how they are using somethings. I have had database programing but its been a while and need a refresher. Anyone know where I could go to find more detail explanations of achieving my goal for this database?
Thank you in advance.
T.

TayOnG1 said:
Ok, I'm trying to build my first app that interacts with a Database. Essentially I'm going to have a list of parts with a name, location, and serial number stored in a database. I would like to add, delete, and update rows. I tried following the Notepad example but I'm having trouble following. Not really understanding why and how they are using somethings. I have had database programing but its been a while and need a refresher. Anyone know where I could go to find more detail explanations of achieving my goal for this database?
Thank you in advance.
T.
Click to expand...
Click to collapse
All major mobile O/S's include SQLite. You cann drive SQLite through C, Java or any scripting languages. You need to learn less than 10 SQL commands to survive. I bought a couple of books (recommend O'Reilly's Using SQLite), and now I get 95% of the commands correct first time.

Thank you I will check out that book.
Sent from my HTC Vision using XDA App

Related

[Q] Get a list of database names in code from android app?

Hello,
I would like to get a list of database names in code. I'm not looking for databases outside my application/package, just those in my /data/data/<my_package>/database folder.
I can easily locate them on the file system and open them using adb and sqlite3,
but I need to dynamically get a list of databases so that I can open and manage them in code.
I currently use a separate database to keep track of database names as they get created/deleted through my application, but I imagine there is a way to get a list of databases directly via SQL query or some sqlite library call.
Can anyone help me with this?
Thanks,
-dj
This should be in the "Android Development" forum.
BTW, I tried to post this question in a more topical "Android Development" forum, but I'm an XDA newb and don't have permissions to post in there.
Maybe these links can help you? I don't do much droid programming anymore and I never worked with databases in droid. Also welcome to XDA
http://www.devx.com/wireless/Article/40842
http://developer.android.com/reference/android/database/sqlite/package-summary.html
solution
The solution turned out to be very simple.
The main application context has a databaseList() function that, conveniently, returns a list of database names associated with the application.
String[] dbList = getApplicationContext().databaseList();
Thanks for the links dbzfanatic. devx looks like a good resource... it's going on my bookmark bar for sure.
Glad I could help and thanks for posting the solution for others who might have the same question. Since it's a string array I'm guessing the function just returns the DB names and not handles to them?
database names
dbzfanatic said:
Glad I could help and thanks for posting the solution for others who might have the same question. Since it's a string array I'm guessing the function just returns the DB names and not handles to them?
Click to expand...
Click to collapse
Correct, just a list of the database names.
I need a few more posts before I'm permitted to post a link, but this is the approximate reference link:
developer.android.com/reference/android/content/Context.html#databaseList()

Programming Java in Android

In my college courses i'm assigned to build a program to decode caeser cipher. I just finished and was thinking after I get done with other types of ciphers , that it would be cool to have an app that could do it for me. Easy way to send and receive text messages securely then copy and paste into my decoder. Not even ciq could uderstand your messages nor could anyone else unless they knew the shift pattern.(caeser) other various forms of ciphers could be available too.
I can program java fairly well( not expert) but i'm unsure on how to build Android programs. Anyone know any good websites that teach step by step on installing tools to compiling and decompiling and building libraries and all that jazz? Or anyone have any write ups that they have made and are willing to share?
Thanks guys.
Tim
Sent from my SAMSUNG-SGH-I727 using xda premium
Now I know there are cipher apps out there but my idea was to be able to long press on a text message and send to cipher app. And vice versa...after encoding a message send to text message instead of copy and paste. Not sure if that type of functionality needed to be baked into system files. Seems like it would.
Sent from my SAMSUNG-SGH-I727 using xda premium
developer.android.com/ (i dont have enough posts to link anywhere) has tutorials on basic building of apps. i believe the easiest way you would be able to do this would be by just using the interface builder. im not sure if you can have permission to add things to the context menu... i know you can set your app to receive SMSs or to read them by default. probably can send too. if you add a flag somewhere in the messages it sends to be interpreted by your app and use the SMS reading permission, you would be able to do it. those are my thoughts on it at least.
mrtim8383 said:
In my college courses i'm assigned to build a program to decode caeser cipher. I just finished and was thinking after I get done with other types of ciphers , that it would be cool to have an app that could do it for me. Easy way to send and receive text messages securely then copy and paste into my decoder. Not even ciq could uderstand your messages nor could anyone else unless they knew the shift pattern.(caeser) other various forms of ciphers could be available too.
I can program java fairly well( not expert) but i'm unsure on how to build Android programs. Anyone know any good websites that teach step by step on installing tools to compiling and decompiling and building libraries and all that jazz? Or anyone have any write ups that they have made and are willing to share?
Thanks guys.
Tim
Sent from my SAMSUNG-SGH-I727 using xda premium
Click to expand...
Click to collapse
Check here:
http://mitmobilelearning.org/
and here:
http://appinventoredu.mit.edu/blog
Hope these help.

[Q] Learn XML for android app development.

Hello XDA World,
I started learning how to develop android apps and when I read books about it I found that we need to know two languages to develop apps i.e. Java and XML. I am an expert in Java but a stranger to XML. My question is I want to begin learning XML from basics so that my concepts are as clear in developing apps as with java. I want suggestions from all of you. Please take your valuable time to suggest me.
Thank you.
Suggestions: don't spend too much time "learning" XML
Ishan16 said:
Hello XDA World,
I started learning how to develop android apps and when I read books about it I found that we need to know two languages to develop apps i.e. Java and XML. I am an expert in Java but a stranger to XML. My question is I want to begin learning XML from basics so that my concepts are as clear in developing apps as with java. I want suggestions from all of you. Please take your valuable time to suggest me.
Thank you.
Click to expand...
Click to collapse
Hello,
I'm not familiar with Android per se, but pretty familiar with XML, so here is my take.
XML is not really a language that you "need to know". It's a format to package data when you pass it around between applications. It's not a programming language. Realistically, you need to understand just enough XML to fulfill your app communication needs (unless you develop an app specializing in manipulating XML). Syntax-wise it's about as complicated as HTML, except there are no implied presentation rules. To have an introduction to XML, feel free to head over to a simple tutorial such as on w3schools and read however much is necessary for you to accomplish what you need to do, which probably is not much. (Sorry, I can't post links because I'm a new user.)
Last note, XML is becoming a bit of a second-tier data format lately, with JSON becoming more popular because of its compactness and native handling in JavaScript. The takeaway here is: make sure you actually need to use XML before spending too much time on it, and in particular don't go crazy into advanced stuff like CDATA or XPath which most likely you won't ever have to use.
Daniel
U dont need to use XML if u you know your Java you could use different ways to do that Like packing a database with it or online just to get the information you need!
Sent from my GT-I9001 using xda app-developers app
You're not going to be using XML as a language really. In android it is mostly just for layout design.
many of the things can also be set programatically, but you WILL be using XML. I'd suggest looking at android documentation, or loading up Eclipse (or other IDE) and dragging in some views and checking the actual XML used to get familiar. learn about stuff like TextView, Listview, Fragment usage etc.
you wont be using it for data transfers or anything complicated, it will mostly just be settings layout orientations and views and such.
and of course the manifest for permissions and defining activities.

[Q] Total NOOB needs some help :)

Hi all,
My name is Fabian, and I have a strong background in C. (Done a CS course in C).
I want to do an Android app for my final project(nothing too fancy or complicated but I have to at least have some interface ) and I'm a little stuck with how to proceed from here.
I watched the Java essential course on Lynda and I did understand a little the difference between C in Java, however I don't know how to proceed from here to actual Android development.
If anyone can recommend me finding a crash course, a book or any other resource that could get me up and running as soon as possible, I would really appreciate it.
I don't mind spending money on it.
Thanks in advance.
Fabian
fabiansc said:
Hi all,
My name is Fabian, and I have a strong background in C. (Done a CS course in C).
I want to do an Android app for my final project(nothing too fancy or complicated but I have to at least have some interface ) and I'm a little stuck with how to proceed from here.
I watched the Java essential course on Lynda and I did understand a little the difference between C in Java, however I don't know how to proceed from here to actual Android development.
If anyone can recommend me finding a crash course, a book or any other resource that could get me up and running as soon as possible, I would really appreciate it.
I don't mind spending money on it.
Thanks in advance.
Fabian
Click to expand...
Click to collapse
A great resource for Android development is the official Android training documentation from Google, as well as these tutorials. Let me know if you still have questions I'll be happy to help.
thanks little question regrading databases
shimp208 said:
A great resource for Android development is the official Android training documentation from Google, as well as these tutorials. Let me know if you still have questions I'll be happy to help.
Click to expand...
Click to collapse
Hi,
Thanks for your help I learned a lot and I'm already planning my app
I just have one question that could really help.
I want to make an app where people on different devices can interact and send each other tasks. I guess I need a kind of SQL server that supports Android, right? Is there a better or at least more economic way to do it if I will have around 1000 users where each one can add people to send tasks to?
Many thanks,
Fabian
And one more question
Is there any way to do a phone number authentication (like Whatsapp) instead of user name and password which I think is a little to tedious for my planned app ?
Thanks in advance
Hola, for the task sending. Would you like to make all task public? Or should you send it like a message?
But when i need access to a server, i use php scripts. But we can take that later, when you have answered my last question
For the phone number authentication, you have to have a online database, with all phone numbers. User inserts their phone number, the first time they starts the app. Then you can retrieve it from the database. But we can also take that later.
I´m glad if i helped.
(Sorry for my bad english.. )
Hola
Well I want it to be like a manager that gives a task to his employee. I want the task to be between them and only they can close it.
Likewise, it would be a problem if I make a simple phone number insertion if there's no validation. I was thinking about a number verification (like whatsapp) to prevent other people from accessing the tasks.
Do you think it's possible or should I go with username and password?
Thanks
fabiansc said:
Hi,
Thanks for your help I learned a lot and I'm already planning my app
I just have one question that could really help.
I want to make an app where people on different devices can interact and send each other tasks. I guess I need a kind of SQL server that supports Android, right? Is there a better or at least more economic way to do it if I will have around 1000 users where each one can add people to send tasks to?
Many thanks,
Fabian
Click to expand...
Click to collapse
I am using OpenShift - https://www.openshift.com/developers - which is a open source cloud architecture in that they offer packages like NodeJS and DB's. They allow you to have 'gears' which I guess is their name for services running on their cloud. The free account has 3 gears.
I currently only have a NodeJS server running to deliver files however (as far as I understand it) you can have MySQL and others as a backend. I would think that whatever devices you develop on would simply log into the DB and look up messages/tasks etc. I would also think that your app could insert those things. The best part is it is free until you reach Enterprise level or so. I would check it out since free is good. Offhand, I do not know what DB's Android supports via java but MySQL is probably one of them.
Just some info for you to examine.
Good luck
Hola, of course its possible! But maybe Username and Password is easiest.
You can use e-mail validation.
I actually worked on a application, there store products in databases. So i have tried it before. Ask if you are confused
And Sum1nil, sqlite is implemented in android, so for local database, use sqlite.
But for online database access, i use php

[Q] (CODING) Need help coding a simple, lightweight application

So, I need some help.
I want to develop a simple app for my Android phone that lets you input a text when accessing the phone's lockscreen, this text should then be saved in a log file containing not only the input text but also date and time of input registration. There should not be any way of avoiding the input either, entering no text and continueing should result in a log that only contains the date and time.
This should result in being able to check who accessed your device and when. For me this would be helpful. I'd then input a nickname for myself that nobody knows of and if someone tries entering the device using my real name, I'd know it wasn't me.
Now here is the problem, I haven't ever developed an application or anything of the sorts. My only experience in coding would be HTML. Does anybody feel like helping me out?
It's a complicated situation, so I'm not responding to the usual "Why don't you just do this or that". I want this specific method that works for me if at all possible.
Thank you for your consideration.
_Valkyr//
Anyone? ;-;
Sent from my GT-I9505 using XDA Free mobile app

Categories

Resources