小编Gan*_*Ako的帖子

在Android中实现Jain SIP

我正在尝试使用Jain SIP制作一个android应用。我已经阅读了SIP的基础教程,现在我正在寻找如何在android中实现jain sip的教程。我搜索了一下,但没有看到如何在android上实现它。所以我问任何知道教程链接的人,如何在androidh中实现jain sip,这只是一个简单的示例,说明如何在androidh上使用它。

任何想法都会得到高度评价。

android sip jain-sip

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

WindowManager.LayoutParams.FLAG_SECURE 无法更改?

我正在使用 WindowManager.LayoutParams.FLAG_SECURE 禁用屏幕截图。现在是否可以立即更改 WindowManager.LayoutParams.FLAG_SECURE 而无需重新加载活动?

例如:我有一个使用 View Pager 的照片查看器,我只想禁用所选图像的屏幕截图。那么我可以通过视图寻呼机的 onPageChanged 安全地更改标志吗?

任何想法都将受到高度赞赏。谢谢。

android

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

图表Api无法从Android SDK SDK获取位置

我在我的Android应用程序中使用Facebook SDK.我需要获取用户的所有信息.到现在为止,我可以获得名称ID电子邮件生日和用户的个人资料照片.我需要得到的最后一个是用户的位置或当前位置.我在下面使用此代码.

if(fb.isSessionValid()){
            button.setImageResource(R.drawable.logout_button);

            JSONObject obj = null;
            URL img = null;


             try {
                    String jsonUser = fb.request("me");
                    obj = Util.parseJson(jsonUser);
                    String id = obj.optString("id");
                    String name = obj.optString("name");
                    String bday = obj.optString("birthday");
                    String address = obj.optString("location");
                    String email = obj.optString("email");
                    ((TextView) findViewById(R.id.txt)).setText("Welcome! "+name);
                    ((TextView) findViewById(R.id.txtbday)).setText("Birthday: "+bday);
                    ((TextView) findViewById(R.id.txtaddress)).setText("Address: "+address);
                    ((TextView) findViewById(R.id.txtemail)).setText("Email: "+email);
                    img = new URL("http://graph.facebook.com/"+id+"/picture?type=normal");
                    Bitmap bmp = BitmapFactory.decodeStream(img.openConnection().getInputStream());
                    pic.setImageBitmap(bmp);

                } catch (FacebookError e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                } catch (JSONException e) {
                    // TODO …
Run Code Online (Sandbox Code Playgroud)

android facebook facebook-graph-api

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

NullPointer使用Espresso时出现异常

我正在尝试使用Espresso.但我得到了这个错误,如果我错过了一些代码,我就没有.

任何想法都将受到高度赞赏.

错误日志:

java.lang.NullPointerException: No instrumentation registered. Must run under a registering instrumentation.
    at com.google.android.apps.common.testing.testrunner.util.Checks.checkNotNull(Checks.java:28)
    at com.google.android.apps.common.testing.testrunner.InstrumentationRegistry.getInstance(InstrumentationRegistry.java:23)
    at com.google.android.apps.common.testing.ui.espresso.base.BaseLayerModule.provideTargetContext(BaseLayerModule.java:50)
    at com.google.android.apps.common.testing.ui.espresso.base.BaseLayerModule$$ModuleAdapter$ProvideTargetContextProvidesAdapter.get(BaseLayerModule$$ModuleAdapter.java:101)
    at com.google.android.apps.common.testing.ui.espresso.base.BaseLayerModule$$ModuleAdapter$ProvideTargetContextProvidesAdapter.get(BaseLayerModule$$ModuleAdapter.java:85)
    at com.google.android.apps.common.testing.ui.espresso.base.DefaultFailureHandler$$InjectAdapter.get(DefaultFailureHandler$$InjectAdapter.java:53)
    at com.google.android.apps.common.testing.ui.espresso.base.DefaultFailureHandler$$InjectAdapter.get(DefaultFailureHandler$$InjectAdapter.java:20)
    at com.google.android.apps.common.testing.ui.espresso.base.BaseLayerModule$$ModuleAdapter$ProvideFailureHanderProvidesAdapter.get(BaseLayerModule$$ModuleAdapter.java:555)
    at com.google.android.apps.common.testing.ui.espresso.base.BaseLayerModule$$ModuleAdapter$ProvideFailureHanderProvidesAdapter.get(BaseLayerModule$$ModuleAdapter.java:519)
    at com.google.android.apps.common.testing.ui.espresso.base.BaseLayerModule$FailureHandlerHolder$$InjectAdapter.get(BaseLayerModule$FailureHandlerHolder$$InjectAdapter.java:53)
    at com.google.android.apps.common.testing.ui.espresso.base.BaseLayerModule$FailureHandlerHolder$$InjectAdapter.get(BaseLayerModule$FailureHandlerHolder$$InjectAdapter.java:20)
    at dagger.internal.Linker$SingletonBinding.get(Linker.java:327)
    at com.google.android.apps.common.testing.ui.espresso.base.BaseLayerModule$$ModuleAdapter$ProvideFailureHandlerProvidesAdapter.get(BaseLayerModule$$ModuleAdapter.java:505)
    at com.google.android.apps.common.testing.ui.espresso.base.BaseLayerModule$$ModuleAdapter$ProvideFailureHandlerProvidesAdapter.get(BaseLayerModule$$ModuleAdapter.java:469)
    at com.google.android.apps.common.testing.ui.espresso.ViewInteraction$$InjectAdapter.get(ViewInteraction$$InjectAdapter.java:65)
    at com.google.android.apps.common.testing.ui.espresso.ViewInteraction$$InjectAdapter.get(ViewInteraction$$InjectAdapter.java:20)
    at dagger.ObjectGraph$DaggerObjectGraph.get(ObjectGraph.java:251)
    at com.google.android.apps.common.testing.ui.espresso.Espresso.onView(Espresso.java:58)
    at com.example.espresso.TestExample.testCommand(TestExample.java:28)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:214)
    at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:199)
    at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:192)
    at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:190)
    at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:175)
    at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555)
    at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1590)
Run Code Online (Sandbox Code Playgroud)

TestExample.java

public class TestExample extends ActivityInstrumentationTestCase2<ClickActivity>{

    public TestExample() {
        super(ClickActivity.class);
        // TODO …
Run Code Online (Sandbox Code Playgroud)

android android-espresso

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

在多个设备上发送推送通知

我正在尝试按照本教程在我的Android应用程序上发布推送通知

http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/

我已经有了这个教程,但我的问题是.它只会逐个发送通知.我需要通过发送一次将通知发送到所有gcm_id或注册的ID.

有人已经解决了这个问题吗?

这是我的index.php

<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
        <script type="text/javascript">
            $(document).ready(function(){

            });
            function sendPushNotification(id){
                var data = $('form#'+id).serialize();
                $('form#'+id).unbind('submit');                
                $.ajax({
                    url: "send_message.php",
                    type: 'GET',
                    data: data,
                    beforeSend: function() {

                    },
                    success: function(data, textStatus, xhr) {
                          $('.txt_message').val("");
                    },
                    error: function(xhr, textStatus, errorThrown) {

                    }
                });
                return false;
            }
        </script>
        <style type="text/css">
            .container{
                width: 950px;
                margin: 0 …
Run Code Online (Sandbox Code Playgroud)

php android google-cloud-messaging

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