How to write .graph file - android

I am new to GraphQL so please sorry if it is a stupid question but, how do I know how to write a .graphql file ? I refer at the content of the files:
I have the schema.json, but I don't know how exactly to compose my .graphql files, is there any tutorial on how to structure your query?
Thank you

.graphql file stores GraphQL independent query, because GraphQL syntax have import or similar construction. So you don't have ability to compose your queries from the box. As workaround you can use approach similar to prisma graphql-import. But it related to GraphQL server based on JS. I don't know a tool for client and android.
My recommendation is don't worry about query duplication right now. Create new query at graphiql or similar tool and put them to new .graphql. When you will have experience with GraphQL you can find your approach for composing queries.

Related

Android database synchronize with Dropbox SyncAPI

I would like to synchronize the database of an Android app with the new Dropbox SyncAPI.
I don't understand very well the tutorial on https://www.dropbox.com/developers/sync/tutorial/android,
and the example of the "Notes" is a little confusing for me. I can still log in to the platform with the API, and I know that I should use the database as a single file to be treated, obtaining its path.
My questions are: what are the main key points to do this (handler? listener to file?)?
Where can I find other examples to study for my case?
Thanks.

I have some really huge string data to ship with my android app?

I have some really huge data that is required for my android app. I've put it into a sqlite db now. Roughly it is 39k rows and 5 columns. I want this data to be available for my app.
I'm kind of confused as to how I ship my app with it. i can ship the db file with it like discussed in this thread. or I can somehow create XML out of that data and ship it along. But the XML would be really huge. So what is the right way of doing it?
I do not want to download it after user installs the app. That'd be my last option if there are no better clean ways of doing it.
This should help you.
http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/
Basically just ship the database with your apk file.
I think shipping your DB could make some problems with compatibility.
Maybe it will be better to use GZIP'ed SQL code bundled to your .APK?
Or instead of XML for intermediate representation you can use google protobuf, which is most effective data representation format(Also, if you have a lot of strings, you can use it in combination with GZIP).
Check the example here to achieve this functionality.

Create an output document from Android App

I have an android app where I will be capturing various information in different forms and storing into the SQL lite database for tracking/viewing purposes. I want to give the option of exporting the information into a RTF/PDF/Doc and give the option of sending it thru email.
I looked at various similar questions posted here earlier but didnt get a definitive answer. I saw the Android PDF Writer library http://sourceforge.net/projects/apwlibrary/ but this seems very basic. I considered iText but I think there would be issues with licensing if in future I want to sell this app..
Basically I want to define a template document with a structure that will be copied and content added to it based on what the user wants to export...
Any help is greatly appreciated...
I wanted some elegant solution where I can store a template in the assets folder and replace whatever I want to create the output document. Finally I went with html. I created a html template and put it into the assets folder. After that it was as simple as read assets, read db, do string.replaceall and write the output html and email it out.....
OpenOffice.org's Universal Network Objects (UNO) interface to programmatically generate MS-Word compatible documents (*.doc), as well as corresponding PDF documents.
its basically java so it should work on android too.

How to encrypt SQLite DB using SQLiteCrypt

I wanted to ecrypt the db file that i am storing on the sdcard. I have looked into SqliteCrypt library for serving my purpose but its using C libraries to perform the encryption/decryption.
I would like to know if anyone has successfully included the library in their project? If yes, please guide me through the process. Any guidance or any samples will be of great help.
Edit : Anyway, it's much more simpler to implement encryption yourself based on plain Java. It's not difficult – #barmaley
I want to encrypt the whole db file as single unit. Not individual data fields. Please let me know if there is any alnerate mechanism to achieve this.
Try using SQLCipher for Android.
try to use SqlcryptSDK
it is my project, i use android source code and add encrypt method in it.finally build the sdk and demo;

Advice on managing a list of information

I have been studying Java for a little bit now, and I'm ready to try building something. I think I have the basic understanding of how to build simple parts, but I have a hard time planning out my project. I was hoping you guys could tell me what I would need to make it work.
I am creating an app for work. I work in the ATM business, and we provide tech support for all ATM models. So we have a master list of atm error codes, what models they apply to, their descriptions, and solutions.
From the App I would like to make it searchable by ATM manufacturer->Model->List of error codes to choose from. AND searchable by error code.
What I'm not sure about is how to save such a big list of codes. I've got them formatted like this:
("Hyosung", "1000", "20001", "Unable to Detect Cassette", "Remove and replace cassette - Check the micro-switch located on the inside left wall")
(MANUFACTURER, MODEL, CODE, DESCRIPTION, SOLUTION)
So depending on how the user chooses to search, it could pull all error
There are, maybe, 1000 error codes. Would it be best to save this to a text file that the app can access? How would you guys manage the error codes?
Store it in a SQLite database. It might be a slight overkill in this case, but it's flexible enough (and you really should learn about databases anyway).
Your error codes seem to be in CSV format. So:
On first use of application parse CSV file line by line using one of CSV parsing libs: http://opencsv.sourceforge.net/
Save every line of data as a row in database: http://developer.android.com/guide/topics/data/data-storage.html#db
Create a simple GUI where you enter error code and it returns all data for this error code.

Categories

Resources