Community Questions & Answers
[alloy] [android] how do I open a window from a background service, when my app doesn't already have focus?
I am creating an alarm app, I have a service that checks every 60 seconds if there is an alarm that needs to go off, (maybe not the best way to do this?) Anyways, if there is an alarm that needs to go off this minute, I want to launch a window. This works,...
Loading a model inside a service
I have this model that is working well on controllers: ~~~ exports.definition = { config : { "columns" : { "active" : "Bool", "name" : "String" }, ...
Android service
I wanna develop an application that contains service that runs every morning , I tried the example in documentation and it works great. the problem is how to start the service again automatically if the user force close the app or restart his device. I...
Keep a background service running
Hi, I have an iPhone app that runs a background service that needs to always be running but it stops after a certain time... How could I make this service never stop? I saw something saying you need to add a key to the info.plist file but that's...
Background Service - also App is not startet?
Good morning, iám reading about the background service for iOS. My only question i have - what happend if device switched off... After restart the service should starts too. Not only when app starts! How can i do this? Alternative way? Thanks for helping!
Location-reading iOS app that runs in background indefinitely
App type: mobile Ti SDK: 3.0.0 Platform: iOS 5.x, 6.x + various iPhones and iPads I'd like to ask a question about running in the background on iOS. This app is an enterprise app and need not pass certification by Apple (installed via email link). It...
Android native background service
I have an android app that uses a native background service. (urban airship module) When I close the app and start it later I get the "App has stopped..." and then I can start it. It is as if the background service keeps running but the app...
How to open an application from background service?
I have an android background service running. I'd like to open the main application when a certain event occurs. Right now I just show the notification: ~~~ var notificationIntent = Ti.Android.createIntent({ className:...
Backgroundservice stops after more 25 min
Hi, ich have a registered backgroundservice in IOS that makes trouble after 25 or more minutes. In the code below you will see that every 10 seconds a message appears, so i can check in the log, if the BG Service is still running. I have set all the need...
Consume web service (url) in Android for NFC application?
I need to install an Android NFC reader module or app to read MinFare cards and need to take the keyid from card and send a batch or push these keyid's to a web service. The webservice will return a digit code. Any ideas how to do this? Using Nexus 7...
Service memory leak
Application type: mobile; Titanium SDK: 1.8.2 from the site; Platform & version: Android; Device: Android emulator, Android device; Host Operating System: Windows 7; I have discovered some weird problem with services. Each time service runs, it...
Other service types besides "interval" on Android?
I would like to declare a service which is not interval based, I really need a service running on the background all the time, and not based on interactions given by an interval time. Does anyone know if there are other service types on Titanium (Android)...
Announcement: open-source tutorial app, GrillTime
I'm happy to tell you all that I've finished up my open-source tutorial app, GrillTime. I've been working on this for about two months (with the bulk of that spent wrestling with alarms, services, and notifications on android). If you want to see what it...
Can i access Alloy.Globals from within a service?
Hi, I want to call functions which i have prefefined in the Alloy.Globals namespace in alloy.js in an android service. When i tried to do that, it gives me a crash, because Alloy is not defined in the service. Is there some way to gain access to...
Multiple background services
Hello there, I would to know, if it's possible to register another backgroundTask in an backgroundTask, which's already running? A second backgroundService startet from the first one, can something be done? Thanks
Run service on boot_completed android
Hello, I was wondering how i can start a service when the boot_completed broadcast is send out by android itself. I think i only need a correct module to do this but i'm not sure. i have this so far: in my tiap.xml: ~~~ <uses-permission...
Change the interval of a background service on android
Hello, I was wondering if someone knows wether i can change the interval value of a background service on android when the background service is already started. When i make the service, i do the following: ~~~ var intent =...
How can I prevent that iOS kills my location-backgroundservice when it don't retrieve locationChanges for a while?
Hello community, I'm developer in a little team and we work on a location-based mobile app, in this version for iOS only. A few months ago I've tested the behavior from the backgroundServices in the TitaniumApp, that worked good. The actual version of the...
lost service reference, when second times into app
app.js code: ~~~ var intent = Ti.Android.createServiceIntent({url: 'myservice.js'}); intent.putExtra('interval', 2000); // when launch app second times, lost the old service reference var service = Ti.Android.createService(intent); if...
Location service stops after the iphone restarts - HELP!
Hi, I made a background running application for iphone using titanium location services and it is working fine. But the problem is if I turn off the iphone and turn it on again the location service is no more running. I need to open the application upon...
A few questions regarding Android background services
Hi, I am testing out background services to see if it will work for an app idea I have. For testing purposes I have used the code from here https://wiki.appcelerator.org/display/guides/Simple+Android+Services+in+Titanium and simply replaced the...
How do you configure a titanium service as an Android receiver?
I have added the android service definition to tiapp.xml but I can't figure out how (or if it is even possible) to configure a Ti service as a receiver. After noting that myservice.js is converted to a com.example.MyserviceService class, I added a...
Plans to support the Android Licensing service?
Any plans to support the Android Licensing service (which replaces the depreciated app copy protection scheme for apps submitted the Android marketplace)? Seems like this could be done with a custom SDK module, but it looks to be a bit...
Create a service that continues to exist even when the app is closed
Hello, I am trying to launch an service from my app that continues to exist, even when the app is closed by the user. However when the app is closed and another timeinterval has passed and my service should be executed, it gives the following error:...
WCF communication issue
Hi All, I need to post data to a service written in .NET WCF. But I cant able to communicate. It always return onerror potion with status 415. Here is my code block. In .js file ~~~ var xhr = Titanium.Network.createHTTPClient(); ...
Background service Android
Hi, I wanted to create a service in android which runs in its own thread and alert the user on the bases of some time entered into database, whether the app that created it is running or not. In KitchenSink 1.5 after 3 second of backgrounding the app...
Call Webservice while running a BackgroundService from iOS-App
Hello there, I'm developing a titanium mobile application with the focus on iOS-platform for tracking a user's device in the background. I spent a much time to resolve the common "location background service"-problem, which have anybody in this...
Problem with Ti.Platform when a Service is running
Hi! I have the following issue with my Android app: When the app gets started, I create a **Service Intent** checking if it already exists. If it is already created I do nothing and if it is not, then I do create it. This service will create a...
How to catch data from an other app
Hi, I've been searching for a while how to do that, and didn't know which direction I have to take. I have an Android 2.3 titanium application, that we can call TestApp, and my device has a barcode laser scanner, which send information when it...
Varying the interval of background service
i want to vary the service interval from 4 sec to 8 sec to 16 sec and so on.. is it possible?
Titanium Android Service to trigger daily at 9am?
Hey folks... I made an intent and started a service in titanium. Service runs fine with constant interval of 4000 milliseconds. How can i specify my service intent to trigger daily at 9am instead after every 4 seconds? Following is my code ~~~ var intent =...
Service Stop problem
While trying to stop service calling: ~~~ service.stop(); ~~~ I'm getting following exception: ~~~ W/System.err(22762): java.lang.NullPointerException W/System.err(22762): at...
re-bind to running service events
I have a service running in the background on Android and it keeps running constantly. When I launch application activity is binding to service events and that works ok. When the app is destroyed service keep running in the background . When activity is...
Unable to resume app in Android 4.1
I'm working on an alarm clock app that uses a background service to determine whether or not the alarm should go off. The following code creates the service and tells it to fire every ten seconds. ~~~ var intent = Ti.Android.createServiceIntent({ url:...
Android - will there be native async processing available in appcelerator?
*Android SDK 2.2, Ti SDK 2.0.* Seems that there is no nice and simple way to run javascript code asynchronously in appcelerator which is a big problem if it comes to data processing. Consider this simple code for performance testing: ~~~ // run iteration...
The application crashes when the Android service is started. on Kitchen sink and SDK 1.8 or later versions
I've tried to Android Service on kitchen sink. But, the application crashes with certain procedures. - Platform "Android Services" click - "Start Service via startService()" button click - Close the application by back button. - Open...
android crash when notification fired from service, after application is closed
I've created a service that fires a notification every n seconds. When I start the service from within my app, the notifications are shown correctly. If I go back to my home screen or application list, when the first notification is shown my app crashes....
Android notifications/reminders service stops
Hello! I'm working on an app that includes daily reminders that can be set by the user. I've tried a lot of different approaches, everything from these steps directly in the JS code: **Titanium.Android.createServiceIntent (with interval) ->...
How have JS context in native module with Broadcast receiver ?
Hi, I try to create an Android module using Broadcast receiver to detect network change. My broadcast receiver works and I can call a callBack method, but when my application is closed, I have an error about V8 runtime disposed. I try to create to use...
Calling REST service from Mobile App
Hi all. I would lik to know how I can call a REST service from my Titanium App. Also, does anyone know of an online REST service, that I can test up against? I simple one would be great. Like a Hello-World kind of service, just to see im calling the...
Service that starts on boot.
I am developing for android. Is there a way to make a service (not a gui app) that starts when the phone starts and runs continuously using Titanium? Any links, code examples, guidance, etc. appreciated.
android: background service available?
hello, is it possible to build an android app in titanium which runs as a permanent background service? or is there another way to prevent a running app from stopping when the phone goes into sleep mode or the user starts another app? thx, u.
Amdroid: Countdown timer on android supporting sleep.
I have been digging for days accelerator forums and hope to get a clear response for both me and future developers. Goal: have a timer that counts down , notify the user and auto restart. Requirements: 1. notify even if phone is sleeping and update...
Android application status
Hi, Is there a way to know when the application is in the background or not? Thank you! Daniel
Background Service on Android
Is there a way to run a background service on android similar to Ti.App.iOS.registerBackgroundService? If not how can this be acheived on Android? Thanks and Regards Abishek R Srikaanth
Whats the equivalent for android onHandleIntent() in titanium
Hi, I just wanted to know is there any equivalent API in titanium for android onHandleIntent(). I am developing application to get local notification in android when the application is not in foreground. I have created a android service and all coding...
Service not works when screen off
Thanks for reading, I need some help, I´m going crazy... really. In Android, Titanium SDK 1.8.2. I have a service that captures the GPS position and saves in database. The interval of the intent it´s every 30 seconds. All works fine... really good when...
Running a Module in Background
So basically I've created my own module in xcode to interact with an external device. It works great until I move the app into the background. I have a background script registered using `Ti.App.iOS.registerBackgroundService({:'background.js'});` In...
Trouble stopping an Android service, please help.
Hi All. I'm having some issues stopping an Android service once it's started. Can anyone please help? ~~~ function trackService(status) { if (status == true) { var intent = Titanium.Android.createServiceIntent({url:...
Android Service stops working when app closes.
I have created a service that runs when i close my app by pressing back button. I dont know whether it is right Approach or not but it works fine when the App is running in foreground. in my androidService.js file I have this file is placed in android...