Making an app without a view

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Making an app without a view

Postby Fome » Wed Nov 18, 2009 11:09 pm

I'm totally new to android programming so this question might be because I have misunderstood some really basic stuff, but I'm trying to make an app that doesn't need a view. What I wan't is an app that, when you click it, just sets some variables (like vibration or sound or whatever) and exits.

I've just made an Activity, and in it's onCreate() I set the variables and end with a finish();

The program runs properly, however there is a glimpse of the basic view every app get (the black screen with the app name on top) before the program terminates. Is it possible to bypass this? I.E. some way to tell the system that the activity doesn't need a view.

I am calling super.onCreate(savedInstanceState); in the beginning of my onCreate() can this be the problem?

Thanks for any help!
Fome
Freshman
Freshman
 
Posts: 6
Joined: Wed Nov 18, 2009 10:59 pm

Top

Re: Making an app without a view

Postby jagtap.jj1 » Thu Nov 19, 2009 5:09 am

Use the service component http://developer.android.com/reference/ ... rvice.html
to perform functions without GUI.


Fome wrote:I'm totally new to android programming so this question might be because I have misunderstood some really basic stuff, but I'm trying to make an app that doesn't need a view. What I wan't is an app that, when you click it, just sets some variables (like vibration or sound or whatever) and exits.

I've just made an Activity, and in it's onCreate() I set the variables and end with a finish();

The program runs properly, however there is a glimpse of the basic view every app get (the black screen with the app name on top) before the program terminates. Is it possible to bypass this? I.E. some way to tell the system that the activity doesn't need a view.

I am calling super.onCreate(savedInstanceState); in the beginning of my onCreate() can this be the problem?

Thanks for any help!
java-android developer
User avatar
jagtap.jj1
Senior Developer
Senior Developer
 
Posts: 124
Joined: Fri Aug 22, 2008 11:52 am
Location: India(Mumbai)

Postby FreakDev » Thu Nov 19, 2009 7:10 am

using a service is the solution for making an "app" without UI, but personnaly i think, for the case you describe, that you should display something to the end user, at least a confirm message...
FreakDev
Junior Developer
Junior Developer
 
Posts: 12
Joined: Sun Nov 15, 2009 3:42 pm

Postby jagtap.jj1 » Thu Nov 19, 2009 7:18 am

You can use Notification Widget for showing confirmation messages. e.g. NotificationManager, Toast. etc

FreakDev wrote:using a service is the solution for making an "app" without UI, but personnaly i think, for the case you describe, that you should display something to the end user, at least a confirm message...
java-android developer
User avatar
jagtap.jj1
Senior Developer
Senior Developer
 
Posts: 124
Joined: Fri Aug 22, 2008 11:52 am
Location: India(Mumbai)

Postby Fome » Thu Nov 19, 2009 8:23 am

But as far as I can see, the only way to start a service is from another activity. So then I would need to make a wrapper app to start the service and end up with the same problem?
Fome
Freshman
Freshman
 
Posts: 6
Joined: Wed Nov 18, 2009 10:59 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 12 guests