Accessing a user's webcam in Heroku - opencv

I am interested in gathering eye tracking data and would like to create a Heroku app that uses this GazeTracking package (or similar) so I can capture and capture and store data for where people are looking on their screen for given images. After going through dozens of related answers on Stack Overflow and elsewhere, I am still unable to get this working correctly since I can't figure out how to access the user's web camera. Here is the GitHub repo I've got going right now. Is there a way to access the user's webcam for this project? Thanks.
Edit: I am using the buildpack https://github.com/heroku/heroku-buildpack-apt.git

Heroku apps run server-side. they're web apps. users interact with them through browsers.
if you wanted to access a user's webcam, that would have to happen through the browser. that requires WebRTC or similar APIs. that means serving a web page that contains client-side javascript (or other) code which accesses the user's webcam through the browser, and then sends a video feed (or single pictures) of that back to the server.
you can only directly access server resources inside the web app, not client-side resources.
if you wanted to do eye tracking browser-side, there's OpenCV.js which runs completely in the browser. I don't know if the required procedures for eye tracking have been ported to OpenCV.js but it's worth a look. you could do the analysis client-side and just send back heatmaps or lists of coordinates.

Related

Is it possible to create a social network where data is stored on user's computer?

I'm searching a way to make a social network where the data (images, videos...) is stored on the user's computer (or client-side) and a remote server is used to access it by serving the functionnality and the design. The basic thing would be for each user to have a profile and to be able to browse other's profiles.
Note : It's not a problem if the client-side computer shuts down its machine. The user's profile would be just designed as offline. And when the user is connected, others would be able to browse his – her profile.
I searched a lot and I came up with different ideas :
→ store data with indexeddb and then stream it with webrtc. The problem : webrtc is not really made for showing a simple profile page to be browsed by multiple users.
→ make a desktop app to access local files and then try to make a communication with the server to deliver the app (with something like electron ?). The problem is I don't know if electron is well suited for this kind of project.
Any ideas, questions, suggestions, remarks or anything that helps would be greatly welcomed.
We have an application which i a Cloud Screen service/application. The purpose of the application is to store images and videos locally but also on the server. So if a computer connects to the network, it'll download the current content (json, images, videos) so it can display these even without internet because it's stored locally.
The client was made in Electron and the management application was .NET Core.
If you're thinking about creating a desktop application, then yes, it is possible, but in order to achieve this, you have to store on the server as well.
Let's assume that someone wants to check your profile. It has to load your datas which has to be stored on the server because they can't access your local files and computer. But you can store your files locally to boost up the speed.
I would only recommend this to store images/videos and bigger files, but you have to specify your requirements because in this case, every time you bump into a new content, you have to download it (if you want to store locally so it'll load faster the stored files).
The second option is to store these in the client. But be aware, desktop application's size can increase easily with lots of images and videos. If you store these in the client, you only have to store the URLs in case of dynamic datas (static URLs can be stored as static data).
I hope I could help, if you have any more questions, feel free to ask.

Is iOS capable of accessing and manipulating files on a Windows network file share?

I'm planning an app for work and venturing into potential features which I've not used before.
Essentially I need to be able to access files on a network share, read, write and delete files as well as amend the file names. As a pretty closed platform I'm not sure whether iOS is capable of such a thing and if it is, what features should I look for to begin researching?
My Google-Fu hasn't come up with anything thus far so hopefully looking for someone to point me in the right direction.
Thanks.
I know this isn't very secure, but I'd personally create an ASP.NET app on your target Windows Server, or a different Server on the domain. Create web services exposed, and make an iOS app with UIWebView. You can do RPC calls from the web service that do WMI/ADSI/File System manipulation. You can prompt for domain credentials, and do remote calls essentially is the gist.
You could expose the web app so that your app can access it from local network, or URL. If you were to access it from outside I'd suggest using some secure credentials in Windows/IIS.
Some years ago I created a "mobile-friendly" web app that allowed me to manage servers, perform RPC, and do basic Active Directory queries. Also allowed file listing and deletion/moving/copying with some creative scripting. It was essentially a ASP.NET/C# web app that loaded in a iPhone app. UIWebView in iOS was a able to load it, used AJAX and some other client side scripting that looked decent. You'd essentially have to make sure that your web app renders properly in Safari/UIWebView (which is bastardized safari).
Here's a link to a demo of what I created:
https://www.youtube.com/watch?v=czXmubijHwQ&t=12s
I ran it in a browser, but it'd run from my PSP, Android test devices, iPod Touch, Blackberry, etc.

Build entire iOS app as a website?

This might be a silly question, but wondering if I was able to build an iOS app completely in a UIWebview. Essentially not have one thing be native to iOS.
You can actually. There are several ways to use HTML5, CSS3, and Javascript to make mobile apps like iOS. You can use frameworks/programs like Cordova/PhoneGap. These frameworks/programs can let you use web languages and then compile it into an executable for the device. Something that can be submitted to the AppStore. Whether or not Apple accepts it thats another story. ;)
The other thing you can do is you want it to completely run off the web is you can essentially build a web app on a server like any other web app. However, you can put in CSS3 media queries and Javascript that can detect the size of the screen. Users can use their built in web browsers to access your site. If the screen isn't the right size, then you can redirect the user like if they try to access it with a laptop. With this method you can use server side scripting languages like PHP to do your computation processing. However, connection is required to the server and if a whole lot of people log in to your server, then the server can get bog down.
If you are interested in using web base languages for mobile applications, I highly suggest looking into PhoneGap/Cordova.

Need an advice on image hosting with web interface and API

I need a recommendation for some image hosting with a fancy web-interface for uploading pics and an API (or even better — an iOS SDK) to get those photos in a mobile app.
I'm aware of that question: Need recommendation for image hosting with API access. However, I don't need any image-uploading API, what I need is a way to populate galleries of photos to my iOS app users: upload the pics through a web interface, and then be able to retrieve all of them in the app. So there shouldn't be any user authentication in the mobile app, and the photos are meant to be public.
I'm looking into several flickr iOS API libraries, but I'm not sure if any of them can be used without user authentication — e.g. by anonymously pulling the galleries of some specific app-hardcoded user (me). Or maybe I'm overthinking and there's another suitable solution that I'm missing?
Any help is highly appreciated!
Ok, it turned out that Flickr is more or less the thing I needed — it obviously has a nice web-interface for managing your photos, and there are a bunch of components to access these galleries on iOS device (for instance, https://github.com/devedup/FlickrKit and https://github.com/lukhnos/objectiveflickr). Moreover, you don't need to log in to access publicly available photo sets and collections, so I decided to go for this option.
I am not sure if you would like to host this image hosting service by yourself.
if you don't, then you can take a look at ImageS3, https://github.com/images3/images3-play.
An open and free image hosting service run on top of Amazon S3. It is like other cloud image hosting service which provides REST api, web interface admin console.

How to create a server accessible by an iphone app

I a thinking of creating an iPhone/iOS app that would include a feature where one user could create a list of words and then save them to their account on a server. Also (and this is very important), the user could share their list with other users by giving them permission.
So my question is, how can I go about creating such a server? For right now, I have a home computer (running Windows XP that just stores data for my music system) which I can use to host the server. I am also open to the use of other online storage services like Google Drive or Dropbox (I can't remember if Amazon does anything like that). However (and I know this may complicate things a bit), but at least for now, I want/need to stick with free services/options.
Just to recap, the key features that I am looking for are:
create users/accounts (on the server)
eventually I may [try] to incorporate the use of other services to log users in like with their email account, OpenId, etc.
the ability to access (log in to) the server (with credentials) from my app
the ability to send/receive data between the server and my app
the ability to share data between users
I know this is a lot to ask for, but if anyone has any suggestions or can get me going in the right direction, it would be much appreciated.
The basic setup would be as follows:
Backend: Database (MySQL), Web server (Apache), with server side scripting (PHP).
Client: iOS device with developed app.
Communication: use HTTP client/server model, communicating with something like JSON.
This is much the same setup as a web server, but instead of serving html/css/javascript etc the results will be JSON.
As far as implementing specifics such as login in, and sharing data between users, this is purely dependent on your implementation. This is not trivial, and not something that can be easily stated in a single post.
Hope this helps.
You could build your own webservice in PHP, Ruby or Python. If you do so I would recommend building a RESTful webservice (http://en.wikipedia.org/wiki/Representational_state_transfer) and then use RestKit (http://restkit.org/) to handle the data in the iOS app. Especially RestKit's CoreData integration is nice in my opinion.
Another solution would be using a service like Parse (https://parse.com/products/data). The first million or so requests per month are free but after that it could get pricy. I personally have not tried it so I couldn't tell you if it is any good.

Resources