On start-up of google tv, show live tv? Start service on boot? - startup

I am pretty new at android development and am working on an android app for google tv. my current hurdle is that i want to start the Live TV app as soon right after the GTV starts.
I am thinking that it would be a Service that loads on startup that tells the Live TV app to start, but i don't know if a Service at startup is possible, nor do i know how to target the Live TV app.
any ideas or suggestions?

My workaround was to make LiveTV be the start up application (Set up in the Google TV UI). Then, I set my service to start on boot, explained here.
http://www.androidcompetencycenter.com/2009/06/start-service-at-boot/

A user can set the startup application from the UI. If setting LiveTV to be the startup app isn't enough (it's the default), you can have your app start, then launch Live TV.
You can also have services that start at launch do it, just as you can on any Android platform.

Related

iOS: run app as a service in background

Being relatively new to iOS App development, I wish to develop an app which runs like a service in background (comparable with android service). The goal of my app is to use the native voice recognition, also while the app is inactive. My question is, would it principally be possible to code an app to be able to run also in background? I've read in a few pretty old threads that iOS closes any app after three minutes. However, should it be possible, I would be thankful for any coding example.
I don't think so, because if the app is on background, the local audio recogisation is for Siri.

Objective-C/CocoaHTTPServer - Is it possible to run CocoaHTTPServer as a background app without any UI?

I want to run CocoaHTTPServer as an independent background app which doesn't have any screens. Other apps in the device should be able to communicate with this app for remote server connectivity. Is it technically possible in iOS ?
Any suggestions are greatly appreciated.
No. It is not possible. CocoaHTTPServer is a small, lightweight, embeddable HTTP server for Mac OS X or iOS applications. It can't be run as a standalone application. It has to be added as a part of an application. The server is running only while application is in foreground. As soon as you exit from the application (by switching to another app or locking a device) the server will be stopped. The server will be restarted when you enter the application again

iOS - Screen sharing in Perfecto Mobile

We were exploring various test suites for mobile automated testing and ran into this company called Perfecto Mobile. One of the features that blew me away was they are able to (without jailbreaking) effectively perform a "Remote desktop" on a physical iPad.
So, the iPad's screen is mirrored within a web application, it can register touch / swipe events on the web app and perform them on the device. The only relevant technical detail I have is that all this is being performed using commands sent over the USB cable.
I'm really curious as to how this is implemented and details on relevant Private APIs if any.
Thanks,
Teja
I'm not familiar with PerfectoMobile, but I can give you a few pointers on how this can be accomplished:
For the mirroring, one way would be to look at using AirPlay, the APIs are pretty well documented, but not to do what we're talking about which would require some serious reverse engineering, but it's definitely possible, these guys have done it. A different approach would be to run a background app that would periodically take snapshots of the main screen, and send them over a socket connection to a client. You could do this as a VNC server, and to incorporate the remote view in a web app, you could use noVNC. As far using a USB connection, in the case of the background app talking to a client over TCP, you could to a port forward.
To actually perform on the device the touch events sent from your remote viewer, most people have been using the GSEvent group of functions from the GraphicsServices private framework without needing to jailbreak the device. Again, a background app would receive over a socket an instruction such as "Tap there", instantiate the GSEvent, and inject it so it gets processed in the run loop of the most front app.
These few possibilities, at least, have been implemented successfully in different iOS apps up to iOS 6.1 (iOS7 is a different animal). You won't find any such app in the App Store, since Apple clearly prohibits the use of private frameworks in 3rd party apps, instead people deploy them in-house using Enterprise and ad-hoc provisioning profile. On Android however, there's VMLite available in the Play Store.
If you looking to share screen from ios / android, check out skreen.me. They have sample apps you can try out, also they provide libs for mobile app integration.

iOS web app: prevent screen dimming/locking

How do I prevent iOS from dimming and/or locking the screen of my WEB app?
This is for a WEB app, so any native code suggestion would not apply.
The WEB app would run without user input and I'd like to avoid iOS automatically dimming/locking the screen (without turning the setting off in the global settings).
Is there a way for a WEB app to tell iOS not to dimm/lock the screen?
If the above is not available, is there any third party app that would monitor the system and turn off screen locking/dimming when a given web app is running?
Thanks.
No you can not turn off the autolock from a WebApp. Also there is no way for any thirdparty app to detect this, since apps can not really run in the background.

Can a app that uses location service in iOS be auto started at boot time

While I have read in the apple's documentation that VoIP based apps will be auto started after a boot, there is no mention of apps that use GPS. This should mean that apps that are registered for GSP will not be auto started when device boots.
However I need to make sure that my understanding is correct before I move ahead.
Any help is appreciated.
There is no concept of "auto start" in iOS neither the concept of "boot time" from the point of view of 3rd party apps. When the OS starts all applications that were open before the shutdown will be "opened" again and put in inactive state. VoIP and GPS applications can request something like 10s CPU in every 10 mins. These cycles will be restarted automatically after device boot if the application was running before shutdown. However this is not "autostart" behavior.
You can boot launch your application by using background service like voip.
You can activate this service by enabling it on info.plist file.

Resources