com.google.android.gms.wearable.Asset Java Examples

The following examples show how to use com.google.android.gms.wearable.Asset. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Utils.java    From io2015-codelabs with Apache License 2.0 6 votes vote down vote up
/**
 * Convert an asset into a bitmap object synchronously. Only call this
 * method from a background thread (it should never be called from the
 * main/UI thread as it blocks).
 */
public static Bitmap loadBitmapFromAsset(GoogleApiClient googleApiClient, Asset asset) {
    if (asset == null) {
        throw new IllegalArgumentException("Asset must be non-null");
    }
    // convert asset into a file descriptor and block until it's ready
    InputStream assetInputStream = Wearable.DataApi.getFdForAsset(
            googleApiClient, asset).await().getInputStream();

    if (assetInputStream == null) {
        Log.w(TAG, "Requested an unknown Asset.");
        return null;
    }
    // decode the stream into a bitmap
    return BitmapFactory.decodeStream(assetInputStream);
}
 
Example #2
Source File: WatchServices.java    From WearPay with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Builds an {@link com.google.android.gms.wearable.Asset} from a bitmap. The image that we get
 * back from the camera in "data" is a thumbnail size. Typically, your image should not exceed
 * 320x320 and if you want to have zoom and parallax effect in your app, limit the size of your
 * image to 640x400. Resize your image before transferring to your wearable device.
 */
private static Asset toAsset(Bitmap bitmap) {
    ByteArrayOutputStream byteStream = null;
    try {
        byteStream = new ByteArrayOutputStream();
        bitmap.compress(Bitmap.CompressFormat.PNG, 50, byteStream);
        return Asset.createFromBytes(byteStream.toByteArray());
    } finally {
        if (null != byteStream) {
            try {
                byteStream.close();
            } catch (IOException e) {
                // ignore
            }
        }
    }
}
 
Example #3
Source File: Utils.java    From wear-os-samples with Apache License 2.0 6 votes vote down vote up
/**
 * Convert an asset into a bitmap object synchronously. Only call this
 * method from a background thread (it should never be called from the
 * main/UI thread as it blocks).
 */
public static Bitmap loadBitmapFromAsset(GoogleApiClient googleApiClient, Asset asset) {
    if (asset == null) {
        throw new IllegalArgumentException("Asset must be non-null");
    }
    // convert asset into a file descriptor and block until it's ready
    InputStream assetInputStream = Wearable.DataApi.getFdForAsset(
            googleApiClient, asset).await().getInputStream();

    if (assetInputStream == null) {
        Log.w(TAG, "Requested an unknown Asset.");
        return null;
    }
    // decode the stream into a bitmap
    return BitmapFactory.decodeStream(assetInputStream);
}
 
Example #4
Source File: CanvasActivity.java    From DeviceConnect-Android with MIT License 6 votes vote down vote up
/**
 * Load a bitmap from Asset.
 * @param asset asset
 * @return result of loading
 */
private LoadingResult loadBitmapFromAsset(final Asset asset) {
    InputStream in = getInputStream(asset);
    if (in == null) {
        return LoadingResult.errorOnConnection();
    }
    try {
        Bitmap bitmap = BitmapFactory.decodeStream(in);
        if (bitmap == null) {
            return LoadingResult.errorNotSupportedFormat();
        }
        return LoadingResult.success(bitmap);
    } catch (OutOfMemoryError e) {
        return LoadingResult.errorTooLargeBitmap();
    }
}
 
Example #5
Source File: MainActivity.java    From TutosAndroidFrance with MIT License 6 votes vote down vote up
/**
 * Récupère une bitmap partagée avec le smartphone depuis une position
 */
public Bitmap getBitmap(int position) {
    final Uri uri = getUriForDataItem("/image/" + position);
    if (uri != null) {
        final DataApi.DataItemResult result = Wearable.DataApi.getDataItem(mApiClient, uri).await();
        if (result != null && result.getDataItem() != null) {

            final DataMapItem dataMapItem = DataMapItem.fromDataItem(result.getDataItem());
            final Asset firstAsset = dataMapItem.getDataMap().getAsset("image");
            if (firstAsset != null) {
                return loadBitmapFromAsset(firstAsset);

            }
        }
    }
    return null;
}
 
Example #6
Source File: MainActivity.java    From wear-os-samples with Apache License 2.0 6 votes vote down vote up
/**
 * Sends the asset that was created from the photo we took by adding it to the Data Item store.
 */
private void sendPhoto(Asset asset) {
    PutDataMapRequest dataMap = PutDataMapRequest.create(IMAGE_PATH);
    dataMap.getDataMap().putAsset(IMAGE_KEY, asset);
    dataMap.getDataMap().putLong("time", new Date().getTime());
    PutDataRequest request = dataMap.asPutDataRequest();
    request.setUrgent();

    Task<DataItem> dataItemTask = Wearable.getDataClient(this).putDataItem(request);

    dataItemTask.addOnSuccessListener(
            new OnSuccessListener<DataItem>() {
                @Override
                public void onSuccess(DataItem dataItem) {
                    LOGD(TAG, "Sending image was successful: " + dataItem);
                }
            });
}
 
Example #7
Source File: CalendarQueryService.java    From AndroidWearable-Samples with Apache License 2.0 6 votes vote down vote up
private static Asset getProfilePicture(ContentResolver contentResolver, Context context,
                                       long contactId) {
    if (contactId != -1) {
        // Try to retrieve the profile picture for the given contact.
        Uri contactUri = ContentUris.withAppendedId(Contacts.CONTENT_URI, contactId);
        InputStream inputStream = Contacts.openContactPhotoInputStream(contentResolver,
                contactUri, true /*preferHighres*/);

        if (null != inputStream) {
            try {
                Bitmap bitmap = BitmapFactory.decodeStream(inputStream);
                if (bitmap != null) {
                    return Asset.createFromBytes(toByteArray(bitmap));
                } else {
                    Log.e(TAG, "Cannot decode profile picture for contact " + contactId);
                }
            } finally {
                closeQuietly(inputStream);
            }
        }
    }
    // Use a default background image if the user has no profile picture or there was an error.
    return getDefaultProfile(context.getResources());
}
 
Example #8
Source File: Courier.java    From courier with Apache License 2.0 6 votes vote down vote up
/**
 * Retrieves and returns an InputStream for reading the data from an Asset. This must not be called
 * on the main thread.
 *
 * @param context The Context used to connect to the wearable API.
 * @param asset The asset to open a stream for.
 * @return An InputStream containing the data for the given asset, or null if the Wearable API is unavailable.
 */
@Nullable public static InputStream getAssetInputStream(final Context context, final Asset asset) {
    if(Looper.myLooper()==Looper.getMainLooper()) {
        throw new IllegalStateException("getAssetInputStream can not be called from the UI thread");
    }

    if(WearableApis.hasMockDataApi()) {
        return WearableApis.DataApi.getFdForAsset(null, asset).await().getInputStream();
    }

    WearableApis.ensureApiClient(context);
    if(WearableApis.googleApiClient!=null) {
        return WearableApis.DataApi.getFdForAsset(WearableApis.googleApiClient, asset).await().getInputStream();
    } else {
        return null;
    }
}
 
Example #9
Source File: Utils.java    From io2015-codelabs with Apache License 2.0 6 votes vote down vote up
/**
 * Convert an asset into a bitmap object synchronously. Only call this
 * method from a background thread (it should never be called from the
 * main/UI thread as it blocks).
 */
public static Bitmap loadBitmapFromAsset(GoogleApiClient googleApiClient, Asset asset) {
    if (asset == null) {
        throw new IllegalArgumentException("Asset must be non-null");
    }
    // convert asset into a file descriptor and block until it's ready
    InputStream assetInputStream = Wearable.DataApi.getFdForAsset(
            googleApiClient, asset).await().getInputStream();

    if (assetInputStream == null) {
        Log.w(TAG, "Requested an unknown Asset.");
        return null;
    }
    // decode the stream into a bitmap
    return BitmapFactory.decodeStream(assetInputStream);
}
 
Example #10
Source File: MainActivity.java    From AndroidWearable-Samples with Apache License 2.0 6 votes vote down vote up
/**
 * Builds an {@link com.google.android.gms.wearable.Asset} from a bitmap. The image that we get
 * back from the camera in "data" is a thumbnail size. Typically, your image should not exceed
 * 320x320 and if you want to have zoom and parallax effect in your app, limit the size of your
 * image to 640x400. Resize your image before transferring to your wearable device.
 */
private static Asset toAsset(Bitmap bitmap) {
    ByteArrayOutputStream byteStream = null;
    try {
        byteStream = new ByteArrayOutputStream();
        bitmap.compress(Bitmap.CompressFormat.PNG, 100, byteStream);
        return Asset.createFromBytes(byteStream.toByteArray());
    } finally {
        if (null != byteStream) {
            try {
                byteStream.close();
            } catch (IOException e) {
                // ignore
            }
        }
    }
}
 
Example #11
Source File: NotificationActivity.java    From WearOngoingNotificationSample with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_notification);

    mImageView = (ImageView) findViewById(R.id.image_view);
    mTextView = (TextView) findViewById(R.id.text_view);

    Intent intent = getIntent();
    if (intent != null) {
        mTextView.setText(intent.getStringExtra(EXTRA_TITLE));

        final Asset asset = intent.getParcelableExtra(EXTRA_IMAGE);

        loadBitmapFromAsset(this, asset, mImageView);
    }

    random = new Random();
    mTextView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            mTextView.setTextColor(Color.argb(255, random.nextInt(256), random.nextInt(256), random.nextInt(256)));
        }
    });
}
 
Example #12
Source File: DataItemRecord.java    From android_packages_apps_GmsCore with Apache License 2.0 6 votes vote down vote up
public static DataItemRecord fromSetDataItem(SetDataItem setDataItem) {
    DataItemRecord record = new DataItemRecord();
    record.dataItem = new DataItemInternal(Uri.parse(setDataItem.uri));
    if (setDataItem.data != null) record.dataItem.data = setDataItem.data.toByteArray();
    if (setDataItem.assets != null) {
        for (AssetEntry asset : setDataItem.assets) {
            record.dataItem.addAsset(asset.key, Asset.createFromRef(asset.value.digest));
        }
    }
    record.source = setDataItem.source;
    record.seqId = setDataItem.seqId;
    record.v1SeqId = -1;
    record.lastModified = setDataItem.lastModified;
    record.deleted = setDataItem.deleted == null ? false : setDataItem.deleted;
    record.packageName = setDataItem.packageName;
    record.signatureDigest = setDataItem.signatureDigest;
    return record;
}
 
Example #13
Source File: NotificationListenerService.java    From wear-notify-for-reddit with Apache License 2.0 6 votes vote down vote up
private Bitmap loadBitmapFromAsset(Asset asset) {
    Logger.log("loadBitmapFromAsset");
    ConnectionResult result = mGoogleApiClient.blockingConnect(TIMEOUT_MS,
            TimeUnit.MILLISECONDS);
    if (!result.isSuccess()) {
        return null;
    }
    // convert asset into a file descriptor and block until it's ready
    InputStream assetInputStream = Wearable.DataApi.getFdForAsset(mGoogleApiClient, asset)
            .await()
            .getInputStream();
    mGoogleApiClient.disconnect();

    if (assetInputStream == null) {
        Logger.log("Requested an unknown Asset");
        return null;
    }
    // decode the stream into a bitmap
    return BitmapFactory.decodeStream(assetInputStream);
}
 
Example #14
Source File: DaVinci.java    From DaVinci with Apache License 2.0 6 votes vote down vote up
public Bitmap getBitmapFromDataApi(String path) {
    final Uri uri = getUriForDataItem(path);

    Log.d(TAG, "Load bitmap " + path + " " + uri.toString());

    if (uri != null) {
        final DataApi.DataItemResult result = Wearable.DataApi.getDataItem(mApiClient, uri).await();
        if (result != null && result.getDataItem() != null) {

            Log.d(TAG, "From DataApi");

            final DataMapItem dataMapItem = DataMapItem.fromDataItem(result.getDataItem());
            final Asset firstAsset = dataMapItem.getDataMap().getAsset(imageAssetName);
            if (firstAsset != null) {
                Bitmap bitmap = loadBitmapFromAsset(firstAsset);
                return bitmap;
            }
        }
    }

    Log.d(TAG, "can't find " + path + " [" + imageAssetName + "] in DataApi");

    return null;
}
 
Example #15
Source File: MainActivity.java    From wear with MIT License 6 votes vote down vote up
@Override
public void onDataChanged(DataEvent event) {
    if (DataEvent.TYPE_CHANGED == event.getType()) {
        DataMapItem item = DataMapItem.fromDataItem(event.getDataItem());
        Asset asset = item.getDataMap().getAsset(ASSET_KEY);

        ConnectionResult result = mGoogleApiClient
                .blockingConnect(TIMEOUT, TimeUnit.SECONDS);
        if (result.isSuccess()) {
            InputStream stream = Wearable.DataApi
                    .getFdForAsset(mGoogleApiClient, asset)
                    .await().getInputStream();
            if (null != asset) {
                Bitmap bitmap = BitmapFactory.decodeStream(stream);
                showAsset(bitmap);
            }
        }
    } else if (DataEvent.TYPE_DELETED == event.getType()) {
        hideAsset();
    }
}
 
Example #16
Source File: MainActivity.java    From AndroidWearable-Samples with Apache License 2.0 6 votes vote down vote up
/**
 * Sends the asset that was created form the photo we took by adding it to the Data Item store.
 */
private void sendPhoto(Asset asset) {
    PutDataMapRequest dataMap = PutDataMapRequest.create(IMAGE_PATH);
    dataMap.getDataMap().putAsset(IMAGE_KEY, asset);
    dataMap.getDataMap().putLong("time", new Date().getTime());
    PutDataRequest request = dataMap.asPutDataRequest();
    Wearable.DataApi.putDataItem(mGoogleApiClient, request)
            .setResultCallback(new ResultCallback<DataItemResult>() {
                @Override
                public void onResult(DataItemResult dataItemResult) {
                    LOGD(TAG, "Sending image was successful: " + dataItemResult.getStatus()
                            .isSuccess());
                }
            });

}
 
Example #17
Source File: DataItemRecord.java    From android_packages_apps_GmsCore with Apache License 2.0 6 votes vote down vote up
public SetDataItem toSetDataItem() {
    SetDataItem.Builder builder = new SetDataItem.Builder()
            .packageName(packageName)
            .signatureDigest(signatureDigest)
            .uri(dataItem.uri.toString())
            .seqId(seqId)
            .deleted(deleted)
            .lastModified(lastModified);
    if (source != null) builder.source(source);
    if (dataItem.data != null) builder.data(ByteString.of(dataItem.data));
    List<AssetEntry> protoAssets = new ArrayList<AssetEntry>();
    Map<String, Asset> assets = dataItem.getAssets();
    for (String key : assets.keySet()) {
        protoAssets.add(new AssetEntry.Builder()
                .key(key)
                .unknown3(4)
                .value(new org.microg.wearable.proto.Asset.Builder()
                        .digest(assets.get(key).getDigest())
                        .build()).build());
    }
    builder.assets(protoAssets);
    return builder.build();
}
 
Example #18
Source File: DaVinci.java    From DaVinci with Apache License 2.0 6 votes vote down vote up
/**
 * When received assets from DataApi
 *
 * @param dataEvents
 */
@Override
public void onDataChanged(DataEventBuffer dataEvents) {
    for (DataEvent dataEvent : dataEvents) {
        String path = dataEvent.getDataItem().getUri().getPath();
        Log.d(TAG, "onDataChanged(" + path + ")");
        if (path.startsWith(DAVINCI_PATH)) { //if it's a davinci path
            Log.d(TAG, "davinci-onDataChanged " + path);

            //download the bitmap and add it to cache
            Asset asset = DataMapItem.fromDataItem(dataEvent.getDataItem()).getDataMap().getAsset(DAVINCI_ASSET_IMAGE);
            Bitmap bitmap = loadBitmapFromAsset(asset);
            if (bitmap != null)
                saveBitmap(getKey(path), bitmap);

            //callbacks
            callIntoWaiting(path);
        }
    }
}
 
Example #19
Source File: DataItemRecord.java    From android_packages_apps_GmsCore with Apache License 2.0 6 votes vote down vote up
public static DataItemRecord fromCursor(Cursor cursor) {
    DataItemRecord record = new DataItemRecord();
    record.packageName = cursor.getString(1);
    record.signatureDigest = cursor.getString(2);
    record.dataItem = new DataItemInternal(cursor.getString(3), cursor.getString(4));
    record.seqId = cursor.getLong(5);
    record.deleted = cursor.getLong(6) > 0;
    record.source = cursor.getString(7);
    record.dataItem.data = cursor.getBlob(8);
    record.lastModified = cursor.getLong(9);
    record.assetsAreReady = cursor.getLong(10) > 0;
    if (cursor.getString(11) != null) {
        record.dataItem.addAsset(cursor.getString(11), Asset.createFromRef(cursor.getString(12)));
        while (cursor.moveToNext()) {
            if (cursor.getLong(5) == record.seqId) {
                record.dataItem.addAsset(cursor.getString(11), Asset.createFromRef(cursor.getString(12)));
            }
        }
        cursor.moveToPrevious();
    }
    return record;
}
 
Example #20
Source File: MessageHandler.java    From android_packages_apps_GmsCore with Apache License 2.0 5 votes vote down vote up
@Override
public void onSetAsset(SetAsset setAsset) {
    Log.d(TAG, "onSetAsset: " + setAsset);
    Asset asset;
    if (setAsset.data != null) {
        asset = Asset.createFromBytes(setAsset.data.toByteArray());
    } else {
        asset = Asset.createFromRef(setAsset.digest);
    }
    wearable.addAssetToDatabase(asset, setAsset.appkeys.appKeys);
}
 
Example #21
Source File: DataBundleUtil.java    From android_external_GmsLib with Apache License 2.0 5 votes vote down vote up
@Override
DataBundleValue create(long[] value, List<Asset> assets) {
    List<Long> longList = new ArrayList<Long>(value.length);
    for (long l : value) {
        longList.add(l);
    }
    return new DataBundleValue.Builder().longArray(longList).build();
}
 
Example #22
Source File: MainActivity.java    From AndroidWearable-Samples with Apache License 2.0 5 votes vote down vote up
/**
 * Extracts {@link android.graphics.Bitmap} data from the
 * {@link com.google.android.gms.wearable.Asset}
 */
private Bitmap loadBitmapFromAsset(GoogleApiClient apiClient, Asset asset) {
    if (asset == null) {
        throw new IllegalArgumentException("Asset must be non-null");
    }

    InputStream assetInputStream = Wearable.DataApi.getFdForAsset(
            apiClient, asset).await().getInputStream();

    if (assetInputStream == null) {
        Log.w(TAG, "Requested an unknown Asset.");
        return null;
    }
    return BitmapFactory.decodeStream(assetInputStream);
}
 
Example #23
Source File: WatchfaceLoader.java    From APDE with GNU General Public License v2.0 5 votes vote down vote up
protected boolean makeFileFromAsset(Asset asset, File destFile) {
	try {
		InputStream inputStream = Tasks.await(Wearable.getDataClient(this).getFdForAsset(asset)).getInputStream();
		if (inputStream != null) {
			createFileFromInputStream(inputStream, destFile, true);
			return true;
		}
	} catch (ExecutionException | InterruptedException | IOException e) {
		e.printStackTrace();
	}
	
	return false;
}
 
Example #24
Source File: RetrieveService.java    From wear-notify-for-reddit with Apache License 2.0 5 votes vote down vote up
private void sendPostsToWearable(@NonNull List<Post> posts, @NonNull final String msg,
                                 @Nullable SimpleArrayMap<String, Asset> assets) {
    if (mGoogleApiClient.isConnected()) {
        // convert to json for sending to watch and to save to shared prefs
        // don't need to preserve the order like having separate String lists, can more easily add/remove fields
        PutDataMapRequest mapRequest = PutDataMapRequest.create(Constants.PATH_REDDIT_POSTS);
        DataMap dataMap = mapRequest.getDataMap();

        if (assets != null && !assets.isEmpty()) {
            for (int i = 0; i < assets.size(); i++) {
                dataMap.putAsset(assets.keyAt(i), assets.valueAt(i));
            }
        }

        dataMap.putLong("timestamp", System.currentTimeMillis());
        dataMap.putString(Constants.KEY_REDDIT_POSTS, mGson.toJson(posts));
        dataMap.putBoolean(Constants.KEY_DISMISS_AFTER_ACTION,
                mUserStorage.openOnPhoneDismissesAfterAction());
        dataMap.putIntegerArrayList(Constants.KEY_ACTION_ORDER,
                mWearableActionStorage.getSelectedActionIds());

        PutDataRequest request = mapRequest.asPutDataRequest();
        Wearable.DataApi.putDataItem(mGoogleApiClient, request)
                .setResultCallback(dataItemResult -> {
                    Timber.d(msg + ", final timestamp: " + mUserStorage.getTimestamp() + " result: " + dataItemResult
                            .getStatus());

                    if (dataItemResult.getStatus().isSuccess()) {
                        if (mGoogleApiClient.isConnected()) {
                            mGoogleApiClient.disconnect();
                        }
                    } else {
                        Timber.d("Failed to send posts to wearable " + dataItemResult.getStatus()
                                .getStatusMessage());
                    }
                });
    }
}
 
Example #25
Source File: NodeDatabaseHelper.java    From android_packages_apps_GmsCore with Apache License 2.0 5 votes vote down vote up
public boolean hasAsset(Asset asset) {
    Cursor cursor = getReadableDatabase().query("assets", new String[]{"dataPresent"}, "digest=?", new String[]{asset.getDigest()}, null, null, null);
    if (cursor == null) return false;
    try {
        return (cursor.moveToNext() && cursor.getInt(0) == 1);
    } finally {
        cursor.close();
    }
}
 
Example #26
Source File: WearService.java    From WearPay with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Extracts {@link android.graphics.Bitmap} data from the
 * {@link com.google.android.gms.wearable.Asset}
 */
protected Bitmap loadBitmapFromAsset(Asset asset) {
    if (asset == null) {
        throw new IllegalArgumentException("Asset must be non-null");
    }

    InputStream assetInputStream = Wearable.DataApi.getFdForAsset(
            mGoogleApiClient, asset).await().getInputStream();

    if (assetInputStream == null) {
        return null;
    }
    return BitmapFactory.decodeStream(assetInputStream);
}
 
Example #27
Source File: DataBundleUtil.java    From android_external_GmsLib with Apache License 2.0 5 votes vote down vote up
@Override
float[] read(DataBundleValue value, List<Asset> assets) {
    float[] floatArr = new float[value.floatArray.size()];
    for (int i = 0; i < value.floatArray.size(); i++) {
        floatArr[i] = value.floatArray.get(i);
    }
    return floatArr;
}
 
Example #28
Source File: DataBundleUtil.java    From android_external_GmsLib with Apache License 2.0 5 votes vote down vote up
@Override
DataBundleValue create(float[] value, List<Asset> assets) {
    List<Float> floatList = new ArrayList<Float>(value.length);
    for (float f : value) {
        floatList.add(f);
    }
    return new DataBundleValue.Builder().floatArray(floatList).build();
}
 
Example #29
Source File: WatchfaceLoader.java    From APDE with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void onDataChanged(DataEventBuffer dataEvents) {
	// Use only the most recent asset
	// I don't think we will ever get more than one at once,
	// but there's no sense in installing an old version of the APK
	
	Asset asset = null;
	
	for (DataEvent dataEvent : dataEvents) {
		if (dataEvent.getType() == DataEvent.TYPE_CHANGED) {
			DataMapItem dataMapItem = DataMapItem.fromDataItem(dataEvent.getDataItem());
			asset = dataMapItem.getDataMap().getAsset("apk");
		}
	}
	
	// We tried displaying a toast, but it causes problems
	
	// Make apk file in internal storage
	File apkFile = WatchFaceUtil.getSketchApk(this);
	
	if (asset != null && makeFileFromAsset(asset, apkFile)) {
		clearAssets();
		unpackAssets(apkFile);
		clearSharedPrefs();
		updateServiceType();
		updateWatchFaceVisibility();
		launchWatchFaceChooser();
	}
}
 
Example #30
Source File: DataBundleUtil.java    From android_external_GmsLib with Apache License 2.0 5 votes vote down vote up
private static List<DataBundleEntry> createEntryList(DataMap dataMap, List<Asset> assets) {
    List<DataBundleEntry> entries = new ArrayList<DataBundleEntry>();
    for (String key : dataMap.keySet()) {
        entries.add(getTypeHelper(dataMap.getType(key)).loadAndCreateEntry(dataMap, key, assets));
    }
    return entries;
}