JS Code Deploying on Web - android

I am a junior mobile developer who is working on a location tracking app for android. I want to monitor location of people using android tracking app on web for which I have found this code on github written in Coffee script. I am total noob when it comes to web terminology or tool
I dont know how to show output of this code on web/browser. Can any one give me simple bullets on how to use this code and see output.

Download and install Node.js.
Go to the code Directory, ie.
cd ~/track-my-location-develop/track-location/web
and run the following command: npm install && npm start
After thats done, open the url http://localhost:4000 on your browser
You will get a list of devices available,Get any of those user id and track the device by navigating to : http://localhost:4000/track/:objectId
eg: http://localhost:4000/track/Simulator
Refer to app.coffee file for further details regarding the routes available.
Now you could use these WebServices within your android application to do your desired task.

Related

ICANN Name collision for react-native android

I have a react-native app with ios and android versions. Both versions use a webview to access a web site. The ios version works when pointed to either the production web site or local development version. The web site uses ruby on rails and the development server is pow.
When I run the android app, it loads but when it tries to access a local version of the web site, it returns the following error:
console.error: "Encountered an error loading page", {"canGoForward":false,"code":-2,"canGoBack":false,"description":"net::ERR_ICANN_NAME_COLLISION","loading":false,"title":"","url":"http://my_app.dev/,"target":69}
The same happens if I use localhost rather than the my_app.dev. It does however work when pointed to the external production url i.e my_app.com.
I have tried using a different android device, and the error changes to ERR_CONNECTION_REFUSED. The first device used the android browser whereas the second looks like it uses chrome. So it does appear to be a browser specific problem. Reading this link, I used nslookup my_app.dev to work out the ip address as 127.0.53.53 and entered
127.0.53.53 my_app.dev
into the /private/etc/hosts file. However this still gives same error. How do I fix this?
A work around for this problem is to find out the ip address of the development machine, say 192.168.0.33, configure the server to allow external access at my_app.192.168.0.33.xip.io, and then in the react app, configure the host url as http://my_app.192.168.0.33.xip.io. However this means running the server in special mode, so it would be better to find a direct answer to this question.

Cordova / PhoneGap : open file from other app

I recently started working with PhoneGap based on cordova to build an app for ios, android and windows phones.
For now I'm testing it on iphone, which is the main platform for this app and this question as well.
To make it easier, lets call my PhoneGap application "Scanner".
Here's what I'm trying to achieve:
You're in a random app, lets say the mail app. Click on an attachement and select "Open with..." Scanner. That should send the file to the scanner and send the path of that file to a javascript variable.
For now, I had no problem opening the xcode build and adding the document type, so my app is displayed in the open with menu.
Any idea how to get the app to display a file ? A pdf for example ?
If there's a global solution for the 3 platforms, that would be like heaven...
Thanks to all of you !
What you need is called "deep linking"
some plugins.
https://github.com/nordnet/cordova-universal-links-plugin
Happy codding!
******************* Edit *******************
I see your need, you are talking about Uniform Type Identifiers, but I dont find any information about how to use in cordova. Probably you will need to write your own plugin
https://developer.apple.com/library/ios/documentation/FileManagement/Conceptual/understanding_utis/understand_utis_intro/understand_utis_intro.html#//apple_ref/doc/uid/TP40001319

ionic run android app doesn't working without -l argument

I use Ionic in order to create an application.
When I use the following command, the app working in my device :
ionic run android -l
This command start a web server on my computer, this web server will serve the app on device. The app depends on the webserver (so computer and device must be in the same network).
When I use the following command, the app doesn't work :
ionic run android
In fact, the app will display the first screen, but when I click on a button I get a blank screen. I can't use the console system (with -c argument) because without -l argument there is no webserver.
I want to debug my app without webserver.
Do you have any idea ?
I found the solution thanks to GapDebug tool.
I used links like :
<a href="/#/home">
But this link point to no resource. We must remove first /.
So, I change all my links to this format :
<a href="#/home">
I hope it will help.

Cordova features aren't work on server

I am a developer of DisciplineXgames! We are developing a mobile app. We have downloaded the Cordova test suite from here (https://github.com/apache/cordova-mobile-spec). When I upload this on DisciplineXgames server it shows an error in alert box "Error: Apache Cordova did not initialize. Demo will not run correctly." but when we upload the same folder on Phonegap server it works perfectly fine. Unfortunately this doesn't solve our problem as we are building our mobile app on our server and just using Phonegap to redirect the user to the page hosted on DisciplineXgames server if there's Internet in the user's mobile.
First error which I got in the console area in Google Chrome is cordova.js missing when I provided that than it outputs another error that is cordova/channel is required.
Hope you can guide us through how we can use Cordova's amazing features on our server instead of Phonegap's local server.
I am a bit confused as to what you are trying to accomplish here but I am going to take a stab.
You want to develop an app that when the app launches, it checks to see if the device has internet connectivity. If it does, then the app just opens the mobile website hosted on your servers. if there is no internet connectivity then the app ???
Since this is a very simple use case for an app, I would avoid using cordova and instead use PhoneGap Build. Simply write an index.html page and a .js file to check for the connectivity and then use the inappbrowser plugin to open your mobile site if there is connectivity. Once that is done, zip your package, upload to phonegap build and then download your compiled apps.
phoneGap Build allows you to avoid the app building overhead and the need to install things BUT prevents you from taking advantage of some of the deeper configurations and some plugins. But again, for your simple use case, PhoneGap Build sounds like the way to go.

How to automatically start the android apk install process when user clicks a download link on an website

According to developer.android.com
http://developer.android.com/tools/publishing/publishing_overview.html#publishing-website
When users browse to the download link from their Android-powered
devices, the file is downloaded and Android system automatically
starts installing it on the device. However, the installation process
will start automatically only if the user has configured their
Settings to allow the installation of apps from unknown sources.
it seems to be possible to automatically start the install process without the user interaction. I've checked the box to allow apps from unknown sources, but I still have to manually trigger the install process. I saw many posts on the same topic which seems to suggest the opposite of what is said on the official website:
How to install APK automatically when the file download is complete (hosted on private)
how to automatically install an apk
How to automatically launch the Android installer after downloading the apk?
others seems to suggest that the only way to have the install process automatically happen is through an already installed app:
Android: install .apk programmatically
The requirement that I have is that the user only need to click on one single link on a private deployment website, and the application installation would be triggered automatically without the user having to do anything else.
Currently when I click on the link in my deployment website, all it does it downloads the apk file, I need to manually start the install process.
None of those answers really gets me what I need, the instructions on the official website would be perfect since it doesn't require anything else, except I couldn't get it to work, installing another custom app to install the original app would also have the same problem when trying to install it.
We are also deploying iOS apps for testing purposes internally, the way we are doing that is through the manifest file link
http://help.apple.com/iosdeployment-apps/mac/1.1/#app43ad871e
sample link from the page:
<a href="itms-services://?action=download-manifest&url=http://example.com/
manifest.plist">Install App</a>
Are there some extra steps that I have to do to get the instructions on the official android website to work? Maybe there is a way to get the download link to behave like an iOS manifest file link? Or perhaps there are some other ways to achieve my requirements?
Thanks.
The requirement that I have is that the user only need to click on one single link on a private deployment website, and the application installation would be triggered automatically without the user having to do anything else.
That is up to the implementation of the Web browser, not you. The Web browsers that I use download the APK via DownloadManager, then show a Notification when the download is complete, where tapping on that Notification drawer entry starts the install process. While there is nothing stopping a browser from automatically invoking the ACTION_VIEW or ACTION_PACKAGE_INSTALL Intent that starts the installation process, that is up to the authors of the browser.
Are there some extra steps that I have to do to get the instructions on the official android website to work?
Find some browser that works the way you want.

Categories

Resources