android-resources

Library to encryption and decryption resources

戏子无情 提交于 2019-12-05 10:57:25
My question is related to following questions. Security of Android assets folder Assets Security in Android Basically the application which I am making has some mp3 resources which I wanted to secure. So is there library which work on android to encrypt and then decrypt resources especially mp3 files. Thanks. Zed Keep in mind that any method of encryption that you use will need storing the key to decrypt the encrypted data. This key will have to be available to your application and thus to anyone who has access to your application. By encrypting the data you change the problem of hiding your

How to include 2 variants of Serbian Language? with Latin letters and with Cyrillic letters

99封情书 提交于 2019-12-05 09:27:36
I have an android app and I want to translate to Serbian and I want both variants of the language: with Latin letters and with Cyrillic letters. I tried this variants: value-sr-rRS-Latn , value-sr-Latn , value-sr-rRS-Cyrl , value-sr-Cyrl but not of that is working. I get this error: android-apt-compiler: [NAMEOFAPP] invalid resource directory name: [path]\res/value-sr-rRS-Latn On Android documentation about res dirs and Locale I can't find this option. Can I make 2 dirs with 2 variants of the language? And how? Thank you vortexwolf I just tested Android localization and I found out that you

Android IndexOutOfBound Exception for resource getString

…衆ロ難τιáo~ 提交于 2019-12-05 08:05:15
Note: This is specific problem with android system, not simply out of bound exception which some suggesting duplicate I have a problem with investigating the cause of the exception. I'm trying to get string resource text(which is HTML): val string = getString(R.string.long_html_text) This HTML is of course valid(works on emulator and other real devices) but not on real device LGE Nexus 5X API 27. The html text has 40113 characters. When I am trying to get this string resource as above I am getting this Exception: 04-17 14:38:17.136 2847-2847/com.myapp.tmt.app.myapp E/AndroidRuntime: FATAL

findViewById(android.R.id.progress) returns null

三世轮回 提交于 2019-12-05 05:58:43
The Android Developers reference lists R.id.progress among the built-in View resources available. Yet, when I issue (in my activity class) the statement: View pv = getWindow().findViewById(android.R.id.progress); It returns null. It returns null even when I use it in conjunction with the ProgressBar class: ProgressBar pv = (ProgressBar) getWindow().findViewById(android.R.id.progress); And it returns null even without the getWindow() : ProgressBar pv = (ProgressBar) findViewById(android.R.id.progress); Any idea why? To make sure I'm not hallucinating, I followed @Geobits's advice and created a

How to add locale(with country) to font resources (Support Library v26)?

蓝咒 提交于 2019-12-05 03:13:09
Google published the official font resources handling since support library v26 released: https://developer.android.com/guide/topics/ui/look-and-feel/fonts-in-xml.html However, looks like I cannot add country qualifier for the font resources folder. I have an app which has 3 languages: English, Traditional Chinese and Simplified Chinese. And I tried to name my font folder under res this way: font font-zh font-zh_CN (I have also tried font-zh-CN ) (Note that zh is the language, while CN is the country. With some more context for your information - In China we all use "Chinese", but there are

android: how to add children from an xml layout into a custom view

不羁岁月 提交于 2019-12-05 01:55:56
In my xml layouts I have a custom view in which i will put some children like: <com.proj.layouts.components.ScrollLayout android:id="@+id/slBody" android:layout_width="700dp" android:layout_height="400dp"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="child1"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="child2"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="child3"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap

Using a BindingAdapter with a string-array from the resources

≯℡__Kan透↙ 提交于 2019-12-05 01:33:29
I have an almost simple idea: I want to generate an Adapter for a spinner with the data binding API and an BindingAdapter. Here is the XML I want to use: <Spinner android:id="@+id/country" android:layout_width="wrap_content" android:layout_height="wrap_content" app:value="@{address.country}" app:data="@{@array/countries}" app:keys="@{@array/iso_3166_2}"/> Address here is a simple class which has a field called country which is a String and will contain a ISO-3166-2 String. To keep it simple the values will be "DE" or "US". This here is my simplified arrays.xml : <?xml version="1.0" encoding=

Strange error in R.java, even after cleaning the project: “Underscores can only be used with source level 1.7 or greater”

一个人想着一个人 提交于 2019-12-04 23:40:49
So everything was going quite nicely, until just a while ago when R.java decided to have this error after adding an icon ( 5_content_new.png , to be exact). I've tried cleaning the project and restarting eclipse, to no avail. The problem code: public static final class drawable { public static final int 5_content_new=0x7f020000; public static final int ic_launcher=0x7f020001; ... } The red line appears right under 5_ , and the error says: Underscores can only be used with source level 1.7 or greater Has anyone encountered a problem like this before? This is a combination of two things: Java

Resources$NotFoundException drawable-xhdpi from drawable resource

爷,独闯天下 提交于 2019-12-04 21:49:44
问题 I was checking my bug reports and from time to time we get this bug report from our app. I can't pint point what is the actual problem. This resource does exist, most of devices work fine but some specific devices like LG-E510 or U8815 just cant load this resource. Any ideas? android.content.res.Resources$NotFoundException: File res/drawable-xhdpi/action_bar_search_icon.png from drawable resource ID #0x7f02007f at android.content.res.Resources.loadDrawable(Resources.java:1714) at android

“No resource found” errors when building app

半腔热情 提交于 2019-12-04 21:20:22
问题 I'd like to migrate my Eclipse project to Android Studio. I used to build the project with minSdkVersion=8, but I want to add new functionality that requires minSdkVersion 10. I'm running Android Studio 1.1.0. After importing the Eclipse project ("Import project" on the main AS screen), I go to the "Project Structure" window, select the "Flavors" tab, and specify API 10 (Gingerbread) for min sdk and target sdk. When I rebuild the project, I get over 100 errors in the console that look like