小编Bir*_*dia的帖子

如何禁用拼写检查Android edittext

我想从edittext字段中的文本中删除下划线. 带有下划线文本的文本文件

我怎样才能做到这一点?

android

90
推荐指数
5
解决办法
4万
查看次数

将实时Android网络摄像头视频上传到RTP/RTSP服务器

我已经做了适当的研究,但仍然没有关于我想要实现的事情的信息.

所以我想编写一个应用程序,用户可以录制视频,并立即(实时)将视频上传到RTP/RTSP服务器.服务器端不会有问题.我不清楚的是如何在手机上实现这一点.

到目前为止我的研究是我必须将录制的视频写入本地套接字而不是文件,因为写入文件的3gp文件无法访问,直到最终确定(当视频停止并且标题信息有已被写入关于长度和其他的视频).

当套接字接收到连续数据时,我需要将其包装成RTP数据包并将其发送到远程服务器.我可能还必须首先进行基本编码(这还不是那么重要).

如果这个理论到目前为止是否有任何人有任何想法.我还想知道是否有人可以指出一些类似方法的代码片段,特别是用于将视频即时发送到服务器.我不知道该怎么做.

非常感谢和最诚挚的问候

android rtsp rtsp-client

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

使用本地服务器的ApprtcDemo可以在浏览器之间工作,但不适用于浏览器本机

我正在开发一个聊天应用程序并完成它.现在我也想实现视频聊天.经过研究很多,我决定选择"WebRTC"库.

我做了什么?

1)能够在本地服务器上运行AppRtcDemo,并且它在浏览器之间正常工作.

参考:http://www.webrtc.org/reference/getting-started

2)能够构建Android AppRtcDemo.But当我运行时说"Cross origin not support".

经过研究,我在webrtc讨论中发现,为了解决这个问题,我需要设置自己的转向服务器.

3)所以我安装了webrtc推荐的最新rfc5766TurnServer.我成功运行了转向服务器.

参考:http://code.google.com/p/rfc5766-turn-server/

我对ApprtcDemo(web)和(Android)进行了以下更改,以便与我的Turn服务器一起使用

1)apprtc.py

更换:

turn_url = 'https://computeengineondemand.appspot.com/'
turn_url = turn_url + 'turn?' + 'username=' + user + '&key=4080218913'
Run Code Online (Sandbox Code Playgroud)

指向我的转弯服务器:

turn_url = 'http://192.168.5.85:3478/?service=turn&username=biraj'
Run Code Online (Sandbox Code Playgroud)

2)index.html

更换:

var pcConfig = {{ pc_config|safe }};
Run Code Online (Sandbox Code Playgroud)

附:

var pcConfig = {"iceServers": [{"url": "stun:stun.l.google.com:19302"},            {"url":"turn:biraj@192.168.5.85:3479", "credential":"0x5b04123c3eec4cf0be64ab909bb2ff5b"}]};
Run Code Online (Sandbox Code Playgroud)

Android的

1)AppRTCDemoActivity.java

更换:

roomInput.setText("https://apprtc.appspot.com/?r=");
Run Code Online (Sandbox Code Playgroud)

使用我的本地apprtc服务器:

roomInput.setText("http://192.168.5.86:8080/?r=");
Run Code Online (Sandbox Code Playgroud)

2)AppRTCClient.java

private PeerConnection.IceServer requestTurnServer(String url){}功能上

更换:

connection.addRequestProperty("origin", "https://apprtc.appspot.com");
Run Code Online (Sandbox Code Playgroud)

附:

connection.addRequestProperty("origin", "http://192.168.5.86:8080");
Run Code Online (Sandbox Code Playgroud)

3)/assets/channel.html

更换:

<script src="https://apprtc.appspot.com/_ah/channel/jsapi"></script>
Run Code Online (Sandbox Code Playgroud)

附: …

android webrtc apprtcdemo rfc5766turnserver

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

locationManager.getLastKnownLocation()返回null

我不明白为什么 locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);返回位置null.我给了所有的许可,但它的悔改null.

          if (isGPSEnabled) {
            if (location == null) {
                locationManager.requestLocationUpdates(
                        LocationManager.GPS_PROVIDER,
                        MIN_TIME_BW_UPDATES,
                        MIN_DISTANCE_CHANGE_FOR_UPDATES, this);
                Log.d("GPS", "GPS Enabled");
                if (locationManager != null) {
                    location = locationManager
                            .getLastKnownLocation(LocationManager.GPS_PROVIDER);
                    if (location != null) {
                        latitude = location.getLatitude();
                        longitude = location.getLongitude();
                    }
                }
            }
        }
Run Code Online (Sandbox Code Playgroud)

android location geolocation latitude-longitude

15
推荐指数
2
解决办法
3万
查看次数

如何在移动应用程序上连接到服务器?

我是移动应用程序的新手.我基本上来自一个Web开发平台.我只是在玩App Framework,LungoJS,Jquery Mobile,kendo等移动框架,以获得这方面的一些知识.

我正在开发的应用程序仍处于UI级别.我只需要从服务器获取数据并填入我的应用程序.

我需要一些想法来建立智能设备和服务器之间的服务器通信.我的问题是

  1. 移动应用需要什么样的服务器?云或常规Web服务器就足够了吗?
  2. 将应用程序与服务器连接的方法有哪些?(关于跨平台移动开发)
  3. 与服务器通信的安全方式是什么?

android mobile-application appframework jquery-mobile kendo-mobile

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

动画图像图标从触摸位置到右上角?

我正在开发Android onlineShopping应用程序.我必须应用一些动画.

  1. 购物车图像显示在屏幕的右上角.
  2. 屏幕上的每个项目都有"添加到购物车"按钮.
  3. 当用户按下此按钮时,我必须播放动画.
  4. 我有一个修复图像应该从触摸位置动画到放置在屏幕右上角的购物车图像.

请帮帮我.

提前致谢.

更新:

我尝试将图像从一个地方移动到另一个地方.

TranslateAnimation anim = new TranslateAnimation(0,0,200,200);              
                anim.setDuration(3000);

                img.startAnimation(anim);
Run Code Online (Sandbox Code Playgroud)

这个图像我想从触摸位置动画到右上角. 在此输入图像描述

animation android viewanimator

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

片段中ListView的setOnItemClickListener

我在点击片段中的ListView项目时遇到问题.我编写了代码,因此片段指向所有内容的布局文件,而2个布局内部是ListViews,它从strings.xml中的字符串数组中的项检索其条目.由于我编写代码的方式,我找不到在我的情况下为每个ListView项实现setOnItemClickListener的方法.

MainActivity.java

package com.example.test_app;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.view.ViewPager;
import android.view.Menu;

public class MainActivity extends FragmentActivity{
    ViewPager ViewPager = null;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ViewPager= (ViewPager) findViewById(R.id.pager);
        FragmentManager fragmentManager=getSupportFragmentManager();
        ViewPager.setAdapter(new AdapterActivity(fragmentManager));
    }
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.main, menu);
    return true;
    }
}
Run Code Online (Sandbox Code Playgroud)

AdapterActivity.java

package com.example.test_app;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.view.LayoutInflater;
import …
Run Code Online (Sandbox Code Playgroud)

android listview android-listview android-fragments onclicklistener

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

触摸外部时解除对话框

我试过,也搜索了这些东西,但没有得到答案

我正在点击一个视图点击现在我想解雇膨胀的视图,但这里没有发生的是我的来源...

icon1.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
             LayoutInflater inflater = (LayoutInflater)screen.getSystemService(screen.LAYOUT_INFLATER_SERVICE);
               layout =  inflater.inflate(R.layout.image_popup,null);

               AlertDialog.Builder builder = new AlertDialog.Builder(Actvity.this);
               builder.setCancelable(true);
               builder.setView(layout);
Run Code Online (Sandbox Code Playgroud)

我不想添加正面或负面按钮

 builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {

                @Override
                public void onClick(DialogInterface dialog, int which) {
                    // TODO Auto-generated method stub
                     dialog.dismiss();
                }
            });

               final AlertDialog alertDialog = builder.create(); 

               alertDialog.setIcon(R.drawable.icon1);
               alertDialog.show();
        }
    });
Run Code Online (Sandbox Code Playgroud)

android popup dismiss android-alertdialog

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

Android运行时错误:无法编组值

我这次使用的是Serializable Interface.我想将ArrayList从一个活动传递到另一个活动,但它给了我这个错误"无法编组值",代码是,

//发送活动:

    public class LogIn extends Activity implements OnClickListener
    {
    ProgressDialog pd;
    ImageButton logIn,registr;
    EditText userName,Password;
     public static String usrName,passwrd;
     String TAG=LogIn.class.getName();
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.login);
        userName=(EditText)findViewById(R.id.logIn_etuserName);
        Password=(EditText)findViewById(R.id.logIn_etpaswrd);
        logIn=(ImageButton)findViewById(R.id.logIn_B_logIn);
        registr=(ImageButton)findViewById(R.id.logIn_B_registration);       
        logIn.setOnClickListener(this);
        registr.setOnClickListener(this);

    }
    @Override
    public void onClick(View v)
    {

        String respns="";
        switch (v.getId())
        {
        case R.id.logIn_B_logIn:

            try 
            {
                usrName=userName.getText().toString();
                passwrd=Password.getText().toString();
                        if(usrName.contentEquals("") && passwrd.contentEquals(""))
                {
                    Toast.makeText(getApplicationContext(), "Enter       userName",Toast.LENGTH_LONG).show();
                }
      //                        else if(passwrd.contentEquals(""))
    //              {
    //                  Toast.makeText(getApplicationContext(), "Enter      password",Toast.LENGTH_LONG).show();
    //              }
                else
                {
                    pd=ProgressDialog.show(LogIn.this, "LogIn", "Logging");
                    new …
Run Code Online (Sandbox Code Playgroud)

android bundle serializable

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