IPIA_KU
Kuwait
Asked
— Edited
Hi I have a simple question please
when making ARC mobile app; can i connect the app with Firebase Realtime Database to read and store variables? i want to use those variables to start and stop scripts...
thank you
If you create a plugin you can. I don't think that exists at the moment by anyone.
how about mySQL or any other database? Is there an already made plugin for any kind of database? confused
Take a look at all plugins here: https://synthiam.com/Support
Alright thanks a lot!
ARC mobile does not support plugins.
Only ARC Desktop (Windows 7+) supports plugins.
Oh - good catch PTP
Oh thanks! @ptp then there is no way to connect the mobile app of ARC to a database?
Using ez-script:
Can you explain this code for me? I assume you are storing and getting the value of the variable from a certain website, which means you are using a webpage as a database for storing and getting variables. Am i correct?
Correct.
I assume if you have a web script or an web api you can get or set values using the HttpGet function.
@ptp Cool! Is there any kind of web script or web api that you recommend?
Should i use javascript or PHP? And for the database; can i use phpMyAdmin?
Some points:
Ez-script httpGet fetches the content from an url on a remote server.
You will need to be able to reach the remote server from ARC mobile application e.g. local or internet server.
Your remote script runs on the remote server, you need to parse the query string and performs the operations i.e. GET, SET and returns plain text. If is a SET operation you should return OK or something similar, if is a GET should return the variable value or empty/default value if does not exist.
Language and database ? You should pick whatever you are familiar with e.g. PHP/mySQL, NodeJS or ASP.NET Core are good options.
IPIA_KU:
I presume your plan is to do something like this:
@ptp EXACTLY! thank you so much!
@ptp
i wrote that code with the intention to test that I get the contents of the database but it displayed the inspection of the page instead like:
<!DOCTYPE HTML><html lang='en' dir='ltr'><head><meta charset="utf-8" /><meta name="referrer" content="no-referrer" /><meta name="robots" content="noindex,nofollow" /><meta http-equiv="X-UA-Compatible" content="IE=Edge" /><style id="cfs-style">html{display: none;}</style><link rel="icon"
that's only part of what it displayed. i couldn't post it all because it is very long.
so what did I do wrong? I want to get the contents of the database from the link.. and the link I used only for local not on a remote server yet. so was that the cause maybe of what it displayed to me? I wanted to test first if it works with local then I will try to make it on remote. but unfortunately it did not even work for local ^.^;
The issue you are having is that the httpget command reads the entire web page that is returned, so on your database side, you need to create a very simple web page that just displays the returned data in plain text, and then you still need to parse the data out of the http headers and footers from your returned data variable into a variable the project can use.
A question I often ask when people are trying to do complex things with the mobile app. Is there a reason you need to be using the mobile app? ARC is far more extensible in Windows, and it provides two different web servers that can be used to create a nice mobile interface as long as the robot, Windows computer, and mobile device are on the same network (or can communicate with each other, there are certainly ways to do this over the internet as well).
With ARC you could much more easily create an ODBC or JDBC plugin, or use one of the many existing methods of transmitting and retrieving variables from external sources.
Alan
@thetechguru
by "parse the data" do you mean to use toString() function?
do you mean I should only make HTML file and write text into it? but then how does this is considerd as a database? we will be reading line by line how will i know where exactly to store or which line exactly will have the data i need.. :/
our senior project is about a robot that plays with children various games written in ez-scripts. so we want to use ARC mobile on an iPad where there is a start button the child can press and then the robot will start playing the ez-scripts containing the games. but in which order the games will start? this is decided by a mobile application created with xcode where the parent will use to schedule games. the schedule of games will be stored on a database and EZ-Script must read from the database to know which game or which script(containing the game) to start first.
Someone else will have to answer. I have not done a lot of string functions in ARC, I just recognize what the issue is. Basically, you will need to use functions that extract just the answer of your query from the returned web page.
No, I am saying that your web front end to the database needs to return a simple easily parsed page when you send your query via httpget. If you are getting a lot of extraneous data, it is probably mostly stuff for displaying the return in nice human readable format, with colors and boxes and stuff (if you have a publicly accessible example, I can take a look and be more specific). What you want it an easily machine readable return because no human will be looking at it directly.I won't quote your third answer. Good enough reason.
Alan
hello, by "mobile interface" do you mean the one we find in ARC: Project >> add control >> mobile ? do you know if i can create my own mobile interface plugin? so i can provide it with database connections and display videos on the mobile screen? i'm currently working on making a firebase plugin; so if there is a way i can create a mobile interface out of this plugin, it would be really great and helpful! blush
No, I meant the Http server or Http server (custom) . You can design a web page hosted by ARC on the PC and accessed by your mobile browser. By doing this, you have the best of both worlds. The full power of the PC running the app, scripts, and plugins, and a mobile interface to access it.
The object you mention creates a mobile project for ARC Mobile (either iOS or Android) but it is somewhat limited, like no plugins.