I am developping a crossplatform desktop application using Electron, nodeJs and angular2.
My application needs to know, at all time, which foreground process/window is running on the computer.
Do you have any idea on how to achieve such a task ?
First of all you need to detect platform which runs Node app:
os.platform() - https://nodejs.org/dist/latest-v5.x/docs/api/os.html#os_os_platform
Then you need to run platform specific command for getting process info with child_process.exec().
https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback
To get metadata on active window you can use sindresorhus/active-win: it is multi platform (win, osx, linux) and very easy to implement
Related
I'm attempting to create an audio router app in Electron. I used DetectRTC (https://github.com/muaz-khan/DetectRTC) to get the list of audio devices on the computer.
How would I go about changing the Windows default audio device via JavaScript, or is it even possible?
Forgot about this project but as far as I know it's impossible to control os level audio settings from the browser. I think a good option for this would be to use C# and Windows core libraries, as in this implementation. Then, the C# could be run within an electron app using electron-cgi.
I'm on a project cross-platform where the client wants a website, an iOS application and an android app. I chose cordova to realise it.
But I have one question, can I host my application like a classic website on a distant server ?
Maxime
While you might be able to reuse parts of your HTML, CSS and JavaScript for the website, Cordova apps run on physical devices like phones and tables and interact
(access device capabilities) with the underlining operating system like Android and iOS.
When you have an existing server-based web app, and you want it running in a Cordova app, you'll have to migrate it. Depending on what your application does you could use a thin Cordova client (think of it as a web browser embedded in a native app) that automatically redirects to your web site.
Link to officially supported platforms.
https://cordova.apache.org/docs/en/latest/guide/support/index.html
EDIT: the following is only for testing, not production
Cordova supports the browser platform.
By running cordova platform add browser you add it to your project and with cordova run browser you run your app in a browser. To run it in a specific port, you need to run cordova run browser -- --port=1234.
You can add, build and run the iOS and Android platforms in the same project.
Take a look here https://www.raymondcamden.com/2016/03/22/the-cordova-browser-platform/
I'm using browserify and amok to hot-reload my project during development. This way I can build my project continuously and get all live changes whenever i edit & save my html, js or css and I serve my project on localhost using the static http server ecstatic
I open my website in an android emulator, on a usb connected mobile device and in several web browsers
What I would like to add is the option to "synchronize" the navigation (clicking, scrolling, etc...) the way browser-sync does, without all the other capabilities that come with it.
Is there a stand-alone project, that just does the "ghost mode" feature of browser-sync?
If not, can browser-sync be used in a way that it does just that?
So this maybe a silly question, but i guess I'm missing something.
I host my meteor app in modulus.com.
The goal is to have a single code-base for all devices and the web, fetching from the same database.
So everything happens in the web is immediately synced with the mobile app or vice versa.
Should i provide different builds (different modulus projects [web, ios, android]) all connected to the same db to make it all work as one application?
A single build will do?
How will this work?
thanks
Yes, you can use the --server option to specify which Meteor server your built mobile app should point to. This way, you have one Meteor backend running the web app, Android app, and iOS app. This should work just fine with Modulus.
I am developing location based android application using cordova (ionicframework+angularjs).So when app is in background i have to get the userlocation ,so that i can provide location based push notification.
Is that possible to run the app in background?. Please help
In your requirement you need to use android Services.Otherwise you cannot run GPS Tracker in background(When app is in background). So if you need to run background service i think its not possible to do with ionicframework.Because its not native app development tool its only working with front end like browser base application. So you have to use native application development tool.