本文整理汇总了Java中com.google.android.vending.expansion.downloader.DownloaderClientMarshaller类的典型用法代码示例。如果您正苦于以下问题:Java DownloaderClientMarshaller类的具体用法?Java DownloaderClientMarshaller怎么用?Java DownloaderClientMarshaller使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DownloaderClientMarshaller类属于com.google.android.vending.expansion.downloader包,在下文中一共展示了DownloaderClientMarshaller类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onReceive
import com.google.android.vending.expansion.downloader.DownloaderClientMarshaller; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
try {
DownloaderClientMarshaller.startDownloadServiceIfRequired(context, intent, OBBDownloaderService.class);
} catch (NameNotFoundException e) {
e.printStackTrace();
}
}
示例2: onReceive
import com.google.android.vending.expansion.downloader.DownloaderClientMarshaller; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
try {
DownloaderClientMarshaller.startDownloadServiceIfRequired(context, intent, UnityDownloaderService.class);
} catch (NameNotFoundException e) {
e.printStackTrace();
}
}
示例3: setMessenger
import com.google.android.vending.expansion.downloader.DownloaderClientMarshaller; //导入依赖的package包/类
/**
* Called in response to onClientUpdated. Creates a new proxy and notifies
* it of the current state.
*
* @param msg the client Messenger to notify
*/
public void setMessenger(Messenger msg) {
mClientProxy = DownloaderClientMarshaller.CreateProxy(msg);
if (null != mProgressInfo) {
mClientProxy.onDownloadProgress(mProgressInfo);
}
if (mState != -1) {
mClientProxy.onDownloadStateChanged(mState);
}
}
示例4: setMessenger
import com.google.android.vending.expansion.downloader.DownloaderClientMarshaller; //导入依赖的package包/类
/**
* Called in response to onClientUpdated. Creates a new proxy and notifies
* it of the current state.
*
* @param msg the client Messenger to notify
*/
public void setMessenger(Messenger msg) {
mClientProxy = DownloaderClientMarshaller.CreateProxy(msg);
if (null != mProgressInfo) {
mClientProxy.onDownloadProgress(mProgressInfo);
}
if (mState != -1) {
mClientProxy.onDownloadStateChanged(mState);
}
}
示例5: onReceive
import com.google.android.vending.expansion.downloader.DownloaderClientMarshaller; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
try {
DownloaderClientMarshaller.startDownloadServiceIfRequired(context, intent, SampleDownloaderService.class);
} catch (NameNotFoundException e) {
e.printStackTrace();
}
}
示例6: launchDownloader
import com.google.android.vending.expansion.downloader.DownloaderClientMarshaller; //导入依赖的package包/类
private void launchDownloader() {
try {
Intent launchIntent = SampleDownloaderActivity.this
.getIntent();
Intent intentToLaunchThisActivityFromNotification = new Intent(
SampleDownloaderActivity
.this, SampleDownloaderActivity.this.getClass());
intentToLaunchThisActivityFromNotification.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
|
Intent.FLAG_ACTIVITY_CLEAR_TOP);
intentToLaunchThisActivityFromNotification.setAction(launchIntent.getAction());
if (launchIntent.getCategories() != null) {
for (String category : launchIntent.getCategories()) {
intentToLaunchThisActivityFromNotification.addCategory(category);
}
}
if (DownloaderClientMarshaller.startDownloadServiceIfRequired(this,
PendingIntent.getActivity(SampleDownloaderActivity
.this,
0, intentToLaunchThisActivityFromNotification,
PendingIntent.FLAG_UPDATE_CURRENT),
SampleDownloaderService.class) != DownloaderClientMarshaller.NO_DOWNLOAD_REQUIRED) {
initializeDownloadUI();
return;
} // otherwise we fall through to starting the movie
} catch (NameNotFoundException e) {
Log.e(LOG_TAG, "Cannot find own package! MAYDAY!");
e.printStackTrace();
}
}
示例7: downloadExpansionFiles
import com.google.android.vending.expansion.downloader.DownloaderClientMarshaller; //导入依赖的package包/类
public void downloadExpansionFiles(Activity activity, ObbDownloadListener listener) {
try {
mListener = listener;
mIsFinished = false;
// Build an Intent to start this activity from the Notification
Intent notifierIntent = new Intent(activity, activity.getClass());
notifierIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
PendingIntent pendingIntent = PendingIntent.getActivity(activity, 0, notifierIntent,
PendingIntent.FLAG_UPDATE_CURRENT);
// Start the download service (if required)
int startResult = DownloaderClientMarshaller.startDownloadServiceIfRequired(activity, pendingIntent,
ObbDownloadService.class);
// If download has started, initialize a ProgressDialog to show
// download progress
if (startResult != DownloaderClientMarshaller.NO_DOWNLOAD_REQUIRED) {
// This is where you do set up to display the download
// progress (next step)
// Instantiate a member instance of IStub
Log.i("APKExpansionDownloader", "Try to download obb files");
mDownloaderClientStub = DownloaderClientMarshaller.CreateStub(this, ObbDownloadService.class);
// Create and show the progress dialog
mDownloadProgressDlg = new MyProgressDialog(activity);
mDownloadProgressDlg.show();
}
// No need to download obb files
else {
Log.i("APKExpansionDownloader", "No need to download obb files");
downloadSuccess();
}
} catch (NameNotFoundException e) {
e.printStackTrace();
downloadFailed();
}
}
示例8: onReceive
import com.google.android.vending.expansion.downloader.DownloaderClientMarshaller; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
try {
DownloaderClientMarshaller.startDownloadServiceIfRequired(context, intent, ObbDownloadService.class);
} catch (NameNotFoundException e) {
e.printStackTrace();
}
}
示例9: onReceive
import com.google.android.vending.expansion.downloader.DownloaderClientMarshaller; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
try {
DownloaderClientMarshaller.startDownloadServiceIfRequired(context,
intent, ExtensionDownloaderService.class);
} catch (NameNotFoundException e) {
e.printStackTrace();
}
}
示例10: startDownloadServiceIfRequired
import com.google.android.vending.expansion.downloader.DownloaderClientMarshaller; //导入依赖的package包/类
public static int startDownloadServiceIfRequired() {
if(expansionFilesDelivered() == 1)
return 0;
// Build an Intent to start this activity from the Notification
Intent notifierIntent = new Intent(mainContext, mainActivity.getClass());
notifierIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
Intent.FLAG_ACTIVITY_CLEAR_TOP);
PendingIntent pendingIntent = PendingIntent.getActivity(mainContext, 0,
notifierIntent, PendingIntent.FLAG_UPDATE_CURRENT);
int startResult = 0;
try {
startResult = DownloaderClientMarshaller.startDownloadServiceIfRequired(mainContext,
pendingIntent, ExtensionDownloaderService.class);
if (startResult != DownloaderClientMarshaller.NO_DOWNLOAD_REQUIRED) {
Extension.mainActivity.runOnUiThread(new Runnable() {
public void run() {
downloaderClient = new DownloaderClientImpl();
mDownloaderClientStub = DownloaderClientMarshaller.CreateStub(downloaderClient,
ExtensionDownloaderService.class);
}
});
}
}
catch (Exception e) {
System.out.println("startDownloadServiceIfRequired error");
e.printStackTrace();
}
return startResult;
}
示例11: checkDownload
import com.google.android.vending.expansion.downloader.DownloaderClientMarshaller; //导入依赖的package包/类
private void checkDownload() {
if (!expansionFilesDelivered()) {
AliteLog.d("File does not exist!", "Expansion file does not exist. Downloading...");
Intent notifierIntent = new Intent(this, getClass());
notifierIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
pendingIntent = PendingIntent.getActivity(this, 0, notifierIntent, PendingIntent.FLAG_UPDATE_CURRENT);
try {
int startResult = DownloaderClientMarshaller.startDownloadServiceIfRequired(this, pendingIntent,
AliteDownloaderService.class);
if (startResult != DownloaderClientMarshaller.NO_DOWNLOAD_REQUIRED) {
downloaderClientStub = DownloaderClientMarshaller.CreateStub(this, AliteDownloaderService.class);
setContentView(R.layout.activity_start_manager);
return;
}
} catch (NameNotFoundException e) {
setStatus("Error while downloading expansion file: " + e.getMessage());
AliteLog.e("Error while Downloading Expansions", "Name not Found: " + e.getMessage(), e);
}
}
AliteFiles.performMount(this,
new IMethodHook() {
private static final long serialVersionUID = -6200281383445218241L;
@Override
public void execute(float deltaTime) {
startGame();
}
}, new ErrorHook());
}
示例12: onReceive
import com.google.android.vending.expansion.downloader.DownloaderClientMarshaller; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
try {
DownloaderClientMarshaller.startDownloadServiceIfRequired(context, intent, AliteDownloaderService.class);
} catch (NameNotFoundException e) {
e.printStackTrace();
}
}
示例13: onReceive
import com.google.android.vending.expansion.downloader.DownloaderClientMarshaller; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
try {
DownloaderClientMarshaller.startDownloadServiceIfRequired(context, intent, LigerDownloaderService.class);
} catch (NameNotFoundException nnfe) {
Timber.d("FAILED TO START DOWNLOAD SERVICE: " + nnfe.getMessage());
}
}
示例14: onReceive
import com.google.android.vending.expansion.downloader.DownloaderClientMarshaller; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
try {
DownloaderClientMarshaller.startDownloadServiceIfRequired(context, intent, FieldGuideDownloaderService.class);
} catch (NameNotFoundException e) {
e.printStackTrace();
}
}
示例15: onReceive
import com.google.android.vending.expansion.downloader.DownloaderClientMarshaller; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
try {
DownloaderClientMarshaller.startDownloadServiceIfRequired(context, intent, SampleDownloaderService.class);
} catch (NameNotFoundException e) {
e.printStackTrace();
}
}