store data on a disk, becauseParcelableThe data continuity cannot be well guaranteed in the case of external changes. AlthoughSerializableLow efficiency, but we recommend that you useSerializable.
Steps for implementing Parcelable
Implements Parcelable
Override the writeToParcel method to serialize your object into a Parcel object, that is, write the data of the class to the external provided Parcel, and p
Parcelable) for passing objects by Intent in Android )!3. Intent filter details about the Action and Category attributes --- With instance source code4. Usage of startActivityForResult5. Android Development notes-passing class objects through Intent--------------------------------------------------------------------------------
JJava 81. Modern Java-A Guide to Java 82. Java 8 series-simple guide to Java 8Json1. Android series --- JSON data parsing2.
. Update/Submit SVNRight-click the project and select "Subversion"-"Update File ..." (from SVN) or "Commit file ..." In the right-click menu (submit files to SVN)The steps to install plug-ins in Android studio are similar to eclipse by selecting the menu "File"--"Settings"--"Plugins"-"Browser repositories ...", Then pop up a window of the list of currently available plugins, select "Code Tools" in the Category box of the window--Select the specified plugin--click on the "Install" button in the r
micro-letter version may be different, at the same time make two judgments to compatible partial version
The need to automatically return the red envelopes, there are several situations: Rob, Hange, and the red envelope is their own red envelopes issued
Here's the code to listen to the chat list:
Private Boolean watchlist (Accessibilityevent event) {
//not a message
if (Event.geteventtype ()!= accessibilityevent.type_window_content_changed | | Event.getsource () = null) return
the key word "[red envelope]" for this time, so when handling the notification bar event, first determine if the text of the message has a keyword, and if so, open the interface.private void getNotificationInfo(AccessibilityEvent event) { Parcelable parcelable = event.getParcelableData(); if (parcelable instanceof Notification) { Notification notifi
static final String Sample_loyalty_card_aid = "F222222222"; ISO-DEP command HEADER for selecting an AID. Format: [Class | instruction | Parameter 1 | Parameter 2] private static final String Select_apdu_header = "00a40400"; "OK" status word sent in response to SELECT AID command (0x9000) private static final byte[] select_ok_sw = {(byte) 0x90, (Byte) 0x00};p ublic static string[][] techlists;public static intentfilter[] Filters;static {try {//the tech lists U Sed to perform matching for d
. gdut. repairsystem id = 0 tag = null notification = Notification (vibrate = null, sound = null, defaults = 0x0, flags = 0x10 ))
Solution:
A self-held component is used in the custom Layout (this is why the custom style is used !!! (The layout on the outermost layer cannot be used, but the layout on the outer layer can be used ))
System Environment:
64-bit Windows 7
Problem description:In the jni code: Type Method 'newstringutf' cocould not be resolved
Error message:
Type Method 'newstringut
-Keepclasseswithmembernames class *{Native }# Keep setters in Views so that animations can still work.# See http://proguard.sourceforge.net/manual/examples.html#beans-Keepclassmembers public class * extends android. view. View {Void set *(***);* ** Get *();}# We want to keep methods in Activity that cocould be used in the XML attribute onClick-Keepclassmembers class * extends android. app. Activity {Public void * (android. view. View );}# For enumeration classes, see http://proguard.sourceforge.
Aidl (Android Interface Definition language)---------------------------------Aidl is used to define the interfaces that need to be used when communicating across processes, that is, when multiple applications need to use the relevant interfaces, they should be defined using AIDL."Steps to define an interface using Aidl"1. Create a Java interface file using a generic interface creation method2. Delete the permissions for the created interface, i.e. public interface Imusicplayer modified to interf
sharedpreferences in memory); 4. Application will be created multiple times; conclusion: in multi-process mode, the components of different processes will have independent virtual machine, application and memory space.IPC BasicsSerializable:java provides a serialization interface that uses classes to implement Serializable and declare inside the interface
private static final long serialVersionUID = 51989342343L;
The serialization and deserialization of objects uses ObjectOutpu
cause security problems. Because the data is outside the Java Runtime Environment and is not controlled by the Java security mechanism. These fields that need to be kept confidential should not be stored in permanent media or simply not stored without processing, in order to ensure security. The transient keyword should be added before these fields.
4) when a parent class is serialized, the Child class is automatically serialized without explicitly implementing the serializable interface;
5
for troubleshooting, The mapping.txt file should be used to reverse push the corresponding code segment in the actual code to solve the problem.PS: $ in the obfuscated code indicates an anonymous internal class, which is outclassname $1 and outclassname $2 in sequence.
(2) bugs caused by ObfuscationApplications may cause bugs due to obfuscation of code that should not be obfuscated by proguard, including classnotfoundexception and badparcelableexception.For classnotfoundexception, find a class
, because the process of GSM communication to RIL and then to the mobile base station is very long, waiting through a Thread is troublesome and resource-consuming for our applications, while the underlying remote service of TelephonyManager on the Android framework layer will be tracked and eventually tracked through PendingIntent, the specific implementation principles and Code are as follows:
Public final class PendingIntent implements Parcelable {/
complete implementation code, which is difficult to understand. To facilitate use in the Activity, you need to create a base class BaseActivity of the Activity and write the code in the base class, if no new Activity instance is created in the future, BaseActivity must be inherited to ensure that each Activity has a corresponding state information storage method.
Package com. example. activitystatesave; import java. io. serializable; import java. lang. annotation. annotation; import java. lang
class vi.com. gdi. bgl. android .**{*;}
Based on my experience, it is generally best to avoid confusion between models (model is irrelevant and does not matter much if it is not obfuscated), for example:
-Keep class com. bank. pingan. model .**{*;}
The following is a statement about Umeng sharing statistics to avoid confusion.
-Dontwarn android. support. v4 .**
-Dontwarn org.apache.commons.net .**
-Dontwarn com. tencent .**
-Keepclasseswithmembernames class *{
Native
;
}
-Keepclasseswith
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.