小编Sae*_*var的帖子

从proguard中排除包裹

在proguard.cfg中排除父包后,如何包含某些包:

例如:

-keep com.myapp.**{*; }

我想要proguard来混淆com.myapp.data.**{*; }

java obfuscation android proguard

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

在Android上与wifi同步的wifi-direct端连接?

有没有办法通过Wifi-Direct结束与对等体的连接?我尝试了cancelConnect和removeGroup.他们两个都回来忙吗?谢谢.

android service-discovery wifi-direct

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

如何知道Android解码器MediaCodec.createDecoderByType(type)是硬件还是软件解码器?

有没有办法找出使用MediaCodec.createDecoderByType(type)接收的解码器是硬件解码器还是软件解码器?

android hardware-acceleration android-mediaplayer mediacodec

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

实现了GetHashCode但是Dictionary无法找到密钥?

在我的班上,我实施了EqualsGetHashCode.但当我在C#代码中使用它作为字典的键时,我收到错误:"Key not found exception" 谢谢,

public class Time: IEquatable<Time>
{
    public String hour;
    public String minute;

    public Time()
    {
        hour = "00";
        minute = "00";
    }

    public Time(String hour, String minute)
        : this()
    {
        this.hour = hour;
        this.minute = minute;
    }

    public override int GetHashCode()
    {
        int hash = int.Parse(hour) * 60 + int.Parse(minute);
        return hash.GetHashCode();
    }
    public override bool Equals(Time time)
    {

            return (this.hour == time.hour && this.minute == time.minute);

    }

}
Run Code Online (Sandbox Code Playgroud)

以及我使用它的代码:

Dictionary<Time, …
Run Code Online (Sandbox Code Playgroud)

c# dictionary iequatable gethashcode

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

使用 guice 将 CrossOriginFilter 添加到 dropwizard

我对 dropwizard 和 guice 还很陌生。当我在本地通过 ajax 代码访问 api 时,浏览器控制台上出现以下错误。请求的资源上不存在“Access-Control-Allow-Origin”标头。因此,不允许访问来源“null”。

研究该错误后,许多人建议将 CrossORiginFilter 添加到我的 dropwizard 代码中。这是通过 env.addFilter 完成的但我正在尝试使用 Guice。这是我的主课

public static void main( String[] args ) throws Exception
{
    new TListService().run( args );
}

@Override
public void initialize( Bootstrap<TListServiceConfiguration> bootstrap )
{
    bootstrap.setName( "tlist" );
    bootstrap.addBundle( GuiceBundle.< TListServiceConfiguration > newBuilder().addModule( new JpaPersistModule( this.getClass().getPackage().getName() ) ).setConfigClass( TListServiceConfiguration.class )
            .enableAutoConfig( this.getClass().getPackage().getName() ).build() );
}

@Override
public void run( TListServiceConfiguration config, Environment env ) throws Exception
{        
}
Run Code Online (Sandbox Code Playgroud)

这是我的 ajax 代码:

$(document).ready(function() {
    $('#btnSend').click(function(){
        var …
Run Code Online (Sandbox Code Playgroud)

java ajax guice cross-domain dropwizard

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

GCM onRegistered没有打电话

我已经为GCM注册编写了一个代码,但我不知道为什么我没有得到GCMIntentService的任何回调(onRegistered,onError).请让我知道或指导我解决这个问题.
这是我的清单:

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.pushnotifydemo"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="15" />

    <permission
        android:name=".permission.C2D_MESSAGE"
        android:protectionLevel="signature" />

    <uses-permission android:name=".permission.C2D_MESSAGE" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".PushNotifyDemo"
            android:label="@string/title_activity_push_notify_demo" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <receiver
            android:name="com.google.android.gcm.GCMBroadcastReceiver"
            android:permission="com.google.android.c2dm.permission.SEND" >
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
                <category android:name="com.example.pushnotifydemo" />
            </intent-filter>
        </receiver>

        <service android:name=".GCMIntentService"  android:enabled="true" />

    </application>

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

这是我的CMIntentService:

 package com.example.pushnotifydemo;

import android.content.Context;
import android.content.Intent;
import android.util.Log; …
Run Code Online (Sandbox Code Playgroud)

android google-cloud-messaging

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