小编AES*_*AES的帖子

在Android中使用strings.xml资源文件存储大文本可以吗?

我正在制作一个离线百科全书应用程序。因此,必须存储大量文本数据,以便在需要时使用它们。那么使用strings.xml资源文件来存储如此大量的文本数据是不是一个好习惯呢?它会导致任何类型的性能问题吗?

java xml storage android

7
推荐指数
1
解决办法
5802
查看次数

可以通过Intent发送大型数组吗?

我想从一个意图发送大数组到另一个意图.该数组包含许多元素(约50-100).所以我想知道通过意图发送大型数组是否是一个很好的编程习惯.无论如何它会影响我的应用程序的性能吗?

java storage android android-intent

4
推荐指数
1
解决办法
74
查看次数

RenderScript模糊覆盖原始位图

我试图使用RenderScript创建一个模糊的位图,将其设置为包含ImageViewLinearLayout的背景.我还想要一个清晰的位图原始副本,以便我可以在ImageView中将其设置为图像.

这是我的代码:

ImageView mainImage;

Bitmap mainBMP, blurredBMP

LinearLayout background;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_work_area);

    getImage(); // obtain bitmap from file
    mainImage.setImageBitmap(mainBMP); // set the original bitmap in imageview 

    // create a blurred bitmap drawable and set it as background for linearlayout
    BitmapDrawable drawable = new BitmapDrawable(getResources(), blur(mainBMP)); 
    mainBackground.setBackground(drawable); 


    registerForContextMenu(objectImage);
    registerForContextMenu(textArea);

}

private void getImage(){
    String filename = getIntent().getStringExtra("image");
    try {
        FileInputStream is = this.openFileInput(filename);
        mainBMP = BitmapFactory.decodeStream(is);
        is.close();
    } …
Run Code Online (Sandbox Code Playgroud)

java android bitmap blur renderscript

2
推荐指数
1
解决办法
236
查看次数

如何翻译字符串数组中的项目?

我有一些字符串数组和很多字符串项,我无法使用翻译编辑器进行翻译.

<string-array name="miocene_infos_list">
    <item>The Miocene era was mostly characterized by arrival of a bizarre array of mammalian megafauna. Astrapotherium was a
        hooved ungulate that looked like a cross between an elephant, a tapir and a rhinoceros. It was a distance relative
        of horse. It had short, prehensile trunk and powerful tusks. It\'s hind limbs were significantly weaker than the fore limbs.
        The nostrils of Astrapotherium were also set unusually high which shows that this prehistoric herbivore may have adapted
        partly …
Run Code Online (Sandbox Code Playgroud)

xml arrays android translation

1
推荐指数
2
解决办法
8107
查看次数