Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

Context: Earlier this year Facebook updated their android app without using the google play services : http://liliputing.com/2013/03/facebook-pushes-android-update-to-enable-silent-updates-bypassing-the-play-store.html

I would like to try a similar thing with my android app. (I'm aware of the implications so please don't post regarding the same.)

Description: I have gone through the the related Android classes Package Manager - Androidxref and resources like: Install apps silently, with granted INSTALL_PACKAGES permission but could not find any non-rooted method. Ways like:

   public static int installAPP(String absolutePath){
        int status = -1;
        File file = new File(absolutePath); 
        if(file.exists()){
            try {   
                String command = "adb install -r " +  StringUtil.insertEscape(absolutePath);
                Process install = Runtime.getRuntime().exec(new String[] { "su", "-c", command });
                status = install.waitFor();
            } catch (Exception e) {
            Log.e(TAG, "Not Installed!");
            } finally { return status;}
         }
      }

works just fine, but then again it's for rooted devices.

Any information/hints for possible ways of doing and and any relevant information/hacks regarding the same is much appreciated. Thank You.

PS. I am working on a ROM.

share|improve this question
    
If you are working on a ROM, then you can install your own stuff as you see fit, because your system apps can hold INSTALL_PACKAGES. –  CommonsWare Dec 14 '13 at 13:13
    
Dear Mark, Thanks for the information and also for being so actively supportive to the community [github && so]. If I weren't working on the ROM will there be any feasibility of achieving the same. Any pointer on how facebook was able to achieve it ? –  ark1n Dec 18 '13 at 8:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.