I'm looking to make a service which I can use to make calls to a web based rest api. I've spent a couple of days looking through stackoverflow.com, reading books and looking at articles whilst playing about with some code and I can't get anything which I'm happy with.
Ccna final exam - java, php, javascript, ios, cshap all in one. This is a collaboratively edited question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
Monday, June 11, 2012
Restful API service
Wednesday, May 16, 2012
Do I really need a service layer?
My web application is written using Spring MVC + Hibernate.
- My model is "Customer" entity POJO.
- I have got a DAO object "CustomerDAO", its method "saveCustomer(c)" contains the code interacting with Hibernate;
- Then I created a " CustomerService with a "saveCustomer(c)" method who simply pass the customer object to the dao for saving;
- Finally there are "CustomerController" and customer.jsp, who are responsible for the view layer, the jsp's form fields are bound to a Customer object on the controller side. The controller calls the service.
Tuesday, May 1, 2012
Why doesn"t my Service work in Android? (I just want to log something ever 5 seconds)
I created a new class called HelloService. I added this to the Android manifest.xml.
Sunday, April 8, 2012
Android lifecycle weirdness with singleTop and foreground service?
Here's the scenario:
- Start Activity A
- Activity A starts service S
- Service S runs in foreground mode and shows up a notification which when pressed takes the user to Activity B (which has launchMode="singleTop")
- Activity B shows up
- Press HOME
- Go into DDMS and kill your application process to simulate that your app died (press red STOP button)
- Android will say "Rescheduling crashed service in 5000ms" (sometimes longer)
- Service S restarts and notification is shown.
- Press the notification icon when the service restarts...
Thursday, March 1, 2012
Catch any touch in the screen in a service
I need a service that know if the user is touching the screen anywhere. If user doesn't touch the screen in a time, I launched a intent to the browser. Someone can help me. I cann´t find the code of how to capture any touch on screen in a service and I cann't think in any solution. Sorry for my English and thanks.
Wednesday, February 29, 2012
Android : testing a service
we are actually developping an audio service (in the android sense of the term) and we have quite of lot of tests to cover many aspects of our APIs. But we are actually wondering for good things to do to test a service efficiently.
Monday, February 27, 2012
How to adapt basic android service to run an activity in the background?
I want to create an android service which is able to fetch and parse JSON data into my local database. I have already written the code for this to be done as a normal activity. But I would like to change it so that it updates the database on a regular basis. How would I go about doing this?
Android Activity causing Service crash due to heap fragmentation
I have an Android app (activity) which also has a corresponding service. The service is started by the activity and is supposed to run continuously even when the activity is stopped. When the activity is started again it can bind to the service and query it.
How to create an Android Activity and Service that use separate processes
I have an Android app that consists of an activity and a service. Currently they both exist in the same process and use the same heap but I want have to separate process/heap for the service. Ie. I want the service to be completely independent of the activity so that if the activity crashes it won't affect the service. I do, however, want them to be installable as a single application. Is this possible?
Thursday, February 16, 2012
Android - Running heavy computations in background and returning the result to an Activity
I have implemented some computationaly heavy functions into my application. Depending on the type of input it can take up to several minutes for a thread to return. During this time, I want the user to be able to work with other activities to perform different tasks (i.e. prepare data for the next run). Then, after the Service has finished it's computations, the user should be notified with a Toast that the result is ready and that he should check back to the Activity he started the Service in. Unfortunately I'm stuck at this point.
Tuesday, January 17, 2012
ON & OFF Android Broadcastreceiver
Im creating an app in which i do a task when i receive a call (detect RINGING state with a BROADCASTRECEIVER ).My question is that,can I register and unregister (literally;ON and OFF) his broadcastreceiver from an activity having 2 buttons;say one for ON and another for OFF?