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 7524935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:11:48+00:00 2026-05-30T03:11:48+00:00

I am working on an android application for my company which connects to a

  • 0

I am working on an android application for my company which connects to a bluetooth video device. A 3rd party company that we are working with built the bluetooth camera and have built a service (android service) that our app connects to which we use to interact with the camera. This company did not want us to have access to the source code so they created an SDK in the form of a service which must be installed on the phone for interaction with the camera to take place. If the service (which is just an APK) is not installed our app won’t work.

However, we can detect that the service does not exist and then proceed to get the apk and now we are trying to figure out the best way to do that. Is it possible we could have the other company publish this service in the android market even though it has no ui and when installed would appear to do nothing? Can you put something in the android market and not have it show up under normal filters (meaning the only way to get to it would be by going directly to the page?). I don’t think they want people installing it since the 3rd party company does sell there own camera (almost the same as the one they make for us) and they have applications in the market for it.

The other possibility is we host the file ourselves and download it when the user first installs the app.. The problem with that though is we have to figure out our own methodology for upgrades.

Does anyone have experience with this or have any ideas what might be the best way to handle our situation?

  • 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-05-30T03:11:50+00:00Added an answer on May 30, 2026 at 3:11 am

    I ended up solving the issue by bundling the service apk under the /assets folder of my application.
    You can read from that data as an inputstream and write it to sdcard where you can then launch the intent to have the apk installed. All the user has to do is click Install (as long as they have 3rd party apps allowed, which they will since our app is not in the market either.

    public static final String SERVICE_APK_FILENAME = "SomeService.apk";
    
    protected void installService() {
    
        File apk = getServiceFileOnDisk();
        if (!apk.exists()) {
            try {
                writeServiceToFile();
            } catch (Exception ex) {
                Log.e(TAG, "", ex);                
                return;
            }
        }
    
        Intent promptInstall = new Intent(Intent.ACTION_VIEW);
        promptInstall.setDataAndType(Uri.fromFile(getServiceFileOnDisk()),
                "application/vnd.android.package-archive");
        startActivityForResult(promptInstall, REQUEST_INSTALL_APK);
    }
    
    protected File getServiceFileOnDisk() {
        return new File(Util.getAppStorageDirectory(this), SERVICE_APK_FILENAME);
    }
    
    protected void writeServiceToFile() throws IOException {
        File apk = getServiceFileOnDisk();
        InputStream assetIs = mAssetMgr.open(SERVICE_APK_FILENAME);
        OutputStream out = new FileOutputStream(apk);
        // Transfer bytes from in to out
        byte[] buf = new byte[4 * 1024];
        int len;
        while ((len = assetIs.read(buf)) > 0) {
            out.write(buf, 0, len);
        }
        assetIs.close();
        out.close();       
    }
    

    So what happens is when the app first launches I check if the service needs to be installed (or upgraded).. That code is a bit more complex and outside the scope of what I’m doing here so I didn’t post it. But if I determine the service needs to be installed I prompt the user with a dialog and if they click ok I then call the installService method shown above.

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

Sidebar

Related Questions

I am working on an android application that requires multiple views which will overlap
I am working on android application in which i have play online radio streaming.
I'm working on an Android application. I have an activity that has this method:
I'm working on an android application which can calculate device's movement in 6 direction.
I'm working on Android application which have two different tabhost : Main and Child.
I am working on Android Application. Now I have requirement of search the entered
I am working on an android application which is sort of an e-reader but
I am working on an Android application that needs to determine the current tee
I am working on an Android application that shows a map with the user's
I'm working on an android application which allows users to create accounts on a

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.