An Android Activity has a variety of built-in tool classes. If you want to use it, let your Activity inherit this Activity. It is convenient and easy to understand. I have written detailed comments on each method, added the network part, and added one-click upload of form files.
Demonstration diagram
code
void Call(java.lang.String number) method of making = call void download(java.lang.String url, NetResult result) function for downloading files java.lang.String formatMemorySize(long memorySize) formats the memory in digital form Into an easy-to-understand format: 1M, 2G, 3K void Get(java.lang.String url, NetResult result) Send a request to the server through Get and return data java.util.List getAllSMS() Get all SMS java.util.List getContacts() Get all contacts java.util.List getHasReadSMS() Get read SMS java.util.List getHaveNotReadSMS() Get unread SMS java.io.File getPhoneDataDirectory() Get the File object stored inside the phone long getPhoneFreeSize() Get the available memory space of the phone long getPhoneSize() Get the total memory space of the phone java.util.List getReceivedSms() Get the received text messages java.io.File getSDCardDirectory() Get the File object of the SD card long getSDcardFreeSize() Get the available size of the SD card long getSDCardSize() Get the total size of the SD card Size java.util.List getSentSms() Get sent SMS SharedPreferences GetSharedPreferences() Get the default SharedPreferences object SharedPreferences GetSharedPreferences(java.lang.String SharedPreferenceName) Get the SharedPreferences object with the name you set java.util.List getSMSByAddress(java.lang.String search_address) Get the SMS message of the specified number void insertContacts(Contact... contacts ) Insert contacts into the system void insertSMS(SMS... smss) Insert text messages into the system boolean isNetWorkUseful() detects whether the network status is available boolean isSDCardUseful() whether the SD card is available void Post(java.lang.String actionUrl, java.util.Map params, java.util.Map files, NetResult netResult) Upload files and submit through Post method Form void Post(java.lang.String url, java.util.Map params, NetResult result) Submit data to the server through Post method and obtain the returned data void PutSharedPreferences(SharedPreferences sharedPreferences, java.lang.String key, java.lang.Object value) Store data in the specified sharedPreferences void PutSharedPreferences(java.lang.String key, java. lang.Object value) stores data in sharedPreferences boolean sendSMS(java.lang.String number, java.lang.String content) Method for sending SMS void SetSharedPreference(SharedPreferences sharedPreferences) Set your own sharedPreferences void Show(int layout_ID) Display custom prompt information.............
The above is the entire content of this article, I hope you all like it.