如果您不要在 Google Play 這類市集發布應用程式,可以讓使用者從您的網站或伺服器下載應用程式,包括非公開伺服器或企業伺服器。首先,您必須照常準備要發布的應用程式。接著在您的網站上代管可發布的 APK 檔案,並提供下載連結給使用者即可。如要安裝以這種方式發布的應用程式,使用者必須允許安裝不明來源的應用程式。
使用者選擇安裝不明的應用程式
Android 會防止使用者不慎下載並安裝「不明」或來自 Google Play (值得信任) 以外來源的應用程式。系統會阻止這類安裝操作,除非使用者選擇允許從其他來源安裝應用程式。使用者選擇的程序取決於在其裝置上執行的 Android 版本:
[null,null,["上次更新時間:2023-09-20 (世界標準時間)。"],[],[],null,["# Alternative distribution options\n\nAs an open platform, Android offers choice. You can distribute your Android apps\nto users in any way you want, using any distribution approach or combination of\napproaches that meets your needs. From publishing in an app marketplace to\nserving your apps from a website or emailing them directly to users, you're\nnever locked into any particular distribution platform.\n\nThe process for building and packaging your apps for distribution is the same,\nregardless of how you distribute them. This saves you time and lets you automate\nparts of the process as needed. You can read [Preparing for Release](/tools/publishing/preparing) for more information.\n\nThe sections below highlight some of the alternatives for distributing your\napps.\n\nDistributing through an app marketplace\n---------------------------------------\n\nUsually, to reach the broadest possible audience, you'd distribute your apps\nthrough a marketplace, such as Google Play.\n\nGoogle Play is the premier marketplace for Android apps and is particularly\nuseful if you want to distribute your apps to a large global audience. However,\nyou can distribute your apps through any app marketplace you want or use\nmultiple marketplaces.\n\nUnlike other forms of distribution, Google Play allows you to use the In-app\nBilling service and Licensing service. The [In-app Billing service](/google/play/billing) makes it easy to sell in-app products like\ngame jewels or app feature upgrades. The [Licensing service](/google/play/licensing) helps prevent unauthorized installation and\nuse of your apps.\n\nDistributing your apps by email\n-------------------------------\n\nA quick and easy way to release your apps is to send them to users by email. To\ndo this, you prepare the app for release, attach it to an email, and send it to\na user. When the user opens your email on their Android-powered device, the\nAndroid system recognizes the APK and displays an **Install Now** button in the\nemail message. Users can install your app by touching the button. Users need to\n[opt in for installing unknown apps](#unknown-sources) if they haven't already\nto proceed with the installation.\n\nDistributing apps through email is convenient if you're sending them to a few\ntrusted users, as it provides few protections from piracy and unauthorized\ndistribution; that is, anyone you send your apps to can simply forward them to\nothers.\n\nDistributing through a website\n------------------------------\n\nIf you don't want to release your apps on a marketplace such as Google Play, you\ncan make them available for download on your website or server, including on a\nprivate or enterprise server. To do this, first prepare your apps for release in\nthe normal way, then host the release-ready APK files on your website and\nprovide users with a download link. To install an app distributed in this way,\nusers must [opt-in for installing unknown apps](/distribute/marketing-tools/alternative-distribution#unknown-sources).\n\nUser opt-in for installing unknown apps\n---------------------------------------\n\nAndroid protects users from inadvertent download and install of *unknown apps*,\nor apps from sources other than Google Play, which is trusted. Android blocks\nsuch installs until the user opts into allowing the installation of apps from\nother sources. The opt-in process depends on the version of Android running on\nthe user's device:\n\n\n**Figure 1** : The *Install unknown apps* system settings screen,\nwhere users grant permission for a particular source to install unknown\napps.\n\n\u003cbr /\u003e\n\n- On devices running Android 8.0 (API level 26) and higher, users must navigate to the *Install unknown apps* system settings screen to enable app installations from a particular location, as shown in Figure 1.\n- On devices running Android 7.1.1 (API level 25) and lower, users should enable the **Unknown sources** system setting, found in **Settings \\\u003e Security** on their devices.\n\n| **Note:** When users attempt to install an unknown app on a device running Android 7.1.1 (API level 25) or lower, the system sometimes shows a dialog that asks the user whether they want to allow only one particular unknown app to be installed. In almost all cases, users should allow only one unknown app installation at a time if the option is available to them.\n\nIn both cases, users need to complete the opt-in process *before* they can\ndownload and install unknown apps onto their devices.\n| **Note:** Some network providers don't allow users to install applications from unknown sources."]]