How to access local mysql from chrome packages app - google-chrome-app

I am developing a chrome packaged app. There is already an VB application running with mysql. I want to access the same database but use chrome packaged app as client.
How to access local mysql server from chrome packages app using javascript ?
I am aware of IndexedDB.

You have two options:
Create a web service (e.g. some PHP pages) that talks to MySQL and allows your app to use it as a go-between
Write your own MySQL driver/communicator to communicate with it directly: http://developer.chrome.com/apps/socket.html
The first is the easiest and would take the form:
Your chrome app would use AJAX to communicate with the PHP pages (probably via "POST")
Your PHP pages would expect it to login, use SSL and then use a token to continue identification during a session
The PHP would have generic capabilities to do CRUD actions
The PHP would spit back JSON for the results
but the second option would make you a hero if you took the time to develop that and put it on sourceforge or github under a permissive open source license.

Related

How do I get Google Chrome extension to share data with an OSX app similar to 1password

I am looking at the features of 1password app which allows us to save a password and access the same data via its mac osx app.
If I was to create an chrome extension for my OSX app - how could it share data with a chrome extension and the Mac App?
Two broad possibilities:
Native Messaging. That's the more secure mechanism, but has only-one-way-to-use-it that essentially means you'll need some "proxy" application that Chrome can start, and that can communicate with your application - it cannot connect to an already-running process.
Local Web(Socket) server. Your native application can open a local port and the extension would try to connect to it and talk this way. Makes it hard to authenticate parties: your extension and your app has no warranties they are not talking to something hostile. Include your own authentication.
See also this question.
FWIW, 1password uses a local WebSocket port.

Use external mongodb in mobile build of Meteor

I've seen in a lot of places that in order to use an External Mongodb in Meteor applications, you should use an Environment Variable MONGO_URL. However, I'm building my application to work both as web app and mobile app (by generating an apk).
The problem is that when I start meteor as MONGO_URL='mongodb://user:pwd#path.mlab.com:9999/db' meteor it works well in my computer. But, it's not possible (I haven't found any way of doing so yet) to do this in mobile.
So, anyone has any idea of how I could use an external mongodb in mobile applications?
Thanks!
It seems to me that you are confused about how Meteor works, and more generally the client-server architecture.
Only your server has access to your database (whether on the same machine or at a third party provider), so that you keep control of exactly what your Client has access to.
By "Client", we mean what your visitor uses to access your app, whether a web app through a browser, or a mobile app through a Cordova wrapper.
So your mobile app only needs to know the URL of the server it has to connect to. That is specified by the --server option when you do your meteor build.
Then your server needs to know how to access the external MongoDB. This is your MONGO_URL environment variable. In production, you would set this variable on your server host. Each provider offers a different method to configure those environment variables, most of the time there is a graphical administration panel.
Note that the way Meteor works, you can use the same server to support both your web app and mobile app at the same time.
Finally, you can also test on mobile using meteor run android instead of just meteor (or with ios instead of Android, but you need a Mac). Of course you can still specify your MONGO_URL variable in the CLI when testing, exactly like you have done when testing on browser.
For mobile (cordova) meteor applications think of the app as just a web view with the ability to access native device features (camera, bluetooth ...). Since the application is basically a web view, the underlying mongodb associated with it is the same. If you want mobile device specific storage take a look at GroundDB
For your situation, if sounds like your mobile app is having problems connecting to your server, ultimately not allowing it to pull data from the mongoDB. Make sure that when you build the mobile application you have server specifed '--mobile-server'. Also if you are running it locally, make sure your mobile device is on the same network as your computer and any firewalls that might not allow connections are disabled.

Google Analytics Embed API with Server Side Authorization - Firebase Hosting

I completed the basic setup for Google Analytics and inserted the tracking code into my webpage(s). I can log in to analytics.google.com and see historical data just fine.
I have an admin page on my website where I want to display Google Analytics information to several users automatically (no additional logon req'd) and read that this is possible using the Embed API with Server-side Authorization.
I followed the instructions and created a Service Account that shows up under Service account keys in my Google API Manager portal. I also successfully ran 'sudo pip install --upgrade google-api-python-client' on my Cloud9 IDE and pushed the change to my hosting provider, Firebase, i.e. 'firebase deploy'. Lastly, I located and pasted my Analytics View ID in to the code sample provided with the Demo/Setup. My page is served with <!DOCTYPE html> declared.
I can't get it to work. Browser console says:
Uncaught TypeError: window.google.load is not a function
I am thinking that I am not invoking the get_access_token() in that Python module. In other words, I am thinking that server-side scripting is not supported with Firebase hosting.
Anyone know if and how to get Google Analytics Embed API with Server Side Authorization running with Firebase hosting?
This is not exactly a direct answer to your question, but rather an alternative solution to this problem. At least I’m using approach.
You can use Google Design Studio to build and embed amazing analytics and BI dashboards anywhere you like (also on your Admin website). But even easier would be to use Google’s authentication (via gmail) to provide access to select dashboards directly, as Google’s authentication and authorisation is likely more secure that your website’s.

Deliver application's GUI via browser

I need to show to a user an interface of some application running on a server using a browser. It should be like RDP-client for a single application on a server.
Are there any solutions or services that can implement following functionality? Maybe Citrix?
Thanks in advance!
This looks like what you're looking for:
http://freerdp.net/
About FreeRDP-WebConnect
FreeRDP-WebConnect is an open source gateway for accessing RDP
sessions using any HTML5 compliant browser. In particular it relies on
the Canvas and the WebSockets feature. FreeRDP-WebConnect is a
subproject of the FreeRDP project.
On the server side, a standalone daemon - written in C++ - provides a
Web page via HTTPS (or HTTP, if configured) and uses FreeRDP libs to
connect as a client to any RDP session. The server side WebSockets
implementation handles current RFC6455 only, so browsers that
implement the older drafts do not work. With RFC6455 being raised to
the "Proposed Standard" level, this should change now really soon.
I would create an account on the server for the user, and only give it access to the one application it needs access to.
You can use Cameyo. To start, create yourself a free account, and click on "Add App". If your installer supports unattended installation, you simply need to submit it. Otherwise, you can build a Cameyo package locally and send it in. It will then be playable as HTML5.
You don't indicate what server you are running on.
As an alternative to FreeRDP-Webconnect cited above, also open source and also using FreeRDP as rdp client through an HTTP gateway, there is Myrtille.
FreeRDP-WebConnect embeds a standalone daemon written in C++ to provide a web page via HTTP(S), and so will also work on Linux servers, while Myrtille have a IIS/.NET (C#) implementation and an MSI installer, thus is more intended for Windows Servers.

Making a GWT app work on my mobile using phoneGap

When you create a GWT app you can run it as a web application and point your browser to the home page and it works. Now, in this case your browser is being served the Javascript from the server and thus all calls to the server from your Javascript work fine.
But, if you then take the generated Java script and rather than have it server from the server just have it saved locally how would you go about getting your server calls to work. Say your server is running on localhost how do you get this to work. What I am trying to do is take a working GWT app and extract the generated Java script and wrap this in a phoneGap enabled app but I can't get my server calls to work.
Instead of trying adhoc approach. You should be looking at options provided by MGWT and PhoneGap - Reference http://www.m-gwt.com/.