小编edw*_*win的帖子

安卓视频在另一个线程和问题与Android 2.1

我想在Android视频视图中流式视频表单网址.我使用示例api代码并在其中进行了一些修改以实现我的需要.我的代码是

public class VideoViewDemo extends Activity {

private static final String TAG = "VideoViewDemo";
private String current;

/**
 * TODO: Set the path variable to a streaming video URL or a local media
 * file path.
 */
private String path = "http://www.boisestatefootball.com/sites/default/files/videos/original/01%20-%20coach%20pete%20bio_4.mp4";
private VideoView mVideoView;

@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    setContentView(R.layout.videoview);
    mVideoView = (VideoView) findViewById(R.id.surface_view);
    runOnUiThread(new Runnable() {
        public void run() {
            playVideo();
        }
    });
}

private void playVideo() {
    try {
        // final String path = path; …
Run Code Online (Sandbox Code Playgroud)

java multithreading android video-streaming android-videoview

5
推荐指数
1
解决办法
2282
查看次数

JBoss EAP 7.1 部署失败:WFLYCTL0013:操作(“部署”)失败

我的项目是战争部署。

XXX.战争

对于我的项目,jboss 中安装了一个数据源 (ds)。

XXX.war具有对 a 的 Maven 依赖xxx-domain.jar,它处理休眠/持久性配置。

这是我的persistence.xml

<persistence version="2.0"
   xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="
        http://java.sun.com/xml/ns/persistence
        http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
   <persistence-unit name="primary"  transaction-type="JTA">
       <provider>org.hibernate.ejb.HibernatePersistence</provider>
      <jta-data-source>java:/xxxDS</jta-data-source>
      <exclude-unlisted-classes>false</exclude-unlisted-classes>      
      <properties>
         <property name="hibernate.show_sql" value="true" />
         <property name="hibernate.session_factory_name" value="XXXSessionFactory"/>
         <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
         <property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossStandAloneJtaPlatform" />
      </properties>
   </persistence-unit>
</persistence>
Run Code Online (Sandbox Code Playgroud)

这是hibernate.cfg.xml

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory name="java:jboss/XXXSessionFactory">
     <property name="connection.datasource">java:xxxDS</property>
      <property name="show_sql">false</property>
      <property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
      <property name="current_session_context_class">thread</property>
      <mapping resource="com/xxx/model/XXXModel.hbm.xml"/>

    </session-factory>

</hibernate-configuration>
Run Code Online (Sandbox Code Playgroud)

这 2 个配置存在于 xxx-domain.jar. …

java persistence hibernate jta jboss-eap-7

5
推荐指数
1
解决办法
2万
查看次数

Wildfly 和 springboot 出现“404 - Not found”错误

您好,我正在尝试使用 Eclipse 通过一个非常简单的应用程序来学习 Wildfly 和 springboot。项目名称是 springboot-test。包括主方法类在内的所有类都在同一个包中。

Main 方法类称为“App”,其代码如下:

 @SpringBootApplication
 @RestController
 public class App {

    @Autowired
    private Student student;

    public static void main(String[] args) {
        SpringApplication.run(App.class, args);
    }

    @RequestMapping("/index")
    public String sayHello()
    {
        return "hello from spring boot" + this.student.showAddress();
    }
}
Run Code Online (Sandbox Code Playgroud)

以下是服务器日志:

11:36:57,281 信息 [org.wildfly.extension.undertow](ServerService 线程池 - 68)WFLYUT0021:已注册的 Web 上下文:服务器“default-server”的“/springboot-test-0.0.1-SNAPSHOT”

11:36:57,301 信息 [org.jboss.as.server](ServerService 线程池 - 37)WFLYSRV0010:部署了“springboot-test-0.0.1-SNAPSHOT.war”(运行时名称:“springboot-test-0.0” .1-SNAPSHOT.war")

11:36:57,408 信息 [org.jboss.as.server](控制器引导线程)​​WFLYSRV0212:恢复服务器

11:36:57,411 INFO [org.jboss.as](控制器启动线程)WFLYSRV0060:Http 管理接口监听http://127.0.0.1:8181/management

11:36:57,412 INFO [org.jboss.as](控制器启动线程)WFLYSRV0051:管理控制台监听http://127.0.0.1:8181

11:36:57,412 INFO [org.jboss.as](控制器启动线程)WFLYSRV0025:WildFly Full 11.0.0.Final(WildFly Core 3.0.8.Final)在 11393 毫秒内启动 - …

http-status-code-404 wildfly spring-boot

5
推荐指数
1
解决办法
2816
查看次数

Glassfish:Jersy客户端中的MessageBodyProviderNotFoundException

嗨所有我试图从头开始创建一个休息网络服务.这是我的服务部分

@Path("/Phones")
public class PhonessResource {

 @GET
 @Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON})
  public Response getAllNumbers(){
      List<PhoneDetail> list = PhoneDirectoryDao.getInstance().getAllNumbers();
      GenericEntity<List<PhoneDetail>> entity = new GenericEntity<List<PhoneDetail>>(list) {};
      Response response =Response.ok(entity).status(200).build();
      return response;//PhoneDirectoryDao.getInstance().getAllNumbers();
    }
 }
Run Code Online (Sandbox Code Playgroud)

我的数据模型:我有我的getter和setter以及另一个带有所有属性的构造函数,我没有将它粘贴到更少的问题长度,我在客户端和服务器中使用相同的数据模型

@XmlRootElement(name="PhoneDetail")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(propOrder={"id","firstName","lastName","address","phoneNo","timeStamp"})
public class PhoneDetail {

    private int id;
    private String firstName;
    private String lastName;
    private String address;
    private String phoneNo;
    private Timestamp timeStamp;

    public PhoneDetail() {}
}
Run Code Online (Sandbox Code Playgroud)

然后我创建一个java客户端来测试服务.我正在使用NETBEANS IDE,所以我在IDE中选择默认选项来创建它

在此输入图像描述

因此我创建了一个Jersey客户端

public class PhoneCLient {
    private WebTarget webTarget;
    private Client client;
    private static final String BASE_URI = "http://localhost:8080/Phones/webresources";

    public PhoneCLient() …
Run Code Online (Sandbox Code Playgroud)

java rest jax-rs jaxb jersey-client

4
推荐指数
1
解决办法
2万
查看次数

SlidingPaneLayout.setShadowResource Android

我正在开发一个带有滑动窗格的APP并且工作正常,但我不知道如何像Hangouts Google APP那样设置阴影.

这有点难以解释,请看:

在此输入图像描述

我试图使用setShadowResource,但我不知道如何在九个补丁中设计阴影.谢谢您的帮助!

编辑: 我正在尝试使用渐变形状创建阴影,但不起作用:|

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >

<gradient
    android:centerColor="#8B0000"
    android:endColor="#34FFDD"
    android:startColor="#FF00FF" />

</shape>
Run Code Online (Sandbox Code Playgroud)

活动:

    mPanes.openPane();
    mPanes.setShadowResource(R.drawable.es_slidingpane_shadow);
    mPanes.setSliderFadeColor(Color.parseColor("#FFFFFF"));
Run Code Online (Sandbox Code Playgroud)

android slidingdrawer

3
推荐指数
1
解决办法
2124
查看次数

Android和Java Uuid

我想为我的应用程序生成一个uuid我尝试了很多东西,如wifi mac地址,获取android id,序列号,从设备android.os.Build属性创建伪uuid .

我也知道java本身有Uuid创建者类 java.util.UUID

通过浏览几篇文章和博客,我对此感到困惑.我想知道,如果两个Android设备正在创建uuid使用这个java类(java.util.UUID)将是唯一的还是有任何重复的机会?

此外,在某些设备中,我无法使用找到序列号android.os.Build.SERIAL.是否有获取设备序列号的替代方法

java encryption uuid android

2
推荐指数
1
解决办法
4749
查看次数

尝试创建AlertDialog时程序崩溃

我在制作警报对话框时遇到困难,其代码如下:

public void setp2(View v){
        p2 = (TextView)findViewById(R.id.p2);
        AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(getApplicationContext());
        alertDialogBuilder.setTitle("Please enter player 2 name");
        alertDialogBuilder.setMessage("MESSAGE");
        alertDialogBuilder.setCancelable(false);
        alertDialogBuilder.setPositiveButton("Yes", new DialogInterface.OnClickListener() {

            @Override
            public void onClick(DialogInterface dialog, int id) {
                // TODO Auto-generated method stub
                dialog.cancel();
            }
        });
        AlertDialog alert = alertDialogBuilder.create();
        alert.show();   

}
Run Code Online (Sandbox Code Playgroud)

每当我运行它时崩溃logcat看起来像:

04-14 06:09:36.282: E/Trace(25945): error opening trace file: No such file or directory (2)
04-14 06:09:37.822: E/AndroidRuntime(25945): FATAL EXCEPTION: main
04-14 06:09:37.822: E/AndroidRuntime(25945): java.lang.IllegalStateException: Could not execute method of the activity
04-14 06:09:37.822: E/AndroidRuntime(25945): …
Run Code Online (Sandbox Code Playgroud)

alert android exception

1
推荐指数
1
解决办法
1209
查看次数