Two ways to start Service and "Service and Activity data interaction"
1. Two ways to start the service
There are two ways to start a Service in an Activity. The life cycle of a Service is different when it is started in different ways. Now, four buttons are defined in an Activity, which are startService, stopService, bindService and unbindService. Log logs are printed in each life cycle of the Service to view the ...
Posted by WhiteShade6 on Thu, 23 Apr 2020 20:37:49 -0700
Android binding services (easy way)
An easy way for Android to bind services Here are the services: A Service is an application component that can perform long-running operations in the background and does not provide a user interface. Binding services provide a client server interface to allow components to interact, send requests, get results, and even use interprocess communic ...
Posted by tcsnguy08 on Wed, 22 Apr 2020 22:06:47 -0700
Detailed tutorial of Android crawling web page JSON data [novice]
In recent days, we have done an Android task to get Json. We found that Jsoup can only get static pages, but not dynamic pages.
Some students corrected it for me: Jsoup can crawl the dynamic page, but it must add the request header (data). The following is the correct example:
String url = "Your web interface";
Map data = Maps.newHashMap();
d ...
Posted by colinexl on Wed, 22 Apr 2020 21:57:11 -0700
Design pattern series - decoration pattern
Original October 29, 2017 serious Xiao Su
Introduction to decoration mode
Decoration pattern, also known as packaging pattern, is one of the structural patterns. It uses a transparent way to the client to dynamically expand the function of the object, and it is also one of the alternative schemes of inheritance r ...
Posted by everurssantosh on Wed, 22 Apr 2020 09:36:47 -0700
android monitors EditText for changes
Use the addTextChangedListener(TextWatcher watcher) method of EditText to monitor EditText. TextWatcher is an interface class, so the abstract method in TextWatcher must be implemented:When the content in EditText changes, the TextChangedListener event will be triggered, and the abstract method in TextWatcher will be called.Layout:
<?x ...
Posted by cupboy on Wed, 22 Apr 2020 08:47:14 -0700
Voice communication solution summary
Voice communication scheme
System level solutions and self built protocols
windows platform, linux platform, embedded linux platform, mcu platform
1. Voice solution of wired communication developed on Embedded Linux
This scheme is developed on Embedded Linux. The audio scheme is based on ALSA. The voice communication is related to user ...
Posted by vtb on Tue, 21 Apr 2020 18:12:51 -0700
Android Global Catch Exception
Android Global Catch Exception
2018/1/24 11:47:52
prospect
Reduce Bug s
Solve Bug s as soon as possible
Bug on user's mobile phone after going online, no hair knows Bug
Require tool classes, catch exceptions, don't crash, restart from scratch, make users feel insensitive
Why use global catch exceptions
Using global catch exceptions, w ...
Posted by mfos on Sun, 19 Apr 2020 09:30:33 -0700
Hiding and displaying of FloatingActionButton
When using RecylerView to display data, a floating button is displayed at the bottom right. Its functions are:
Hide the button when pulling up, show the button when pulling down, and click this button to return to the top. As shown in the picture:
The layout is as follows:
<!--Without adding CoordinatorLayout,FloatActionButton Wil ...
Posted by gj6kings on Sun, 19 Apr 2020 09:20:01 -0700
Android refresh display data change animation
Preface
Let's first look at an effect and expand the content of this article.
Realization
After a general App is refreshed, it will show how much content or update has been added. It is common for news or live broadcast. So, how to achieve this effect?
Pull down to refresh. After getting the latest data of the server, the siz ...
Posted by Jason_London on Fri, 17 Apr 2020 09:40:35 -0700
android APP version detection and upgrade
1. This time, the server uses HTTP Servlet to return json data
First, build a Java Web project and create a Servlet class. The code is implemented in doGet
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
* response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response)
...
Posted by chiefrokka on Fri, 17 Apr 2020 09:01:40 -0700