Meteor Cordova, How do I query the database? - mongodb

I am trying out ios apps built using Cordova and Meteor. Normally when I build a Meteor App, I can see the database's fields and structures by making a mongo query in the browser console, or opening genghisapp to see the entire database. But now I'm testing out the mobile apps by plugging in my iphone and running the test app there. How can I see the structure of my data and documents on there?

Even if you're running meteor on the iPhone, you're app should still be available at localhost:3000 (unless you're doing something fancy with the --mobile-server) and be connected to the same database your iPhone is using. You could run your browser console queries in the browser and it will update/reflect whats going on in the mobile app. I used this when debugging my latest project and it works as well as using the browser console while testing out a web app.
I'll have to take a look and see if this same thing can be done with genghisapp but if you're open to alternatives check out this package
https://github.com/gterrono/houston/
it's a simple auto-magical admin dashboard that might be a good substitute for genghisapp and I know the houston package will work when you're running meteor on you phone.

Related

Authentication with web based flutter app

I want to build a flutter app where people can log in and post things for other users to see. I want this app to be accessible in a browser and thought I could use Flutter-Web.
I can run the flutter app on a server with a local database but the issue is that if one user accesses the page and logs in, then everybody else is also logged in as that user.
The only solution I can see is if everybody would download my flutter app to their local machine, start an instance and then all those instances communicate with a remote database.
I can use a remote database, although I don't like it, but I don't want people to install anything.
Is there a way around by serving multiple flutter instances, one for each browser session?
The library flutter-auth-ui provides UI for Firebase authentication.
See how it works here.

Ionic - What about the real time and the database?

I want to code a web app which can runs on IOS, Android, Mobile browser, Desktop browser.
I tried for 6 hours Meteor but I had a lot of problems ... so I just switched to Ionic.
In 2 hours I created a simple app with a Geolocation system + Google maps and I runned it with my Iphone with Ionic View, that was a good start.
Now I need to persist my datas with a real database (please don't reply firebase) and add a real time system.
What are they the right tools and the right structure to reach that goal ?
If you want firebase-like capabilities, I would recomend rethinkdb: https://www.rethinkdb.com/
Otherwise, you can try mongodb: https://www.mongodb.org/
The structure is up to you to define according to your data.

How to access native SQLite database with an application

I want to make an application for iphone, ipad, and android using HTML 5.
This application will create a SQLite database or place a prefilled SQLite database file when it is installed on ipad/iphone/android.
I want to keep it in a folder where my application is installed.
eg
ApplicationName- Files (where I have all the files for the application)
ApplicationName- DB (where I will have my sqllite database)
I want to connect to SQLiteDB using javascript.
Can I access the db at a particular location from my application using Javascript or jquery.
Can you suggest me some way I can get into this.
I would advise you to look at Apache Cordova (old Phonegap) to see how they handle things or use they own solution for this kind of thing.
But if you really want to walk alone, you need to build 2 sets of frameworks to call native code, or use web sql database(inactive) or something similar.
iOS
http://blog.techno-barje.fr/post/2010/10/06/UIWebView-secrets-part3-How-to-properly-call-ObjectiveC-from-Javascript/
Android
http://labs.mwrinfosecurity.com/blog/2012/04/30/building-android-javajavascript-bridges/

Control rails application from Iphone's cucumber

I'm using Frank to test my iPhone app's features.
The iPhone app is synchronizing data from a rails application and I would like to cover the synchronization process with acceptance tests.
I would like to be able to use the standard ruby commands to manage my rails application's data for example creating a table of products in rails app and then i can check that it gets synchronized on the iPhone.
How can i configure cucumber (or Frank) so i can use Product.find_by_name("productname") from my iphone's tests?
I ended up hacking this together:
https://gist.github.com/2033123
Stick it in Frank/features/support
I'm not a great Rails dev so someone could probably clean it up but it works for our purposes.

How to Use PHP in IPhone Applications

I need to create an iPhone application using Facebook.
The facebook FBConnect API supports FQL which is similar to SQL Queries.
I would be able to create the application easily using PHP as compared to Objective-C.
So if there is any way to create an iPhone application using PHP please reply to me.
Thanks.
Well, if you are developing something for jailbroken devices , yes it is possible to use PHP (you have to install it first from Cydia).Also note that you should implement a SQLite database if your app/script needs database functionality (you can't run a MySQL server natively on iPhone ATM).
But, as pekka mentioned, this is a really bad idea, because you must set up first a lighttpd web server on iPhone (not really comfortable), or if you're planing to implement a CLI PHP script, you should first launch it (using some C functions like pipe(), dup2(), fork(), execl()) and then parse its output inside your -not-so-Objective-C- iPhone app.
So think it again...