Can an app keep running while the screen is locked, on a jailbroken iphone? - ios

I have an idea for an app that I'd like to develop, but before I invest a lot of time learning objective C and the iOS APIs, I'd like to make sure that what I want to do is feasible.
The app I want to make is a purely auditory (sound-only) version of Google Glass. I'm visually impaired, so spending a lot of money on something visual, even though it can read content to you, would not be worth it. But if I could use an iPhone to give many of the same options as Google Glass, that would be great.
Many times, I've wanted a piece of information while walking down the street, where I couldn't easily get to my iPhone, because I have my cane in one hand, and something else in the other. In such cases, it'd be awesome if I could say a command, and get a voice response.
I'd use the microphone built into the Apple earphones for audio input, but I'm not sure if it's possible to listen for audio input while the screen is locked. I'm certain it's not possible with a non-jailbroken iPhone.
Can anyone can tell me if this is possible?

Yes, you can do this.
In order to keep your app running all the time, even when the iPhone is locked, you could build a Launch Daemon. A launch daemon can start when the phone does, and is not subject to the restrictions that iOS puts on sandboxed apps, installed to /var/mobile/Applications/.
You do need to have a jailbroken device to take advantage of Launch Daemons. Here is a good tutorial on building one.
Launch Daemons are also a normal part of OS X, so if you need more information, you might try consulting the OS X docs online. Most aspects of Launch Daemons work the same way on a jailbroken iPhone.
You'll also want to be able to detect certain events, to activate your app. You certainly don't want to be processing an audio stream at all times (maybe you only activate the app when you start walking with your cane). To detect events, like a home button press (or however you want to activate your code), I would take a look at RPetrich's libactivator library.

Related

Can I make a purely voice driven app in Expo?

I want to create an Expo app for ios that will say something, and wait for my reply, via headphones. The headphones part is immaterial but it indicates what I want... which is for this to run while my phone is locked and in my pocket. Once I have replied, the app would proceed. I have built Expo apps but I am unsure of whether an app can still interact with me via audio and the microphone in this way while the phone is locked. Also, I don't know if Expo has introduced this sort of capability. I also don't know if React Native (i.e. ejected Expo apps) can do this sort of thing. The lack of apps that truly interact in this way (not via Siri etc) are far and few between so I'm assuming it's a hard problem to solve. I would be just as happy if I could have a browser page running on the device do the same thing, but I'm pretty sure webpages can't play audio and wait for replies when a phone is locked. Is any of this possible at this point?
I did research this online, just to be clear. I wasn't able to find an answer so I came here. I mention this because this whole post does have that 'can you research this for me' vibe. I'm just hoping someone has knowledge of what is possible.
There is a page in the expo documentation that says when not to use expo, and the following is in there:
The SDK doesn't support all types of background code execution
Background execution is the ability to run code when the app is not foregrounded or the device is sleeping. We support background geolocation (including geofencing) and background fetch, but we do not yet support background audio with the operating-system playback controls and you cannot handle push notifications in the background. This is a work in progress.
You can take a look at it here.
I think you can do it in React Native though, however I can't say if there is a library to do it, so you can try creating your own with native code. You can see how here for android and here for ios.

Getting an iPhone off wifi

I'm in the process of testing routerequipment, and in that test i'd like to control wireless devices, so that they simulate leaving the area.
On android I have created a small app that receives commands (e.g. watch this on netflix, turn wifi off, browse to this page), to simulate user activity. Though this is great, it's not possible (maybe it is, but I have no iOS development skills, and my research tells me that it's almost impossible to automate, espeacially things as wifi, on iOS, unless you jailbreak it, and use private SDK's).
So my question here is more of a way to get ideas. Does anybody have any idea how to automaticly turn wifi off an iphone to simulate it leaving the wifi coverage area?
Bear in mind that this needs to be automated somehow. The best thing I can think of now is simply cutting the power to the iphone, and turning it back on and let the iPhone boot. Another solution, rather wicked, would be a small model-train leaving the wifi-coverage with the iPhone - haha, how awesome would that be!
Another thing I've tried is jamming by sending deauth-signals to the iPhone. While that works, it does not automaticly log back on the wifi, unless you manually lock and unlock the iphone. It would have been a great and simple solution, but it doesn't work.
I really hope somebody here has a great idea :)
have a great day! :)
/Benjamin

How can I programmatically interact between iOS and OS X apps?

This may sound a little strange, so I have to tell you why I am making this app. I just got a very old iMac that has very low processing power. I am attempting to make an application for my iPod Touch that can make it act as an external processor for OS X Panther. I have almost everything worked out, but I need the iPhone to be able to interact directly with the OS X app I am making, like iTunes does.
To be clear, I only want the iPod to work as an external processor by moving data from my OS X app to the iPod app, complete the code blocks, and send it back (thats the easy part). It does not have to work with any other OS X app. What I need to know is how I can send data through the cable to my iOS app directly. If this cannot be done, I have a backup data transmitting solution, but the cable would be much faster. Any ideas?
Good idea, don't post good idea's online ;-)
I'm going to tell you up front; unless you are lucky I don't think you will be able to get this to work.
I know that someone once found out that iTunes uses some kind of daemon program to communicate with your iDevices. I'm not sure if this is still true, but that daemon is undocumented but 'available'. I have no more clues than this, maybe you get lucky and find something on Google.
I'd go with wireless communication, I don't think speed is such an issue if we're talking about small instruction sets.
Also there's this, but I'm not sure if that will be of any help to you.
UPDATE:
found this post: Where is the mount point for the iPod/iPhone in Mac?
Which should help you write to the iDevice disk. You should be able to continuously look for filesystem updates on your device to process the data, and vice versa, to establish some kind of transfer system.

Objective C - Check running processes

good afternoon, I'm developing for iOS using phonegap, but I need to modify some objective C code and I was looking for information, but I cant found anything about how to check the amount of running processes in the device (iphone or ipad)
There are no public APIs for this. The reason is that Apple probably doesn't want you doing it, because it violates their app-sandboxing philosophy. And really, there's no reason for you to do it in an AppStore app, because you are guaranteed to be more-or-less the only app running when you are running. There may be some music players or VOIP apps in the background, but they user probably wants them there, they are not pertinent to your app, and there's nothing you can do about them anyway.
What is the reason you want to list the running processes on the device?

Saving video screencast of iPhone application

Is there a way to capture video of a screen from your own application? As far as I see there is no way to do it with UIImagePickerController (cameras only), but maybe there is a way to do it with iOS 4 AV Foundation or Core Video?
There seems to be two ways of capturing the content of the application while it's running:
Use the private API UIGetScreenImage() function which seems to be accepted by Apple now;
Use the following thread's captureView method to capture the image.
You'll have to capture it at many times per second (I guess 24 times should be ok for human eye persistence) then you'll have to produce the movie. Perhaps you could use the ffmpeg iphone port.
Alternatively, if you'd like to capture your application's running for a demo, your best bet would be to run your application on the simulator and use a Mac OS X screencast software to capture it. See also SimFinger which "bundle of little tricks to make a screen capture of the iPhone Simulator suck less".
Finally, perhaps the following StackOverflow thread might help you produce better screencasts.
SimFinger and ScreenFlow are great if you can shoot in the simulator.
If you have to shoot on the device (e.g. when accelerometer, GPS, camera, etc. are used) you currently have to resort to the jailbreak world. The app "Display Recorder", available for $5 in the Cydia Store, allows to create an AVI movie of the iPhone's screen content. This works across all apps. There's a YouTube video showing it. The movie files can then be uploaded to YouTube or pulled off the iPhone via the built-in web server.

Resources