How do I allow Android Services

KlutchSCKlutchSC Joseph AndrewsUSMember

I need to add it to my android manifest, and last time I did this (for internet permission) it was as easy as clicking Project -> Build Options -> and checking a box next to internet in the permissions. I don't see a check box for anything like Services or Android Services. How do I allow them in my manifest?

Best Answer

Answers

  • CheesebaronCheesebaron Tomasz Cielecki DKMember, Insider, University ✭✭✭✭

    You look in the documentation and find out you need to add a Service attribute to your Android Service. If that is not enough for you, look in Xamarin's sample repository to find a Service Sample

  • KlutchSCKlutchSC Joseph Andrews USMember

    I find your answers to be very rude and please keep them out of my questions from now on. Thank you.

    I went to the documentation and it told me to add it to an XML file. I don't have that in my build, as I said I added to my manifest in a completely different way then it is telling me in the online documentation.

    If you can't help please don't post.

  • StevenTheEvenStevenTheEven Michael Andersson SEMember ✭✭✭

    What documention have you read that tells you to add it to an xml file and it hat case which xml-file? What you have done in a different case has nothing to do with what you maybe have to do in this case. That you should know. It isn't always as easy as use a checkbox. And have you tried to do what Cheesebaron told you to do? What error do you get then? Or doesn't it work with that change?

  • KlutchSCKlutchSC Joseph Andrews USMember

    yes I have tried what CheeseBaron told me to do.

    I added (even before I came here) [Service] above the namespace as to inherit from the ServiceAttribute custom attribute. This is what it told me will auto-generate the service in my manifest on build.

    I have done all this and it is still telling me (after I try to build) that I am missing it from my manifest.

    I know that the Android Manifest is an XML file.

    I would like to know how to generate the actual xml file (Manifest) so that I can manually add in my service.

    That would be quite dumb to not allow it's developers to actually see and manipulate the xml file it's using for a manifest to build their solution.

  • StevenTheEvenStevenTheEven Michael Andersson SEMember ✭✭✭
    edited July 2013

    Are you using visual studio or xamarin studio?

    http://docs.xamarin.com/guides/android/advanced_topics/working_with_androidmanifest.xml

    Ther you have what to do to get your manifest.xml

  • RaviKishoreRaviKishore Ravi Kishore USMember

    Instance {System.Net.WebException: Error: ConnectFailure (Network is unreachable) ---> System.Net.Sockets.SocketException: Network is unreachable at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in :0 at System.Net.WebConnection.Connect (System.Net.HttpWebRequest request) [0x00000] in :0 --- End of inner exception stack trace --- at System.Net.HttpWebRequest.EndGetRequestStream (IAsyncResult asyncResult) [0x00000] in :0 at System.Net.HttpWebRequest.GetRequestStream () [0x00000] in :0 at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke (System.String method_name, System.Object[] parameters) [0x00000] in :0 } System.Net.WebException

Sign In or Register to comment.