-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hybrid app #24
Comments
Hey @daya, definitely it's possible. Checkout the android or ios example https://github.com/elixir-desktop/ios-example-app in those you also have platform code in the |
@dominicletz Looking at the Bridge code it seems its based on and limited by wxWidgets capabilities, right? If yes, then its fair to conclude that mobile device specific functions like accessig camera or finger print sensor or location services won't be mapped by Bridge any time soon. Is that correct? Is there any alternative approach or alternative Bridge implementation in the works ? |
In our primary app we don't need these at the moment, so yes it's unlikely I will add those soon. But I'm happy to take any and all pull requests in this direction. |
@dominicletz I will be more than happy to create a PR, but I will need your guidance to familiarize with few concepts Basically I want to know how should one think about this undertaking to support Camera, Location Services, Bio sensors.
|
I would for now stay away from Ports and NIFs as those are a pain to compile for all the mobile platforms, but rather try to solve with existing Bridge. For live Video streaming the current bridge might now work though as it assumes JSON encoding (which makes binary data much larger) and it's not suited for large payloads like a video stream. For a video stream I would open a new TCP or UDP port and use the JSON Bridge communication just to agree on the ports used... But I'm getting ahead of myself. |
That sounds reasonable but probably won't support older versions of mobile OS i.e. before Apple/Google started supporting these HTML APIs. Therefore going React Native route may be a better option but then one will need
The new bridge doesn't have to use JSON it could simply use other more efficient protocols e.g. RTP, RTMP, WebRTC or even RTSP, but since the distance between the client & server will be just few silicons then JSON may not be a problem after all. |
btw: It doesn't matter on distance in this case, it can be issue with encoding/decoding time on same device. I assume that it uses http protocol under the hood, so there is multiple encodings/decodings for example: Using some other protocol can save you some en/decodings and it can save you time and batter when we are talking about mobile devices. But I think this problem doesn't have to be solved now :) btw good job with this project, thanks :) |
Yes, encoding exactly. For Video content especially if it's a ton of it we should definitely skip any json encoding, and instead just push the raw bytes to save CPU cycles and battery on the phones. The comment about react-native I don't understand but then I also don't know anything about react-native. I personally definitely stay away from as much javascript development as possible, so no plans from my side to include an additional js framework. That said if there is a pull request that allows us more access to hardware from the Elixir apps and happens to use react-native I wouldn't block it either. Cheers! |
Well, streaming video is a little bit complicated and different and I think you should check some solution for Elixir and Phoenix itself outside of this elixir-desktop "solution". For example there some older posts about it https://littlelines.com/blog/2020/07/06/building-a-video-chat-app-in-phoenix-liveview |
But how will that help with a mobile application that allows user to upload videos ? If a web app is rendered in a WebView then one is left to the mercy of OS to support HTML5 tags or hope JS hackery works. It seems the only reliable way is to use device OS native API to access camera. |
That's true but still you have two battle fronts:
|
Is it possible to use
elixir-desktop
to create hybrid app to access device hardware functions like Camera, Location services etc?If yes, then how and what kind of javascript framework would you package alongside ?
The text was updated successfully, but these errors were encountered: