Let say that I have a parse server installed locally on my local machine can I use that server outside of the development process and use it while I am not connected to my local WiFi? Basically is there any way that I can get around having to use a service such as Mongodb or Heroku?
Yes. you can deploy your parse-server on heroku and any server than can run node.js.
parse-server-example is giving the option to install parse server on different platforms including heroku with a 1-click install.
Related
I have an understanding of how peerjs works as i have created an app using this tech in my android app.
But how do i host the server on a hosting package.
Do i need to vps and install peerjs on the server to allow communications with the peerjs server? will this hosting server need node.js
I have also heard and read about Heroku, is this a better way?, and how would i go about installing the peerjs server on Heroku?
I have tried this locally and the applciation works fine on my end but need to upload this peerjs server on hosting how can this be done?
I want to develop a offline android app with mongodb as my database.
Following are the things i need to implement:-
1)Can i install mongo db on android device
If we can do point 1 following are the things I need additional to it
2)When the internet is available the data on the android device should go to the mongodb on my server.
So, I will have to instance of mongodb database one on the android device and one on the server.
When internet connection is not available all the data goes to android device mongodb.
When internet connection is available then the android device data will be synced to server mongodb database.Similarly any changes in server data base should reflect in android local database once we get internet connection.
Will mongodb support this kind of architecture.
You can not install mongodb in Android device, so, game over.
It isn't possible to install MongoDB locally on Android device, because MongoDB latest releases doesn't support android device's CPU architecture. But i read an article online i gave it a try and it finally worked i was able to use MongoDB on my android device, hope it'll work for you too just give it a try
Here is the link to the article: https://codipher.com/install-mongodb-on-android/
I have an android app that must execute python code in ec2 on demand. What is the best way to implement this?
Have a look at the remote management tool that amazon provides.
You can have you servers setup with the tools,the ssm agent and the script you need to execute. Then send a remote command to them through the sdk.
Check the related ssm java sdk and how you can utilize it with android.
Step to get started with Python as backend and Android:
Install MAMP, WAMP or LAMP etc on your local computer depending on OS. Install python separately if it's not already included.
Introduction to Flask and RESTful services : follow https://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask.
Maintain your code in version control eg Git. It is also useful to streamline your code upload from local to server.
Get a server : Since you might have to install some modules/packages on your server I recommend to have server with root access. You can try AWS free tier for 12 months.
Install Apache/Ngnix, python, SQL, phpmyadmin and Git depending on OS you have bought from AWS to start serving.
Go to your server root (mostly /var/www/html/) and git clone your project repository and change your environment variables and configuration as per step 5.
Ideally you should check here that you are getting expected response for your requests . Use Postman to test post requests.
Now you can consume your web service on android using any networking library like retrofit or volley.
Let me know if you need clarity on any point. Happy coding.
Maybe what I'm about to ask is stupid, generally I don't have so experience with server-side.
I'm building an Angular web application, with nodeJS on the server-side.
I need that the server (Node.exe) will installed in the device itself (IOS/Android), and nodeJS will open a localhost socket to communicate with the device.
(According to nodeJS official web site, nodeJS only support windows/Mac OS/Linux)
It's possible to do that?
If not, there is another server can I install in the device?
Yes you can with JXCore (a fork of nodejs), more info in this link
Build Mobile Apps with JavaScript and the Node.js Ecosystem repository is in here.
And how to compile it is in here JXCore - How to Compile
But if you need it to be nodejs (not the last version) you can use this link to do what you need Building and running Node.js for Android
UPDATED 27-09-2018
Like someone has pointed out, that project is no longer maintained but I have found and alternative by Using Termux on an Android phone you can use nodejs / gcc / vim / etc and more tools to do many thing
This link show how to do it for nodejs ( and I have tested it on my phone ):
Building a Node.js application on Android - Part 1: Termux, Vim and Node.js
First install termux from playstore, of course.
I don't understand the point of using a server tool on the client side.
If your application should work with an offline mode, you should put all data and other in your client app (using cordova).
If your application works with an online mode the server side is needed to serve your data. Here you can setup a nodeJS API which provides routes for your application to have content to print.
I'm not sure I brought you the wanted answer, so can explain more the point of using a server tool on a client device?
What you are trying to achieve, turns your device into a server.
A server side language is meant to stay on the server.
I don't really see why you need to open a localhost socket on the device to communicate with itself. Is it for offline testing? You can do that since you have a computer and a device, and both are connected to the same network.
I believe a really good start would be understanding the concept of the Client-Server architecture first.
But in short, the proper way of implementing a Client-Server app using your chosen technologies would be:
A server should provide the client with answers to his requests.
So in Node.js (server-side), write whatever you want to communicate with your database (Create, Read, Update, Delete), do custom processing, etc...
and return a structured answer.
The client is expecting answers to his requests, and is supposed to handle the answers in code. So the program written in AngularJS (which is your client-side language) will be installed on devices.
The client has to know the format of the server's answer. Is it plain text? XML? JSON? ...
so you mean you would like to have an app can run some services via http?
not sure if iOS allows application with JS virtual machine executing code ...
and for Android
searching on Github and I find how to build NodeJS for Android
https://github.com/dna2github/dna2oslab/tree/master/android/build
Here is an example to run compiled Nginx binary on Android at https://github.com/dna2github/dna2mtgol/tree/master/fileShare
You may modify a little more to replace Nginx to NodeJS. The code to run Nginx is not very nice; maybe you can try an Android Service to let the server run on backend on Android device.
Hope it is what you want.
I am in need of some help here.
I want to make an Android application that eventually syncs to a web server in order to get information (i.e. user can write a note through the website, and it automatically syncs to the phone).
I am aware that I would need some web servers and hosting, and don't know too much about that so I will look into it later.
MY question, however, is how I can simulate this over a local network?
As in, if I create a basic webpage that has a two text boxes (one for name, one for content) and a 'submit' button, if I run it via localhost WHAT methods can I use to get this information to sync to my handset?
If anyone could be kind enough to give me a laymens terms breakdown it would be seriously appreciated, I feel so lost!
You have some alternatives to achieve what you want, here is a traditional one:
Start with installing XAMPP and run a local server
Write your web pages, store the data in mysql
Write PHP code to extract the data from mysql
Use Android HttpClient to call your PHP
There are other alternatives:
Use the same method but instead of PHP write HTML5 and you have a mobile WEB application
Check out the GCM Demo Application
Check out Google App Engine
Check out Amazon Web Services
There are others
Enjoy :)
Yaron
When you use localhost (meaning you install a server package such as Apache / IIS / XAMPP / WAMP in your computer), your machine becomes a server. So, you can access the localhost from any device which is in the same network.
Say you have a computer connected to a WiFi router. If you setup the server i.e. the localhost in that computer and a laptop and a mobile phone is connected to the same WiFi router, the phone and laptop will be able to get service from the computer.
To access data stored in the MySQL server from the other devices (e.g. the phone), you have to write proper service. Else, you can write a mobile web app in the server that accesses the MySQL data and just access it from the device.