How to free Android phone storage

How to free Android phone storage

Algorithm language 2 years ago (2017-02-23) Views: 12 Comments: 0

The Android application will generate some data during operation, such as image cache, database file, configuration file and so on.We may have such a need to clear the cached data in the application when we develop it, allowing the user to choose to delete the data generated within the application. This is a more user-friendly design point.Excessive cache will occupy the storage space of the mobile phone and it is said that it will also reduce the IO performance of the mobile phone. Here's a design that clears the cache provided by the Shum Book Android APP: So what data does the Android application generate in operation?Where are they stored?Then we implement the clean function according to the location of the generated data First of all, simply talk about Android's four data storage methods 1, SharePreferenc A lightweight data storage method is actually based on the "key-value" key-value pair data stored in the XML file; it is usually used to store some configuration information of the program. SharePreference storage directory: It is stored in the "data/data/package name/shared_prefs directory. SharePreference modify and store data Get the SharedPreference object according to the Context's getSharedPrerences(key, [pattern]) method; Use the editor() method of SharedPreference

A simple LAN UDP real-time video

A simple LAN UDP real-time video

Algorithm language 3 years ago (2016-04-12) Views: 6 Comments: 0

In the past, I had always planned to make a video communication software based on UDP communication on the local area network. I did not know how the video stream was transmitted on the network. Although I know the encoding format of several video streams, I have not actually put it into practice. When learning Android watch development, I saw a project on the github that transferred the real-time video of the mobile phone to the watch, and found a LAN video transmission method that seems to be low-grade but should be more practical on the local area network: directly compress the image obtained from the camera. Send it.This project GitHub homepage: https://github.com/retravel/AndroidRealTimeVideo Get webcam real-time pictures, UDP send pictures  UDP server  

Webview shows rich text interaction with JS and java

Webview shows rich text interaction with JS and java

Algorithm language 3 years ago (2016-01-15) Views: 2 Comments: 0

WebView is a control for displaying web pages under Android. Using it can implement a simple browser to access web pages on the Internet.It can also be used as a local text display control, similar to textView.WebView or TextView is used to display HTML content. There are big differences in the way they interact. Take the image click event in HTML content as an example. In WebView mode, developers need to respond to a click event by injecting JavaScript code. The Android system provides a mechanism for a JavaScript web page script in a WebView to call a Java class method; in the TextView, the image is parsed as an ImageSpan and responds by registering a click event on ImageSpan.   One, webview shows rich text For example iniHtml is a string of HTML code, useThis html can be displayed on the webview.   Second, webview display project resources in the web page file We can put an html file index.html under the project assets file, use WebView.loadUrl ("file:///android_asset/index.html") to display the html file, in this html file if you want to reference the asserts file The folder css and js files are also accessed using file:///android_asset/ ;. Third, java

AndroidStudio code obfuscation and NDK prevention apk decompilation

AndroidStudio code obfuscation and NDK prevention apk decompilation

Software development Technical application 3 years ago (2016-01-09) Views: 4 Comments: 0

Code obfuscation What is code confusion Java is a cross-platform, interpreted language in which Java source code is compiled into an intermediate "bytecode" stored in a class file.Due to cross-platform requirements, Java bytecode includes a lot of source code information, such as variable names, method names, and access to variables and methods through these names. These symbols carry a lot of semantic information and can be easily decompiled to Java. Source code.To prevent this, we can use the Java obfuscator to confuse Java bytecode. Obfuscation is to reorganize and process the released program, so that the processed code and the pre-processing code accomplish the same function, and the obfuscated code is difficult to be decompiled. Even if the decompilation is successful, it is difficult to obtain the true semantics of the program. .The confusing program code still complies with the original file format and instruction set. The execution result is also the same as before, but the obfuscator changes the names of all the variables, functions, and classes in the code to short English letter codes. With the corresponding function names and program comments, it will be difficult to read even if it is decompiled.At the same time, confusion is

The first android studio+NDK program

The first android studio+NDK program

Software development 3 years ago (2016-01-08) Views: 3 Comments: 0

NDK (android native develop kits): android local development kits, you can put c/c++ -> compile into a binary file that can be executed under Linux. The java code can be used to execute binary files through jni. What is JNI: java local development interface, JNI is a protocol This protocol is used to communicate java code and external native code (c/c++). Through this protocol, java code can call external c/c++, code outside c The /c++ code can also call java code. Java can achieve the development of the upper application, but can not write the underlying driver, some android projects must deal with the underlying hardware, such as to accurately and quickly obtain the value of a sensor, then java can not be done, then what to do, through JNI Development, complete the underlying driver or worth it via c/c++, then pass the value back to the java layer.The same java layer can also pass data to the c/c++ layer, so that data interaction is done through the JNI. Why use NDK? In summary, it is mainly divided into the following situations: 1. Code protection, because the java layer code of apk is easily decompiled, and C/C++ library is relatively

Android implementation opens a specified link to call other applications

Android implementation opens a specified link to call other applications

Software development Technical application 3 years ago (2016-01-01) Views: 3 Comments: 0

Some websites have set a link on the page to jump to their official app, such as JD. Recently, I added this feature to Wang Baiyuan’s blog client to open links on web pages and call my client to open related articles. .The following is the implementation method: Android implementation opens a specified link to call other applications Add an intent-filter tag in the AndroidManifest.xml manifest file of the Activity that needs to jump to the specified link, and set the scheme, HOST, and other attributes as shown in the following example. And made a web page test successfully:  

Android analog click button

Android analog click button

Algorithm language Software development 3 years ago (2015-10-02) Views: 4 Comments: 0

In the Android development process, the same operation is often performed in different environments. Of course, it is easy to think of the method is to extract the same operation in a function, only in the implementation of the same or similar operations Need to run the function then.If the function being executed is in a different class or activity (of course the activity is also a class), we only need to define the access level of the function as public static. The above believe that even the most basic developers know that it seems that the very guests have nothing to say.When calling a public static method b of another class B in a class A, if method b uses other variables of class B, such as c, d, f, etc., when modifying method b is a public static class B The variables c, d, and f are also changed to static variables, because static methods do not allow non-static variables to be called. This change is often triggered by the whole body. Sometimes we happen to encounter this situation. The operation performed in class B is the operation performed by clicking one of the buttons of the activity.For

Android (Java) parsing way translation API – Json data

Android (Java) parsing way translation API – Json data

Software development 3 years ago (2015-08-24) Views: 6 Comments: 0

Since Baidu Translation, Youdao Translation, and other translation services all open their own APIs, developers can develop their own translation software using the API they provide.The software developed by oneself may not be as powerful as their functions, but the result of the translation is the same. At the same time, other processes that sneak traffic are not built in. At the same time, the interface is relatively simple and can be modified as desired. First, after applying the API ID and KEY to the API, the client ID and clientSecret in the following program are replaced with the ID and KEY, and the string is parsed through the GET request.Here is the code that I used to parse JSON data in java: Android (Java) parsing way translation API - Json data  

Android development permissions

Android development permissions

Software development 3 years ago (2015-08-23) Views: 5 Comments: 0

In Android development, the application must request permission from the Android system when accessing mobile phone hardware resources such as SD read and write, network access, location, call camera, or system services such as contacts and phone calls.The permission mechanism helps protect the user's mobile phone security.There have been many Trojans that have sent text messages to you in the background, and they have been deducted without hesitation.The premise that this kind of Trojan horse can send short messages is to apply for the right to send SMS messages to the android system.Many security software now have the function of forbidding application permissions. Even if the mobile phone application has access to some mobile phone resources, it can forcibly prohibit access. For developers, the method to apply for permissions for an application is to add <manifest /> in the project manifest file like: <uses-permission android:name="android.permission.CALL_PHONE(permission name)" /> The following is the Android development application permission. Daquan: Android development permissions Access registration attribute android.permission.ACCESS_CHECKIN_PROPERTIES , read or write permission to register the check-in database property sheet Get the wrong location android.permission.ACCESS_COARSE_LOCATION, obtain the user's wrong latitude and longitude information through WiFi or mobile base station, positioning accuracy is about 30 to

androidStudio development Android application setting version number

androidStudio development Android application setting version number

Software development 3 years ago (2015-08-22) Views: 4 Comments: 0

Android: versionCode and android: versionName In eclipse, to modify the version number of our application, you only need to add the android:versionCode and android:versionName values ​​to the manifest tag in the manifest file AndroidManifest.xml to set the application version number.As the following code:The above code indicates that the package name of the application is cn.wangbaiyuan.translate, the version number is code:2, and the version name is Name:1.1; the former is generally for the developer to compare whether the version is upgraded, and the latter is displayed for the user to see. Using Eclipse to modify the AndroidManifest.xml to modify the version number is completely fine, but Extreme Guest tried to modify only the AndroidManifest.xml content in Android Studio. It didn't work. Although I assigned android:versionName to 1.1, it was on the phone. The version number shown is always the previous 1.0. androidStudio development Android application setting version number It was later discovered that the build.gradle(Module:app) configuration file in Android Studio also set its version number. In the case of a conflict with the version number filled in AndroidManifest.xml, the compiled APK uses build.gradle(Module). :app) configuration: build.gradle(Module:app) Solution Find the build.gradle(Module:app) file in the project folder, delete the two lines of defaultCode

登录

Forget password?

您也可以使用第三方帐号快捷登录

切换登录

注册

TW