是否可以通过 adb 安装应用程序但仍能获得 Google Market 更新? [英] Is it possible to install an application via adb but still get Google Market updates?

查看:30
本文介绍了是否可以通过 adb 安装应用程序但仍能获得 Google Market 更新?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的公司正在向我们的客户分发硬件(三星 Galaxy Tab 10.1)和软件(我的应用程序).

My company is distributing both the hardware (samsung galaxy tab 10.1) and the software (my application) to our customers.

我的意图是跳过"谷歌帐户链接并使用 adb 将我的生产签名应用程序直接安装到平板电脑上(与我上传到谷歌市场的 apk 相同).这将允许我为我们的客户预先配置平板电脑,将屏幕背景更改为我们的徽标等.

My intent is to "skip" the google account linking and use adb to install my production-signed application directly onto the tablet (identical as the apk I upload to google market). This will allow me to pre-configure the tablets for our customers, change the screen background to our logo, etc.

但是,一旦将平板电脑交付给客户,我希望他们将 Google 帐户附加到平板电脑,并且仍然能够通过市场从我的应用程序获取更新.在我的测试中,我手动安装的应用程序从未出现在谷歌市场的应用程序列表中.

However, once the tablet has been delivered to the customer, I would want them to attach a google account to the tablet, and still be able to get updates from my application via the marketplace. In my testing, the application I manually installed never shows up in the list of applications in google market.

这可能吗?

蒂姆

更新:我最终编写了一个启动器"应用程序,我将在设备上手动安装该应用程序.它有一个主题活动:

UPDATE: I ended up writing a "Launcher" application which I will manually install on the device. It has one activity with the theme:

android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"

该活动具有以下代码:

public class LauncherActivity extends Activity {

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    //setContentView(R.layout.main);
    startApplication("applicationnamehere");
    finish(); // this kills the activity immediately.
}

public void startApplication(String application_name){

    boolean successfulLaunch = false;
    try{
        Intent intent = new Intent("android.intent.action.MAIN");
        intent.addCategory("android.intent.category.LAUNCHER");

        intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
        List<ResolveInfo> resolveinfo_list = getPackageManager().queryIntentActivities(intent, 0);

        for(ResolveInfo info:resolveinfo_list){
            if(info.activityInfo.packageName.equalsIgnoreCase(application_name)){


                Intent launch_intent = new Intent("android.intent.action.MAIN");
                launch_intent.addCategory("android.intent.category.LAUNCHER");
                launch_intent.setComponent(new ComponentName(info.activityInfo.packageName, info.activityInfo.name));
                launch_intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                startActivity(launch_intent);
                successfulLaunch = true;
                break;
            }
        }
    }
    catch (ActivityNotFoundException e) {
        launchMarket();

    }

    if (!successfulLaunch)
        launchMarket();
}

private void launchMarket() {
    Intent intent = new Intent(Intent.ACTION_VIEW);
    intent.setData(Uri.parse("market://details?id=packagenamegoeshere"));
    startActivity(intent);
}

}

您可以将常量填充到 strings.xml 中.

You can stuff the constants into strings.xml.

它运行良好,唯一的问题是即使在用户安装了我的主应用程序之后它仍然在主屏幕上.因为它(默认情况下)会尝试为我的应用程序启动 LAUNCHER,所以这不是世界末日.

It works well with the only issue being that it hangs around on the home screen even after my main application has been installed by the user. Since it (by default) tries to launch the LAUNCHER for my application, its not the end of the world.

推荐答案

应该是可能的 - 看看 Titanium Backup 是做什么的.它具有 Market Doctor 功能,可以在您使用 Titanium Backup 恢复 apk 和数据文件后重新建立与 Android Market 的链接.

It should be possible - look into what Titanium Backup does. It has a Market Doctor feature that can re-establish links to the Android Market after you restore the apks and data files using Titanium Backup.

您还可以尝试将工厂映像加载到某些手机或平板电脑上,跳过帐户创建过程,并查看包含的应用程序(例如 Youtube、Facebook、Gmail、地图等)的市场数据库是什么样的.

You could also try loading a factory image onto some phone or tablet, skipping the account creation process, and seeing what the market database looks like for the included apps such as Youtube, Facebook, Gmail, Maps, etc.

这篇关于是否可以通过 adb 安装应用程序但仍能获得 Google Market 更新?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆