Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8397513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:48:35+00:00 2026-06-09T20:48:35+00:00

I write an android service of get weather, and the AndroidManifest.xml is: <?xml version=1.0

  • 0

I write an android service of get weather, and the AndroidManifest.xml is:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.my.weather"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="15" />

    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <service
            android:name=".WeatherService"
            android:exported="true" >
        </service>
    </application>

</manifest>

Now, I want let another apk to start this service:

Intent service = new Intent();
service.setClassName("com.my.weather", "com.my.weather.WeatherService");
context.bindService(service, weatherServiceConnection, Context.BIND_AUTO_CREATE);

And I got the error message:

E/AndroidRuntime(14068): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.my.test/com.my.test.MainActivity}: java.lang.SecurityException: Not allowed to bind to service Intent { cmp=com.my.weather/.WeatherService }

How can I solved this issue?

Other apk is use the Messenger method to communication with weather service.

================================================================================

Thanks all!

Now I modify my weather service’s AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.my.weather"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="15" />

    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <service
            android:name=".WeatherService"
            android:exported="true"
            android:process=":remote" >
            <intent-filter>
                <action android:name="com.my.weather.WeatherService"></action>
            </intent-filter>
        </service>
    </application>

</manifest>

And I use this method to start:

Intent service = new Intent("com.my.weather.WeatherService");
context.bindService(service, weatherServiceConnection, Context.BIND_AUTO_CREATE);

Then I got the warning message:

W/ActivityManager(131): Unable to start service Intent { act=com.my.weather.WeatherService }: not found
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T20:48:36+00:00Added an answer on June 9, 2026 at 8:48 pm

    Here says from documentation:

    If we want to make this service run in a remote process (instead of
    the standard one for its .apk), we can use android:process in its
    manifest tag to specify one:

    <service android:name=".app.MessengerService"
            android:process=":remote" />
    

    Also note that the name remote chosen here is arbitrary, and you can use other names if you want additional processes. The : prefix appends the name to your package’s standard process name. With that done, clients can now bind to the service and send messages to it. Note that this allows clients to register with it to receive messages back as well.

    Edit1:
    Second, if the service element (in manifest) contains an action string, use it. For example if your service declared like this:

    <service android:name="com.sample.service.serviceClass"  
                android:exported="true" android:label="@string/app_name" 
                android:process=":remote">
       <intent-filter><action android:name="com.sample.service.serviceClass"></action>
       </intent-filter>
    </service>         
    

    So do this in onCreate() method of your service:

    public void onCreate(Bundle savedInstanceState) {    
          super.onCreate(savedInstanceState);  
          Intent intent=new Intent("com.sample.service.serviceClass");  
          this.startService(intent);
    }
    

    I saw that in this question:
    Unable to start Service Intent

    Edit2:
    I saw your manifest again.It seems that your manifest has no Main/Launcher Activity.In android 3.1 and later it causes no service be available.In fact forsecurityreason all services,receivers,... that you declare in manifest,will not register unless your App run explicitly by user and this needs to a Main/Launcher Activity.So you have to add such Activity to your App and be care that it has already been performed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to write Remote Service in Android without aidl ? If yes
I write app for Android which will be communicate with HTTP server. I need
I am trying to build an Android Service that should get notified when the
I am trying to write a Http API in android. I am using a
i m trying to write a method for calling service and get JSON data
I have Android application where service running 24/7 Phone get's GPS position every 5
I have an Android service which sends broadcast intents. I'm trying to get those
Hi i write a basic web service in apex on salesforce.com plateform here is
I will write an android program. for simplicity, it will need a connection similar
I am trying to write an android tablet application which scans for a set

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.