应用程序正在运行SDK 23及更高版本.我在完成任务并使用AlaramManager(setExactAndAllowWhileIdle)安排下一个任务后使用Service运行一些任务.这工作正常.如果手机连续闲置2或3天,则进入打盹模式.打盹模式后,应用程序丢失网络和唤醒锁也无法正常工作.
是否有办法即使手机是Doze我们可以运行任何网络插入问题的应用程序.我试图保持应用程序witelist但我需要设备根植.
adb shell dumpsys deviceidle whitelist +<Package Name>
Run Code Online (Sandbox Code Playgroud)
任何人都可以建议我不间断地运行应用程序的最佳方法?
尝试从 IRT 中删除本地句柄范围条目,忽略
\n\n\n\n01-18 20:30:48.725 30673-30673/com.packname.debug W/art\xef\xb9\x95 尝试从 IRT 中删除本地句柄范围条目,忽略\n 01-18 20:30:48.725 30673-30673 /com.packname.debug W/AwContents\xef\xb9\x95 onDetachedFromWindow 在已分离时调用。忽略\n 01-18 20:30:48.735 30673-15614/com.packname.debug D/startTraficSt :\xef\xb9\x95 2525554070\n 01-18 20:30:48.845 30673-15614/com.packname.debug D/oneByteTimeMillis :\xef\xb9\x95 106\n 01-18 20:30:48.975 30673-30673/com.packname.debug W/BindingManager\xef\xb9\x95 无法调用 dependentVisibility() - 从未见过连接pid: 30673\n 01-18 20:30:49.205 30673-5751/com.packname.debug E/chromium\xef\xb9\x95 [错误:raw_channel.cc(341)] 收到的平台句柄数量无效\n 01-18 20:30:49.205 30673-5751/com.packname.debug E/chromium\xef\xb9\x95 [错误:channel.cc(307)] RawChannel 读取错误(收到错误消息)\n 01-18 20 :30:49.205 30673-5735/com.packname.debug W/chromium\xef\xb9\x95 [警告:proxy_message_pipe_endpoint.cc(50)] 无法将排队消息写入通道\n 01-18 20:30:49.205 30673 -5735/com.packname.debug W/chromium\xef\xb9\x95 [警告:proxy_message_pipe_endpoint.cc(50)] 无法将排队消息写入通道\n 01-18 20:30:49.205 30673-5735/com。 packname.debug W/chromium\xef\xb9\x95 [警告:channel.cc(315)] RawChannel 写入错误
\n
ULR:
http://23.23.82.251:9116/solr/db/select?q=*:*+_val_:%22geodist%28%29%22&fq=(ProviderType:10)&rows=100&wt=json&indent=true&fl=ProviderID,ProviderType,ProviderName,ProviderAddress,CityAreaID,CityAreaName,City,State,Latlong,score&fq={!geofilt}&sfield=Latlong&pt=20.296059,85.82454&d=5&sort=geodist()%20asc
Run Code Online (Sandbox Code Playgroud)
当我尝试在Android中使用此URL与发布请求时,我收到以下错误.
10-22 13:54:49.946: E/SearchResult(6659): Exception Name = java.lang.IllegalArgumentException
Run Code Online (Sandbox Code Playgroud)
我使用URLEncoder.encode(),但我仍然得到相同的错误.可以建议我写错了.下面我正在使用的代码
HttpParams httpParameters = new BasicHttpParams();
// Set the timeout in milliseconds until a connection is established.
// The default value is zero, that means the timeout is not used.
int timeoutConnection = 10000;
HttpConnectionParams.setConnectionTimeout(httpParameters, timeoutConnection);
// Set the default socket timeout (SO_TIMEOUT)
// in milliseconds which is the timeout for waiting for data.
int timeoutSocket = 15000;
HttpConnectionParams.setSoTimeout(httpParameters, timeoutSocket);
httpclient = new DefaultHttpClient(httpParameters);
HttpPost httppost = new HttpPost(url here); …Run Code Online (Sandbox Code Playgroud) 我是弹簧靴开发的新手。我试图通过从@RequestBody 传递 List 来验证发布请求。下面是控制类
@CrossOrigin
@RestController
@RequestMapping("/webapi/device")
@Validated
public class DeviceController extends AuthControllerImpl{
@Autowired
private DeviceServices deviceServices;
//Test Postman request 01
@PostMapping(path = "/udateDevices", consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON)
public ResponseEntity<Object> updateDeviceToDB( @RequestBody List<@Valid Device> device, @RequestParam("token") String token, Errors errors) {
if (errors.hasErrors()) {
return new ResponseEntity<Object>(new ErrorResponse(errors), HttpStatus.BAD_REQUEST);
}
if(isValidToken(token) != null){
DeviceControllerResponse response = deviceServices.updateDeviceToDB(device);
if (!response.isSuccess()) {
return new ResponseEntity<Object>(response, HttpStatus.BAD_REQUEST);
}
return ResponseEntity.ok(response);
}else {
return new ResponseEntity<Object>("Token has been expired/not valid.", HttpStatus.UNAUTHORIZED);
} …Run Code Online (Sandbox Code Playgroud) 我是jquery mobile的新手,同时发出ajax请求我用来显示加载消息,直到从服务器获得响应.我为此尝试了很多但没有用.任何人都可以提前帮助我解决这个问题.
吼叫ajax电话代码
$.ajax({
url: "url",
type: "GET",
contentType: "application/json; charset=utf-8",
beforeSend: function(){
setTimeout(function(){
$.mobile.loading('show');},1);
},
success: function(msg) {
// $.mobile.loading('hide');
$.each(msg.empWall, function() {
alert(this.name);
});
},
error: function(err) {
alert(err.toString());
},
complete: function(){
setTimeout(function(){
$.mobile.loading('hide');
},1);
});
Run Code Online (Sandbox Code Playgroud) android ×3
android-doze ×1
cordova ×1
java ×1
javascript ×1
jquery ×1
service ×1
settimeout ×1
spring-boot ×1
webview ×1