iOS data sharing to Google Apps for social features: Workable? - iphone

I'm putting on my thinking cap for this one, looking for a high level overview of possibility. I'm the author of an iPhone app that tracks user generated statistics. Data is essentially stored in a table on the device, with each entry having several fields/columns. Users can then sort that data, view graphs, and do other nerdy number crunching stuff. I want to take it farther and incorporate a sharing platform online. Game Center, Open Feint and other third party platforms are too narrow in scope. I'm interested in writing a web app, that users can visit to do three things:
Post New Table entries (automated by device)
View own entries and share via web (read only)
View other members table entries (read only)
Is Google App Engine a viable solution for this? My iOS app will require a POST URL, and the web app will need to save that authenticated user's data, and possibly return an "identifier" value to be referenced in the future in case the user needs to modify the item on the web. It will also require a GET URL to retrieve the authenticated user's statistics one by one or in total.
Next, the user will be able to visit the website and type in a "username" (probably email address) and see read-only statistics that have been submitted.
Thank you in advance for your input.

Sure, you could do all that with App Engine. If you wanted to, you could even make that local table of data sync with your app on GAE.
Really, there's not much on GAE that you can't do, although sometimes the database layer take some time to get used to.
My personal preference would be to set up a Django instance, but you could use any Python or Java-based app, depending on what you're comfortable with.
In short, yeah, you won't have any trouble doing basic REST work with GAE, and you could probably push it harder to do some more number crunching on those stats.

Related

How to download a csv file from Google Drive to show the content in a mobile app

I am totally new in mobile app development and consequently very confused about how to get going (independent from how much I have read Google Drive API documentation over and over again.)
The way I would like to implement my (initially "android") mobile app (which I will develop by using ionic):
I will have a Google Drive account where I will have 1 CSV file. I will periodically renew the content of the file in the background (possibly twice a week).
The mobile app that I will develop will just retrieve the file from Google Drive, process the content and show it to the user in a more readable (easy to understand) format.
My app will not upload any data/file from the user device to the Google Drive. The app will only retrieve a file from Google Drive to show the content to the user.
Question 1) Does this approach make sense? I ideally would like to eliminate the work for back-end development. Or would you suggest another approach to do the same thing (with or without Google Drive)?
Question 2) The authorization process looks quite confusing to me as it is explained in Google's documentation. I could not find relevant information only addressing the scenario I have in my use case. Requirements: The mobile apps can fetch the corresponding file (or the content of it) and process it to show to the end user, but mobile apps (or any other client) may not update/edit/delete the file, cannot add a new file either. The only purpose of using the Google Drive will be to enable the mobile app fetching the data that will be shown to the user. How can this problem be solved by using Google's OAuth framework? A step by step action plan would really be appreciated.
ADDENDUM
You are also welcome to share your view if I should instead consider using Firebase for my problem, which I guess will be more costly.
Based on discussing the requirements with you, I would recommend against trying to do this with Google Drive API.
There are no tutorials out there for Ionic 4 + Google Drive API, and only a few for older versions. It will be an uphill struggle to create a solution that isn't going to scale well.
Instead you should start looking into using Firebase.
There are lots of tutorials which show you the basics: setting up a login system, and reading some data from the database.
The free limits are quite generous.
You can implement caching into your app so that you store a copy of the data on the device, and only refresh it either weekly, or more advanced, put a second table in that records the last updated date for the main table.
Firebase charges by reads so if you can set it up so that you only read one record (last updated) instead of downloading the whole database every time, then you can stretch your free tier a lot further.
If you do outgrow the free tier and the app is not generating enough to cover the costs then you have the option of investing time instead of money. There are guides in the docs about exporting the users and they provide tools so that the passwords can be put into another system without requiring the users to reset their passwords. The database can be similarly exported.

Is truly persistent storage possible in a progressive web app?

I was reading this guide on offline storage for PWA's that described two storage API's, the Cache API and IndexedDB, however it seems that neither storage option is truly persistent. The Cache API is temporary by design, and the IndexedDB data can be wiped when the user clears their browser cache.
So, is it possible to have truly persistent storage in a PWA? What I'm trying to do is this:
User visits my website on their smartphone and I generate a unique ID in JavaScript.
They press "add to homescreen" on iOS or press the "add to homescreen" bar on Android.
The PWA gets added to their phone. At this point, I would like to store that unique ID persistently.
Is there any way that I can do so? Maybe an API that I don't know about? I only need a tiny unique code, since this PWA is not designed to have users log in with cookies.
No
The user can delete the PWA (if installed on Android) and clear their browser's cache of everything from your PWA.
Then if they visit again you would need to generate a new ID for them.
But you would know nothing of their previous ID if you have no login back end tied to unique users.
As Mathias already stated, it is not possible to achieve your goal with just PWA, as the user can wipe all the previously generated data.
So, long story short, you must use some other solution to ensure "truly persistence storage".
For example in a personal PWA Project of mine, I use Cloud Firestore. It offers also a very generous free tier you can use and it even allows offline persistence, granting full CRUD operations to your application (even when offline!).
Service Workers, through the Cache API, allow to cache only GET Requests, but no POST.
I wrote another answer about this on SO. And here you can find the official documentation.

How do I create an iPhone app to take a picture and send it back to an Oracle database?

I'm trying to create a program that you can take a photo with your camera, and send it back, where it will then be attached as a field into an Oracle database. An existing app that this is similar to (if I'm not explaining it clearly enough) would be bank apps that allow you to photograph the front and back of your checks, then send them off to a different location to be processed.
From my understanding, I would need some sort of middleware and not access the database directly with the pictures taken, but I'm just trying to get the project off the ground at the moment.
So, my immediate questions are:
What sort of base project template would be the best to use for this kind of app?
What sort of code is required to send a file from one location to another? (I'm mainly used to these scenarios in .NET languages, not in xCode)
Expose an HTTP based service (and that can be written in any language and run on any platform e.g. GNU/Linux).
The app itself would be native iOS, and you can certainly consume web-services.
The server itself is just your basic CRUD system backed by a persistent store, in your case an RDBMS.
[iOS] <-----/net:HTTP/---->[server]<==/LINQ/==>[RDBMS]

multiuser capable and search option available in app

I need to make my app such that
the first screen will have the option : NEW and SEARCH.
2.Clicking NEW should allow the user to create a new profile,
3.but clicking search should allow to access one of the stored profiles by searching for the user number.
These profiles will actually be some data about the person, his name etc. and then yes/no answers to some questions.
At the moment my app works such that I can type in my name, and do the yes/no checks and I am using plists to save the info. this means that when the I start the app the next time the app loads with the saved info. So I have got half the task done.
Now how do I make it multi-user capable so that it has the option of creating a new file or providing a search option to access existing data?
also, I am creating the plist in application directory, using the code on apple's website, but I have no clue how to access these files directly..is it possible to access these files, if I want to show the information on a desktop? Thanks.
The key phrase you want for searching Apple's docs is: Data Management.
Specifically, I would recommend the Data Management Starting Point.
Handling data can be as simple as writing a string or array to disk or as complex as a big Core Data data model. If you plan on writing and maintaining several Apple API apps, I strongly recommend eventually learning Core Data.

iPhone SDK & MySQL Remote Database

I've tried looking around but honestly not finding much help. I am mostly seeking for advice as to how I should approach to develop what I am thinking.
I want to accomplish something like this.
Imagine a website, with a backend database. This database contains information fed by users themselves. The website is fully functional, now I want users to be able to have the same functionality on their iPhones. I don't use a local database because I want all users to be able to have access to the same database, and this changes constantly.
What would be the best approach to:
Allow users to access all the information currently available on the website (database perspective).
Able to edit & add new entries to the database
I don't know if me creating an array to hold all this data would be wise to do. Specially with large amounts of data. I dont know how well it can scale.
Should I create a duplicate SQL lite database on the phone itself duplicating that of that website? What do you guys feel would be a good approach to this?
Comments, links, references would be greatly appreciated.
Thanks!
Sounds like the perfect time to create an API for your website. If the size of you application is not very big, you can use the same database, but would be good to run the API separated from the web server.
Essentially, such an API should allow you to make requests to certain URLs for retrieving, updating and deleting information from the database.
Depending on what server-side platform you are currently using, there are many options.
Client-side, your iPhone app can use http://restkit.org/ or http://allseeing-i.com/ASIHTTPRequest/ if you feel confident.