如何把APK文件内的壁纸? [英] How to put a wallpaper inside an apk file?

查看:396
本文介绍了如何把APK文件内的壁纸?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我打算发布一个漂亮的时钟控件,我想包括它pretty壁纸(要做到这一点,因为previously有像我能得到匹配的壁纸一些意见? ;))

I'm planning to release a nice clock widget and I'd like to include a pretty wallpaper with it (want to do this because previously got some comments like "can i get the matching wallpaper? ;)")

于是,我就谷歌就如何放一些映像文件内的apk,以便它在安装后出现在壁纸选择列表。我的意思是在家做的时候出现=>菜单=>壁纸=>壁纸图库或照片列表 - 无论

So I tried to google on how to put some image file inside apk so that it would appear in wallpapers selection list after installation. I mean the list which appears when doing Home=>Menu=>Wallpaper=>Wallpaper Gallery or Pictures - whatever.

到目前为止,没有发现任何线索,于是决定试着问这里。

So far didn't find any hints, so decided to try to ask here.

这是如何做到这一点任何提示?

Any hints on how to do that?

推荐答案

您可以打包在res /原始壁纸,然后当你的应用程序大火了,第一次,尝试将它复制到SD卡目录/​​媒体/图片。

You could package the wallpaper in res/raw, and then when your app fires up for the first time, attempt to copy it to the sdcard directory /media/pictures.

您应该使用诸如 getExternalStorageDirectory getExternalStoragePublicDirectory 的(根据API级别)打开该文件。

You should be using methods such as getExternalStorageDirectory or getExternalStoragePublicDirectory (depending on the API level) to open the file.

http://developer.android.com/guide/topics/data/data-storage.html#filesExternal

这篇关于如何把APK文件内的壁纸?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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