小编Luc*_*fer的帖子

如何在后台运行J2ME应用程序?

我有一个J2ME应用程序,它使用蓝牙并在对等移动设备中搜索文件并下载它.我希望让我的应用程序在后台运行,无论何时我接到电话,或者消息以及稍后几秒后恢复,有没有人就此工作请分享您的经验.有没有办法在后台运行Midlet?

java midlet midp java-me

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

如何在JNI中将char []转换为jstring?

在jni中,我想使用以下方法将char*转换为jstring:

env->NewStringUTF(chm_pcText)
Run Code Online (Sandbox Code Playgroud)

它适用于英文文本,但中文失败,并获得以下信息:

JNI WARNING: illegal continuation byte.
Run Code Online (Sandbox Code Playgroud)

怎么解决?

java-native-interface android

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

Android系统.动画表演

我正在使用一个动画翻转(打开ImageView),但动画效果不顺畅(看起来像性能问题).该图像是大小为128x128的PNG文件.

在这里,我将发布我的动画代码:

<set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false">
    <scale
        android:fromXScale="1.0"
        android:toXScale="0.0"
        android:fromYScale="1.0"
        android:toYScale="1.0"
        android:pivotX="50%"
        android:pivotY="50%"
        android:duration="500"
                android:fillAfter="false"
        android:fillEnabled="false"
    />
</set>
Run Code Online (Sandbox Code Playgroud)

我还想强调,包含视图最多可以包含8个ImageViews(也可以缩放).

你能否提供一些可以改善动画表现的建议?

performance animation android

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

在iphone sdk 4.3中单击按钮的警报消息

我是xcode编程的初学者.当我们要点击xcode-iphone-4.3中的按钮时,请告诉我如何显示警告信息

我的守则如下,

- (IBAction)buttonPressed:(id)sender{

    UIAlertView* mes=[[UIAlertView alloc] initWithTitle:@"Hello World!!!!!!" 
                                                    message:@"This is the Iphone app" delegate:self cancelButtonTitle:@"Ok" otherButtonTitles: nil];

    [mes show];

    [mes release];
Run Code Online (Sandbox Code Playgroud)

请帮我解决这个问题.

iphone xcode alert onclick button

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

如何提高以下代码的性能?

我有以下代码显示带有字母的图像,

public class MainActivity extends Activity 
{
    private String[] capital_letters,small_letters;
    @Override
    protected void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.activity_main);
    }

    @Override
    protected void onStart()
    {
        super.onStart();

        try
        {
            capital_letters = getApplicationContext().getResources().getStringArray( R.array.capital_letters );
            small_letters = getApplicationContext().getResources().getStringArray( R.array.small_letters );

            MyAdapter adapter = new MyAdapter ( MainActivity.this ,capital_letters,small_letters );
            ListView list = ( ListView ) findViewById( R.id.list );
            list.setAdapter( adapter );

            list.setOnItemClickListener( new AdapterView.OnItemClickListener() 
            {
                @Override
                public void onItemClick(AdapterView<?> arg0, View arg1, int position,long id ) 
                {
                    Intent intent = …
Run Code Online (Sandbox Code Playgroud)

performance android

7
推荐指数
2
解决办法
2009
查看次数

应用程序崩溃时的android静态变量行为

在我的应用程序中,我有Loginactivity.它有一个静态变量用户名,它将被分配给用户输入用户名的值.Loginactivity启动活动A和A启动B.在A i中使用变量Loginactivity.username.

现在由于B中的一些错误,应用程序崩溃了.当我按下强制关闭时,应用程序重新启动,活动A是当前活动.在活动AI中使用静态变量Loginactivity.username.我看到崩溃后这个变量的初始值为空字符串"";

为什么会这样?你能解释一下这种行为吗?因此,当应用程序崩溃时,堆栈中的所有活动都会重新启动?我看到登录活动的oncreate没有被调用.那么静态变量值如何变化?

crash android static-variables

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

在android中使用短信管理器发送批量短信

我发送短信几乎到90-100号使用SmsManager,我正在从文件中读取数字并将数字传递给sendtextmessage函数如下

String[] nos;// this array contains mobile nos
SmsManager sm = Smsmanager.getDefault();
for(int i=0;i<nos.length;i++){
 sm.sendtextmessage(nos[i],null,"hello",null,null);
}
Run Code Online (Sandbox Code Playgroud)

问题是:

  1. 代码正在执行,但消息没有发送,即使我有平衡
  2. 我改变代码使用股票短信应用程序发送即使这也无法发送.
  3. 如果我从库存应用程序发送一对一,它正在发送,但如果我选择超过5的数字,那么它不发送我使用的htc资源管理器.

sms android

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

如何从.db.crypt文件中读取数据?

我想从字符串中读取数据.db.crypt file是否有任何lib或方法来解密此文件中的数据?

如果是,那么请指点我或提供任何样品.

database android

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

OkHttp SSLHandshakeException SSL握手中止SSL库中的失败,协议错误

04-23 17:17:38.434 21599-21956/ D/NativeCrypto: ssl=0x0 NativeCrypto_SSL_interrupt
04-23 17:17:38.435 21599-21956/ D/OkHttp: <-- HTTP FAILED: javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x635d8808: Failure in SSL library, usually a protocol error
    error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:744 0x5e6c46fd:0x00000000)
Run Code Online (Sandbox Code Playgroud)

Android较低版本的设备(4.1 - 4.4)给出了SSL错误.以前版本适用于以下版本:

implementation 'com.squareup.okhttp3:okhttp:3.9.1'
implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.9.1'
implementation 'com.squareup.okhttp3:logging-interceptor:3.9.1'

implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-jackson:2.3.0'
implementation 'com.squareup.retrofit2:adapter-rxjava:2.3.0'
Run Code Online (Sandbox Code Playgroud)

但升级这些库后,事情就会发生变化 每个服务调用都会提供SSL握手异常.

implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.10.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'

implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-jackson:2.4.0'
implementation 'com.squareup.retrofit2:adapter-rxjava:2.4.0'
Run Code Online (Sandbox Code Playgroud)

此外,如果我将这些库降级到以前的版本,它仍然无法正常工作.但git checkout到上一次提交工作正常.懵懵懂懂.

android retrofit okhttp retrofit2 okhttp3

7
推荐指数
2
解决办法
6989
查看次数

如何检测我的位置不再显示在地图上(导航后)?

我想在地图中添加一个按钮,将地图置于用户当前位置的中心,但只有当用户在地图中导航并且他的当前位置不再显示在地图上时,才应激活该按钮.检测我使用该onTouchEvent方法的导航.

 @Override
public boolean onTouchEvent(MotionEvent event, MapView mapView) {

Log.e("Touch", Integer.toString(event.getAction()));

int action = event.getAction();
if (action == MotionEvent.ACTION_DOWN) {
    touchStarted = true;
} else if (action == MotionEvent.ACTION_MOVE) {

   if (event.getPointerCount() > 3)
     moveStarted = true;
    return true;

}
return true;
}
Run Code Online (Sandbox Code Playgroud)

但我怎么检测到我的当前位置不再在屏幕上?

android android-maps-v2

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