当前位置: 首页>>代码示例>>Java>>正文


Java Helpers.getExpansionAPKFileName方法代码示例

本文整理汇总了Java中com.google.android.vending.expansion.downloader.Helpers.getExpansionAPKFileName方法的典型用法代码示例。如果您正苦于以下问题:Java Helpers.getExpansionAPKFileName方法的具体用法?Java Helpers.getExpansionAPKFileName怎么用?Java Helpers.getExpansionAPKFileName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.android.vending.expansion.downloader.Helpers的用法示例。


在下文中一共展示了Helpers.getExpansionAPKFileName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: RemoveOBBFile

import com.google.android.vending.expansion.downloader.Helpers; //导入方法依赖的package包/类
static private void RemoveOBBFile(int OBBToDelete) {
	
	for (OBBData.XAPKFile xf : OBBData.xAPKS) {
	    String fileName = Helpers.getExpansionAPKFileName(DownloaderActivity._download, xf.mIsMain, xf.mFileVersion);
		switch(OBBToDelete)
		{
		case 0:
			String fileForNewFile = Helpers.generateSaveFileName(DownloaderActivity._download, fileName);
			File srcFile = new File(fileForNewFile);
			srcFile.delete();
			break;
		case 1:
			String fileForDevFile = Helpers.generateSaveFileNameDevelopment(DownloaderActivity._download, fileName);
			File srcDevFile = new File(fileForDevFile);
			srcDevFile.delete();
			break;
		}
	}		
}
 
开发者ID:FallingUpGame,项目名称:FallingUp,代码行数:20,代码来源:DownloaderActivity.java

示例2: doInBackground

import com.google.android.vending.expansion.downloader.Helpers; //导入方法依赖的package包/类
@Override
protected Boolean doInBackground(Void... params) {
    try {
        for (XAPKFile xFile : mXFiles) {
            String fileName = Helpers.getExpansionAPKFileName(mContext, xFile.mIsMain, xFile.mFileVersion);
            String srcFileName = Helpers.generateSaveFileName(mContext, fileName);
            File srcFile = new File(srcFileName);
            if (!unzip(srcFile, mDestFolder)) {
                return false;
            }
        }
        return true;
    } catch (Exception e) {
        return false;
    }
}
 
开发者ID:cclink,项目名称:ObbDownloadHelper,代码行数:17,代码来源:ObbUnzipHelper.java

示例3: expansionFilesDelivered

import com.google.android.vending.expansion.downloader.Helpers; //导入方法依赖的package包/类
/**
 * Go through each of the Expansion APK files defined in the project and
 * determine if the files are present and match the required size. Free
 * applications should definitely consider doing this, as this allows the
 * application to be launched for the first time without having a network
 * connection present. Paid applications that use LVL should probably do at
 * least one LVL check that requires the network to be present, so this is
 * not as necessary.
 * 
 * @return true if they are present.
 */
public boolean expansionFilesDelivered() {
    // Determine whether the apk expansion files exist, and the file size is
    // correct
    for (XAPKFile xf : xAPKS) {
        String fileName = Helpers.getExpansionAPKFileName(mContext, xf.mIsMain, xf.mFileVersion);
        if (!Helpers.doesFileExist(mContext, fileName, xf.mFileSize, false)) {
            if (xf.mIsMain) {
                Log.i("APKExpansionDownloader", "Expansion files are not delivered: main obb does not exist");
            } else {
                Log.i("APKExpansionDownloader", "Expansion files are not delivered: patch obb does not exist");
            }
            return false;
        }
    }
    Log.i("APKExpansionDownloader", "Expansion files are already delivered");
    return true;
}
 
开发者ID:cclink,项目名称:ObbDownloadHelper,代码行数:29,代码来源:ObbDownloadHelper.java

示例4: doInBackground

import com.google.android.vending.expansion.downloader.Helpers; //导入方法依赖的package包/类
@Override
protected Boolean doInBackground(Void... params) {
    try {
        for (XAPKFile xFile : mXFiles) {
            String fileName = Helpers.getExpansionAPKFileName(mContext, xFile.mIsMain, xFile.mFileVersion);
            String srcFileName = Helpers.generateSaveFileName(mContext, fileName);
            File srcFile = new File(srcFileName);
            if (!copy(srcFile, mDestFolder)) {
                return false;
            }
        }
        return true;
    } catch (Exception e) {
        return false;
    }
}
 
开发者ID:cclink,项目名称:ObbDownloadHelper,代码行数:17,代码来源:ObbCopyHelper.java

示例5: expansionFilesDelivered

import com.google.android.vending.expansion.downloader.Helpers; //导入方法依赖的package包/类
/**
  * Go through each of the APK Expansion files defined in the structure above
  * and determine if the files are present and match the required size. Free
  * applications should definitely consider doing this, as this allows the
  * application to be launched for the first time without having a network
  * connection present. Paid applications that use LVL should probably do at
  * least one LVL check that requires the network to be present, so this is
  * not as necessary.
  * 
  * @return true if they are present.
  */
 boolean expansionFilesDelivered() {
		
     for (OBBData.XAPKFile xf : OBBData.xAPKS) {
         String fileName = Helpers.getExpansionAPKFileName(this, xf.mIsMain, xf.mFileVersion);
GameActivity.Log.debug("Checking for file : " + fileName);
String fileForNewFile = Helpers.generateSaveFileName(this, fileName);
String fileForDevFile = Helpers.generateSaveFileNameDevelopment(this, fileName);
GameActivity.Log.debug("which is really being resolved to : " + fileForNewFile + "\n Or : " + fileForDevFile);
         if (!Helpers.doesFileExist(this, fileName, xf.mFileSize, false) &&
	!Helpers.doesFileExistDev(this, fileName, xf.mFileSize, false))
             return false;
     }
     return true;
 }
 
开发者ID:FallingUpGame,项目名称:FallingUp,代码行数:26,代码来源:DownloaderActivity.java

示例6: onlySingleExpansionFileFound

import com.google.android.vending.expansion.downloader.Helpers; //导入方法依赖的package包/类
boolean onlySingleExpansionFileFound() {
	for (OBBData.XAPKFile xf : OBBData.xAPKS) {
           String fileName = Helpers.getExpansionAPKFileName(this, xf.mIsMain, xf.mFileVersion);
		GameActivity.Log.debug("Checking for file : " + fileName);
		String fileForNewFile = Helpers.generateSaveFileName(this, fileName);
		String fileForDevFile = Helpers.generateSaveFileNameDevelopment(this, fileName);
		
		if (Helpers.doesFileExist(this, fileName, xf.mFileSize, false) &&
			Helpers.doesFileExistDev(this, fileName, xf.mFileSize, false))
               return false;
	}
	
	return true;		
}
 
开发者ID:FallingUpGame,项目名称:FallingUp,代码行数:15,代码来源:DownloaderActivity.java

示例7: expansionFilesUptoData

import com.google.android.vending.expansion.downloader.Helpers; //导入方法依赖的package包/类
boolean expansionFilesUptoData() {

	File cacheFile = getFileDetailsCacheFile();
	// Read data into an array or something...
	Map<String, Long> fileDetailsMap = new HashMap<String, Long>();
	
	if(cacheFile.exists()) {
		try {
			FileReader fileCache = new FileReader(cacheFile);
			BufferedReader bufferedFileCache = new BufferedReader(fileCache);
			List<String> lines = new ArrayList<String>();
			String line = null;
			while ((line = bufferedFileCache.readLine()) != null) {
				lines.add(line);
			}
			bufferedFileCache.close();
			
			for(String dataLine : lines)
			{
				GameActivity.Log.debug("Splitting dataLine => " + dataLine);
				String[] parts = dataLine.split(",");
				fileDetailsMap.put(parts[0], Long.parseLong(parts[1]));
			}
		}
		catch(Exception e)
		{
			GameActivity.Log.debug("Exception thrown during file details reading.");
			e.printStackTrace();
			fileDetailsMap.clear();
		}	
	}
	
	for (OBBData.XAPKFile xf : OBBData.xAPKS) {
           String fileName = Helpers.getExpansionAPKFileName(this, xf.mIsMain, xf.mFileVersion);
		String fileForNewFile = Helpers.generateSaveFileName(this, fileName);
		String fileForDevFile = Helpers.generateSaveFileNameDevelopment(this, fileName);
		// check to see if time/data on files match cached version
		// if not return false
		File srcFile = new File(fileForNewFile);
		File srcDevFile = new File(fileForDevFile);
		long lastModified = srcFile.lastModified();
		long lastModifiedDev = srcDevFile.lastModified();
		if(!(srcFile.exists() && fileDetailsMap.containsKey(fileName) && lastModified == fileDetailsMap.get(fileName)) 
			&&
		   !(srcDevFile.exists() && fileDetailsMap.containsKey(fileName) && lastModifiedDev == fileDetailsMap.get(fileName)))
			return false;
	}
	return true;
}
 
开发者ID:FallingUpGame,项目名称:FallingUp,代码行数:50,代码来源:DownloaderActivity.java

示例8: xAPKFilesReadable

import com.google.android.vending.expansion.downloader.Helpers; //导入方法依赖的package包/类
boolean xAPKFilesReadable() {
    for (XAPKFile xf : xAPKS) {
        String fileName = Helpers.getExpansionAPKFileName(this, xf.mIsMain, xf.mFileVersion);
        if ( Helpers.getFileStatus(this, fileName) == Helpers.FS_CANNOT_READ ) {
            return false;
        }
    }
    return true;
}
 
开发者ID:google,项目名称:play-apk-expansion,代码行数:10,代码来源:SampleDownloaderActivity.java

示例9: checkXAPKs

import com.google.android.vending.expansion.downloader.Helpers; //导入方法依赖的package包/类
public static boolean checkXAPKs(Context context, XAPKFile[] xfs) {
    if (xfs.length == 0) {
        return false;
    }
    for (XAPKFile xf : xfs) {
        String fileName = Helpers.getExpansionAPKFileName(context, xf.mIsMain, xf.mFileVersion);
        if (!Helpers.doesFileExist(context, fileName, xf.mFileSize, false)) {
            return false;
        }
    }
    return true;
}
 
开发者ID:cclink,项目名称:ObbDownloadHelper,代码行数:13,代码来源:XAPKFileUitl.java

示例10: expansionFilesDelivered

import com.google.android.vending.expansion.downloader.Helpers; //导入方法依赖的package包/类
public static int expansionFilesDelivered() {
    String fileName = Helpers.getExpansionAPKFileName(mainContext, true,version);
    System.out.println("Checking " + fileName);
    if (Helpers.doesFileExist(mainContext, fileName, bytes, false))
        return 1;
    return 0;
}
 
开发者ID:thomasuster,项目名称:android-expansion,代码行数:8,代码来源:Expansion.java

示例11: expansionFilesDelivered

import com.google.android.vending.expansion.downloader.Helpers; //导入方法依赖的package包/类
private boolean expansionFilesDelivered() {
       File oldObb = new File(Environment.getExternalStorageDirectory() + "/Android/obb/de.phbouillon.android.games.alite/main.2170.de.phbouillon.android.games.alite.obb");
       if (oldObb.exists()) {
       	oldObb.delete();
       }
    String fileName = Helpers.getExpansionAPKFileName(this, true, AliteConfig.EXTENSION_FILE_VERSION);
    File fileForNewFile = new File(Helpers.generateSaveFileName(this, fileName));
    AliteLog.e("Check for OBB", "OBB exists? " + fileForNewFile.getAbsolutePath());
    return Helpers.doesFileExist(this, fileName, AliteConfig.EXTENSION_FILE_LENGTH, false);
}
 
开发者ID:CmdrStardust,项目名称:Alite,代码行数:11,代码来源:AliteStartManager.java

示例12: checkExistance

import com.google.android.vending.expansion.downloader.Helpers; //导入方法依赖的package包/类
private boolean checkExistance(ExpansionFile[] xapks, Activity activity) {

        boolean check = true;
        for (ExpansionFile xf : xapks) {
            String fileName = Helpers.getExpansionAPKFileName(activity, xf.mIsMain, xf.mFileVersion);
            if (!Helpers.doesFileExist(activity, fileName, xf.mFileSize, false)) {
                check = false;
                break;
            }
        }
        return check;
    }
 
开发者ID:alebianco,项目名称:ANE-Android-Expansion,代码行数:13,代码来源:HasExpansionFiles.java

示例13: xAPKFilesDelivered

import com.google.android.vending.expansion.downloader.Helpers; //导入方法依赖的package包/类
/**
 * Go through each of the Expansion APK files defined in the project and
 * determine if the files are present and match the required size. Free
 * applications should definitely consider doing this, as this allows the
 * application to be launched for the first time without having a network
 * connection present. Paid applications that use LVL should probably do at
 * least one LVL check that requires the network to be present, so this is
 * not as necessary.
 *
 * @return true if they are present.
 */
boolean xAPKFilesDelivered() {
    for (XAPKFile xf : xAPKS) {
        String fileName = Helpers.getExpansionAPKFileName(this, xf.mIsMain, xf.mFileVersion);
        if (!Helpers.doesFileExist(this, fileName, xf.mFileSize, false))
            return false;
    }
    return true;
}
 
开发者ID:google,项目名称:play-apk-expansion,代码行数:20,代码来源:SampleDownloaderActivity.java

示例14: expansionFilesDelivered

import com.google.android.vending.expansion.downloader.Helpers; //导入方法依赖的package包/类
/**
 * Go through each of the APK Expansion files defined in the structure above
 * and determine if the files are present and match the required size. Free
 * applications should definitely consider doing this, as this allows the
 * application to be launched for the first time without having a network
 * connection present. Paid applications that use LVL should probably do at
 * least one LVL check that requires the network to be present, so this is
 * not as necessary.
 * 
 * @return true if they are present.
 */
boolean expansionFilesDelivered() {
	for (XAPKFile xf : xAPKS) {
		String fileName = Helpers.getExpansionAPKFileName(this, xf.mIsMain, xf.mFileVersion);
		if (!Helpers.doesFileExist(this, fileName, xf.mFileSize, false))
			return false;
	}
	return true;
}
 
开发者ID:museumsvictoria,项目名称:mv-fieldguide-android,代码行数:20,代码来源:SplashActivity.java

示例15: expansionFilesDelivered

import com.google.android.vending.expansion.downloader.Helpers; //导入方法依赖的package包/类
/**
 * Go through each of the APK Expansion files defined in the structure above
 * and determine if the files are present and match the required size. Free
 * applications should definitely consider doing this, as this allows the
 * application to be launched for the first time without having a network
 * connection present. Paid applications that use LVL should probably do at
 * least one LVL check that requires the network to be present, so this is
 * not as necessary.
 * 
 * @return true if they are present.
 */
boolean expansionFilesDelivered() {
    for (XAPKFile xf : xAPKS) {
        String fileName = Helpers.getExpansionAPKFileName(this, xf.mIsMain, xf.mFileVersion);
        if (!Helpers.doesFileExist(this, fileName, xf.mFileSize, false))
            return false;
    }
    return true;
}
 
开发者ID:alebianco,项目名称:ANE-Android-Expansion,代码行数:20,代码来源:SampleDownloaderActivity.java


注:本文中的com.google.android.vending.expansion.downloader.Helpers.getExpansionAPKFileName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。