我正在尝试使用版本25.2.0的支持库,因此我将能够使用CameraKit库.
我已经下载了最新的构建工具:
我的gradle文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
applicationId "com.sample.myapp"
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName "1.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
maven {
url "https://jitpack.io"
}
mavenCentral()
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'
// Google libraries
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:design:25.2.0'
compile 'com.android.support:support-v4:25.2.0'
compile 'com.google.android.gms:play-services-vision:10.0.1'
compile …Run Code Online (Sandbox Code Playgroud) android build-tools gradle android-support-library android-studio
我在我的应用程序中使用AppIntro库.
它有3张幻灯片.我想在显示第三张幻灯片时询问用户.为实现这一点,我正在使用afollestad的材料对话框.
AppIntro活动中的代码如下所示:
@Override
public void onNextPressed() {
if(this.pager.getCurrentItem() == 2) {
MaterialDialog dialog = new MaterialDialog.Builder(getApplicationContext())
.title("QR Code scannen")
.content("Möchtest du den QR Code scannen oder selbst eingeben?")
.positiveText("eingeben")
.negativeText("scannen")
.onPositive(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
Intent intent = new Intent(getApplicationContext(), RegistrationActivity.class);
startActivity(intent);
}
})
.onNegative(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
// TODO
}
})
.show();
}
}
Run Code Online (Sandbox Code Playgroud)
运行应用程序当我滑动到第三张幻灯片时,我遇到以下问题:
com.afollestad.materialdialogs.MaterialDialog$DialogException:
Bad …Run Code Online (Sandbox Code Playgroud) 我正在尝试执行JSONObject请求:
final String URL = "https://some/url";
// Post params to be sent to the server
HashMap<String, String> params = new HashMap<String, String>();
params.put("param1", param1);
?params.put("param2", param2);
?params.put("param3", param3);?
params.put("param4", param4);
JsonObjectRequest req = new JsonObjectRequest(URL, new JSONObject(params), new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
try {
VolleyLog.v("Response:%n %s", "läuft");
} catch (JSONException e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
VolleyLog.e("Error: ", error.getMessage());
}
});
// add the request object to …Run Code Online (Sandbox Code Playgroud) 我正在尝试调试我的Android应用程序.但每次在特定点,调试器都会在没有对话框的情况下停止和关闭应用程序.
在没有调试的情况下正常运行应用程序没有问题,应用程序按照必须的方式运行代码.
我是否需要对调试器进行一些不同的设置,还是我会错过其他内容?
问题:运行我的项目tomcat我遇到以下问题:
SCHWERWIEGEND: Failed to destroy end point associated with ProtocolHandler ["ajp-nio-8009"]
java.lang.NullPointerException
at org.apache.tomcat.util.net.NioEndpoint.releaseCaches(NioEndpoint.java:316)
at org.apache.tomcat.util.net.NioEndpoint.unbind(NioEndpoint.java:492)
at org.apache.tomcat.util.net.AbstractEndpoint.destroy(AbstractEndpoint.java:821)
at org.apache.coyote.AbstractProtocol.destroy(AbstractProtocol.java:534)
at org.apache.catalina.connector.Connector.destroyInternal(Connector.java:1023)
at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:297)
at org.apache.catalina.core.StandardService.destroyInternal(StandardService.java:589)
at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:297)
at org.apache.catalina.core.StandardServer.destroyInternal(StandardServer.java:877)
at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:297)
at org.apache.catalina.startup.Catalina.start(Catalina.java:633)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)
Run Code Online (Sandbox Code Playgroud)
问题:问题是由我的web.xml文件引起的吗?
web.xml中
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>SMS Cloud Service</display-name>
</web-app>
Run Code Online (Sandbox Code Playgroud)
HomeController.java
@RestController
public class HomeController {
private final MachineRepository machineRepository; …Run Code Online (Sandbox Code Playgroud) 我的Android Volley JsonObjectRequest遇到问题时遇到onErrorResponse:
BasicNetwork.performRequest: Unexpected response code 405 for MY_URL
Run Code Online (Sandbox Code Playgroud)
我的网址有效.我用浏览器检查了一下,然后我找到了预期的JSON对象.所以问题必须在客户端.
代码405表示:
方法不允许请求行中指定的方法不允许由Request-URI标识的资源.响应必须包含一个Allow标头,其中包含所请求资源的有效方法列表.
我的JsonObjectRequest代码:
JsonObjectRequest jsonReq;
jsonReq = new JsonObjectRequest(URL_FEED, new JSONObject(),
new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
try {
VolleyLog.v("Response:%n %s", response.toString(4));
} catch (JSONException e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
VolleyLog.v("ERROR:%n %s", error.getMessage());
}
});
// Adding request to volley request queue
NetworkController.getInstance().addToRequestQueue(jsonReq);
Run Code Online (Sandbox Code Playgroud)
我是否必须在标题中添加一些信息?如果有什么信息?
我有一个用 wordpress 制作的主页设置。所有页面都在根目录中:
www.example.com/
是否可以将我的某些页面移动到子目录中?
喜欢:
www.example.com/products/
根目录保持不变很重要。
我正在使用ZXing的条形码扫描器库。除运行Android 6的Nexus 5以外,我的所有测试设备均能正常运行。启动该活动后,它只会显示黑屏,仅此而已。因此,我认为好吧,也许存在一些兼容性问题,我下载了ZXing发行的官方条形码应用程序。但它在Nexus 5上运行良好。
所以实际上我对本来可以做错的事情感到有点恼火。
在Android Monitor中,我收到消息:
Android连接到相机0时发生错误
我已经搜索了该状态消息,但没有找到对我有用的东西。
有没有人建议如何解决这个问题?或提示如何识别问题的原因?
我已经创建了一个Maven 项目,现在我需要将依赖项添加到我的dynamic web project. 所以我添加了那个spring 教程中命名的依赖项。
问题:我得到解析问题:
项目构建错误:不可解析的 POM C:\Users\username\Development\Spring\Projects\MyWebService\pom.xml:重复标签:'build'(位置:START_TAG 看到 ...\r\n \r\n \ r\n ... @60:10)
我的 pom.xml 看起来像这样:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>MyWebService</groupId>
<artifactId>MyWebService</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.5.RELEASE</version>
</parent>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<warSourceDirectory>WebContent</warSourceDirectory>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
<repositories> …Run Code Online (Sandbox Code Playgroud) 我在SpringToolSuite中有一个动态Web项目.它被转换为Maven项目.
我遇到了这个问题:
Mising artifact org.springframework:spring.jar:4.2.6
我已经尝试过清理,重建和运行项目.它给:
读取文件C时出错:\ Users\jublikon.m2\repository\org\springframework\spring\4.2.6\spring-4.2.6.jar C:\ Users\jublikon.m2\repository\org\springframework\spring\4.2. 6\spring-4.2.6.jar(系统找不到指定的文件)
我不明白为什么我在使用Maven时要求jar文件?
的pom.xml
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>HelloWeb</groupId>
<artifactId>HelloWeb</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<scope>compile</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
</pluginRepository>
</pluginRepositories>
<build>
<sourceDirectory>C:\Users\name\Development\Spring\Projects\HelloWeb\src\main\java</sourceDirectory>
<scriptSourceDirectory>C:\Users\name\Development\Spring\Projects\HelloWeb\src\main\scripts</scriptSourceDirectory> …Run Code Online (Sandbox Code Playgroud)