有谁知道如何运行USSD命令检查电话的信用余额(数字是*123#)并获得结果(贷方余额)进一步处理?thankss
我是phonegap的新手,我想为android开发一个phonegap应用程序..我想在按钮上点击我的html上给一些功能..我已经尝试过这段代码,但它不起作用:
的index.html
<!DOCTYPE HTML>
<html>
<head>
<title>PhoneGap</title>
<script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
<script type="text/javascript" charset="utf-8" src="mycode.js"></script>
</head>
<body onload="init();>
<h1>Hello World</h1>
<form>
<input type="button" value="Click me" onclick="msg()" />
</form>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
mycode.js
function init() {
// the next line makes it impossible to see Contacts on the HTC Evo since it
// doesn't have a scroll button
// document.addEventListener("touchmove", preventBehavior, false);
document.addEventListener("deviceready", deviceInfo, true);
}
function msg()
{
alert("button clicked");
}
Run Code Online (Sandbox Code Playgroud)
有谁知道如何解决我的问题?谢谢你..
我创建了我的锁屏应用程序,它由一个短信驱动..我有ListenSMS类,总是收听传入的短信.这是代码:
for (SmsMessage message : messages) {
String tempMessage[] = message.getDisplayMessageBody().toString().split(" ");
//checking command dan password
if (tempMessage[0].toString().equalsIgnoreCase("andro-lock") && tempMessage[1].toString().equals(tempPassword.toString())) {
//Toast.makeText(ListenSMSservice.this, "Menjalankan command andro-lock", Toast.LENGTH_LONG).show();
openDatabase();
updateStatusL();
Intent myIntent = new Intent(ListenSMSservice.this,LockScreenForm.class);
myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getApplication().startActivity(myIntent);
}
else if (tempMessage[0].toString().equalsIgnoreCase("andro-unlock") && tempMessage[1].toString().equals(tempPassword.toString())) {
//Toast.makeText(ListenSMSservice.this, "Menjalankan command andro-unlock", Toast.LENGTH_LONG).show();
openDatabase();
updateStatusNL();
Intent myIntent = new Intent(ListenSMSservice.this,LockScreenForm.class);
myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Bundle myKillerBundle = new Bundle();
myKillerBundle.putString("kill","1");
myIntent.putExtras(myKillerBundle);
getApplication().startActivity(myIntent);
}
}
Run Code Online (Sandbox Code Playgroud)
如果ListenSMS服务收到一个andro-lock命令,它将转到lockscreen.java 并将kill在收到命令时使用intent extra(putExtra)转到lockscreen.java andro-unclock.这是我的lockscreen.java:
public class LockScreenForm extends …Run Code Online (Sandbox Code Playgroud) 我想制作一个锁屏应用程序.当手机处于锁定模式时,它会在插入USB时关闭手机,以防止其他用户访问手机数据.有没有人知道如何以编程方式关闭Android设备,以便其他人无法在锁定模式下访问数据?
这是锁定屏幕活动上锁定主页按钮的代码:
@Override
public void onAttachedToWindow()
{
this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);
super.onAttachedToWindow();
}
Run Code Online (Sandbox Code Playgroud) 我创建一个锁屏应用程序,我需要禁用一个主页按钮,所以如果该手机被盗,该手机无法访问..我的锁屏是一个全屏活动..我使用此代码禁用主页按钮,但它给了我一些bug.这是代码:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
@Override
public void onAttachedToWindow()
{
this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);
super.onAttachedToWindow();
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
return false;
}
Run Code Online (Sandbox Code Playgroud)
该代码给了我一些像通知/状态区域的错误,即使我在全屏模式下的活动仍然可以访问,如果我关闭我的显示并再次打开它..错误是这样的:
第一次申请开始:(仍然没问题)

从电源按钮关闭屏幕并再次打开后:

主要问题是在锁屏上..当仍然可以访问通知区域时,锁屏无用..
任何想法如何解决这个?请帮忙..
当我按下结束键按钮时,我也遇到了同样的问题.
android android-manifest android-layout android-notifications
我创建了一个安全应用程序,就像Mcafee wave secure一样.
我的应用程序正在侦听SMS命令并在命令匹配时执行某些操作,因此我创建了一个表单,其中包含另一个用于侦听SMS的服务.
这是主要形式:
public static final String SMS_RECEIVED = "android.provider.Telephony.SMS_RECEIVED";
ArrayList<String> messageList;
ArrayAdapter< String> adapter;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//untuk mendisable notification area
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.main);
MainButtonAbout=(Button) findViewById(R.id.MainbuttonAbout);
MainButtonHelp=(Button) findViewById(R.id.MainbuttonHelp);
MainButtonWizard=(Button) findViewById(R.id.MainbuttonWizard);
MainButtonOption=(Button) findViewById(R.id.MainbuttonOption);
MainCheckBoxActive=(CheckBox)findViewById(R.id.MaincheckBoxActive);
MainButtonAbout.setOnClickListener(this);
MainButtonHelp.setOnClickListener(this);
MainButtonWizard.setOnClickListener(this);
MainButtonOption.setOnClickListener(this);
startService(new Intent(MainForm.this, ListenSMSservice.class));
MainCheckBoxActive.setOnCheckedChangeListener(new OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
// TODO Auto-generated method stub
if (buttonView.isChecked())
{
Toast.makeText(MainForm.this, "Your Device is Protected Now!!", 1).show();
startService(new Intent(MainForm.this, ListenSMSservice.class));
}
else
{
Toast.makeText(MainForm.this, …Run Code Online (Sandbox Code Playgroud) 我做了一个紧急应用程序,当按下音量减小键或菜单键时,它会向5个人发送短信.这是我在启动活动时检测按键的代码:
package com.application.tpa;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.widget.Toast;
public class main extends Activity {
/** Called when the activity is first created. */
int ctrMenu=0,ctrkeyUp=0;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//startService(new Intent(main.this, PAservice.class));
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if ((keyCode == KeyEvent.KEYCODE_MENU)) {
ctrkeyUp=0;
ctrMenu++;
if (ctrMenu==5)
{
Toast.makeText(this, "You pressed the Menu button!", Toast.LENGTH_LONG).show();
ctrMenu=0;
}
//return true;
}
else if ((keyCode == KeyEvent.KEYCODE_VOLUME_DOWN)) {
ctrMenu=0;
ctrkeyUp++; …Run Code Online (Sandbox Code Playgroud) 我用钛金属移动设备进行简单的登录和菜单显示.这是我的登录代码:
Login.js
function Login() {
var loginView = Titanium.UI.createView({
backgroundColor:'#C4FBFF',
layout:'vertical'
});
var txtUsername = Titanium.UI.createTextField({
width:'75%',
hintText:'Username',
borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED
});
var txtPassword = Titanium.UI.createTextField({
width:'75%',
hintText:'Password',
borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
passwordMask:true
});
var btnLogin = Titanium.UI.createButton({
title:'Login',
width:'75%'
});
loginView.add(txtUsername);
loginView.add(txtPassword);
loginView.add(btnLogin);
btnLogin.addEventListener('click',function(e){
var alertDialog = Titanium.UI.createAlertDialog({
title: 'Confirmation',
message: 'You will be logged in as ' + txtUsername.value + ', continue?',
buttonNames: ['Yes','No']
});
alertDialog.addEventListener('click',function(e){
if (e.index === 0){ //Yes Pressed
var isAndroid = Ti.Platform.osname === 'android' ? true : false;
var …Run Code Online (Sandbox Code Playgroud) javascript titanium appcelerator appcelerator-mobile titanium-mobile
android ×7
android-ndk ×5
java ×5
javascript ×2
appcelerator ×1
dom-events ×1
html ×1
phonegap ×1
titanium ×1
ussd ×1