下载地址:http://www.anzhi.com/intro.php?softid=260105&auth=1

package youling.co.cc;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Timer;
import java.util.TimerTask;

import net.miidi.credit.IAuxiliaryNotifier;
import net.miidi.credit.IOffersNotifier;
import net.miidi.credit.MiidiCredit;
import android.app.Activity;
import android.app.AlertDialog.Builder;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.graphics.Typeface;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.SoundPool;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.SubMenu;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.ScrollView;
import android.widget.TextView;

public class YoulingActivity extends Activity implements IOffersNotifier,
IAuxiliaryNotifier {

SoundPool mSoundPool;
HashMap<Integer, Integer> soundHashMap;
MediaPlayer mediaPlayer;
ScrollView scrollview;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
MiidiCredit.init(YoulingActivity.this, "4976", "wo8teggz90agaaty",
false);
setContentView(R.layout.main);
mediaPlayer = MediaPlayer.create(YoulingActivity.this, R.raw.a48);
mediaPlayer.start();

soundHashMap = new HashMap<Integer, Integer>();
scrollview = (ScrollView) findViewById(R.id.scrollview);
final TextView mTextView111 = (TextView) findViewById(R.id.textView11);
final TextView mTextView0 = (TextView) findViewById(R.id.t1);
final TextView mTextView1 = (TextView) findViewById(R.id.t2);
final TextView mTextView2 = (TextView) findViewById(R.id.t3);
final TextView mTextView3 = (TextView) findViewById(R.id.t4);
final TextView mTextView4 = (TextView) findViewById(R.id.t5);
final TextView mTextView5 = (TextView) findViewById(R.id.t6);
final TextView mTextView6 = (TextView) findViewById(R.id.t7);
final TextView mTextView7 = (TextView) findViewById(R.id.t8);
final TextView mTextView8 = (TextView) findViewById(R.id.t9);
final TextView mTextView9 = (TextView) findViewById(R.id.t10);
final TextView mTextView10 = (TextView) findViewById(R.id.t11);
final TextView mTextView11 = (TextView) findViewById(R.id.t12);
final TextView mTextView12 = (TextView) findViewById(R.id.t13);
final TextView mTextView13 = (TextView) findViewById(R.id.t14);
final TextView mTextView14 = (TextView) findViewById(R.id.t15);
final TextView mTextView15 = (TextView) findViewById(R.id.t16);
final TextView mTextView16 = (TextView) findViewById(R.id.t17);
final TextView mTextView17 = (TextView) findViewById(R.id.t18);
final TextView mTextView18 = (TextView) findViewById(R.id.t19);
final TextView mTextView19 = (TextView) findViewById(R.id.t20);
final TextView mTextView20 = (TextView) findViewById(R.id.t21);
final TextView mTextView21 = (TextView) findViewById(R.id.t22);
final TextView mTextView22 = (TextView) findViewById(R.id.t23);
final TextView mTextView23 = (TextView) findViewById(R.id.t24);
final TextView mTextView24 = (TextView) findViewById(R.id.t25);
final ImageView mImageViewr2 = (ImageView) findViewById(R.id.r2);
mImageViewr2.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
// TODO Auto-generated method stub
MiidiCredit.showAppOffers();

}
});

Typeface typeFace = Typeface.createFromAsset(getAssets(),
"fonts/mini.ttf");
mTextView0.setTypeface(typeFace);
mTextView1.setTypeface(typeFace);
mTextView2.setTypeface(typeFace);
mTextView3.setTypeface(typeFace);
mTextView4.setTypeface(typeFace);
mTextView5.setTypeface(typeFace);
mTextView6.setTypeface(typeFace);
mTextView7.setTypeface(typeFace);
mTextView8.setTypeface(typeFace);
mTextView9.setTypeface(typeFace);
mTextView10.setTypeface(typeFace);
mTextView11.setTypeface(typeFace);
mTextView12.setTypeface(typeFace);
mTextView13.setTypeface(typeFace);
mTextView14.setTypeface(typeFace);
mTextView15.setTypeface(typeFace);
mTextView16.setTypeface(typeFace);
mTextView17.setTypeface(typeFace);
mTextView18.setTypeface(typeFace);
mTextView19.setTypeface(typeFace);
mTextView20.setTypeface(typeFace);
mTextView21.setTypeface(typeFace);
mTextView22.setTypeface(typeFace);
mTextView23.setTypeface(typeFace);
mTextView24.setTypeface(typeFace);
mSoundPool = new SoundPool(60, AudioManager.STREAM_SYSTEM, 5);
soundHashMap.put(1, mSoundPool.load(this, R.raw.a1, 1));
soundHashMap.put(2, mSoundPool.load(this, R.raw.a2, 1));
soundHashMap.put(3, mSoundPool.load(this, R.raw.a3, 1));
soundHashMap.put(4, mSoundPool.load(this, R.raw.a4, 1));
soundHashMap.put(5, mSoundPool.load(this, R.raw.a5, 1));
soundHashMap.put(6, mSoundPool.load(this, R.raw.a6, 1));
soundHashMap.put(7, mSoundPool.load(this, R.raw.a7, 1));
soundHashMap.put(8, mSoundPool.load(this, R.raw.a8, 1));
soundHashMap.put(9, mSoundPool.load(this, R.raw.a9, 1));
soundHashMap.put(10, mSoundPool.load(this, R.raw.a10, 1));
soundHashMap.put(11, mSoundPool.load(this, R.raw.a11, 1));
soundHashMap.put(12, mSoundPool.load(this, R.raw.a12, 1));
soundHashMap.put(13, mSoundPool.load(this, R.raw.a13, 1));
soundHashMap.put(14, mSoundPool.load(this, R.raw.a14, 1));
soundHashMap.put(15, mSoundPool.load(this, R.raw.a15, 1));
soundHashMap.put(16, mSoundPool.load(this, R.raw.a16, 1));
soundHashMap.put(17, mSoundPool.load(this, R.raw.a17, 1));
soundHashMap.put(18, mSoundPool.load(this, R.raw.a18, 1));
soundHashMap.put(19, mSoundPool.load(this, R.raw.a19, 1));
soundHashMap.put(20, mSoundPool.load(this, R.raw.a20, 1));
soundHashMap.put(21, mSoundPool.load(this, R.raw.a21, 1));
soundHashMap.put(22, mSoundPool.load(this, R.raw.a22, 1));
soundHashMap.put(23, mSoundPool.load(this, R.raw.a23, 1));
soundHashMap.put(24, mSoundPool.load(this, R.raw.a24, 1));
soundHashMap.put(25, mSoundPool.load(this, R.raw.a25, 1));
soundHashMap.put(26, mSoundPool.load(this, R.raw.a26, 1));
soundHashMap.put(27, mSoundPool.load(this, R.raw.a27, 1));
soundHashMap.put(28, mSoundPool.load(this, R.raw.a28, 1));
soundHashMap.put(29, mSoundPool.load(this, R.raw.a29, 1));
soundHashMap.put(30, mSoundPool.load(this, R.raw.a30, 1));
soundHashMap.put(31, mSoundPool.load(this, R.raw.a31, 1));
soundHashMap.put(32, mSoundPool.load(this, R.raw.a32, 1));
soundHashMap.put(33, mSoundPool.load(this, R.raw.a33, 1));
soundHashMap.put(34, mSoundPool.load(this, R.raw.a34, 1));
soundHashMap.put(35, mSoundPool.load(this, R.raw.a35, 1));
soundHashMap.put(36, mSoundPool.load(this, R.raw.a36, 1));
soundHashMap.put(37, mSoundPool.load(this, R.raw.a37, 1));
soundHashMap.put(38, mSoundPool.load(this, R.raw.a38, 1));
soundHashMap.put(39, mSoundPool.load(this, R.raw.a39, 1));
soundHashMap.put(40, mSoundPool.load(this, R.raw.a40, 1));
soundHashMap.put(41, mSoundPool.load(this, R.raw.a41, 1));
soundHashMap.put(42, mSoundPool.load(this, R.raw.a42, 1));
soundHashMap.put(43, mSoundPool.load(this, R.raw.a43, 1));
soundHashMap.put(44, mSoundPool.load(this, R.raw.a44, 1));
soundHashMap.put(45, mSoundPool.load(this, R.raw.a45, 1));
soundHashMap.put(46, mSoundPool.load(this, R.raw.a46, 1));
soundHashMap.put(47, mSoundPool.load(this, R.raw.a47, 1));
soundHashMap.put(48, mSoundPool.load(this, R.raw.a48, 1));
soundHashMap.put(49, mSoundPool.load(this, R.raw.a49, 1));

String s1 = "2012-6-10 12:00:00";
SimpleDateFormat sDateFormat = new SimpleDateFormat(
"yyyy-MM-dd hh:mm:ss");
String date = sDateFormat.format(new java.util.Date());

DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Calendar c1 = Calendar.getInstance();
Calendar str = Calendar.getInstance();
try {
c1.setTime(df.parse(s1));
str.setTime(df.parse(date));

} catch (Exception e) {
// TODO: handle exception
}

int result = c1.compareTo(str);
// if (result == 0)
// System.out.println("当前时间等于系统时间");
if (result < 0) {
System.out.println("当前时间小于系统时间");

mImageViewr2.setVisibility(View.VISIBLE);
mTextView111.setVisibility(View.VISIBLE);

} else {
System.out.println("当前时间大于系统时间");

mImageViewr2.setVisibility(View.INVISIBLE);
mTextView111.setVisibility(View.INVISIBLE);

}

}

public void aa1(View v) {
mSoundPool.play(soundHashMap.get(1), 1, 1, 0, 0, 1);

}

public void aa2(View view) {
mSoundPool.play(soundHashMap.get(2), 1, 1, 0, 0, 1);

}

public void aa3(View view) {
mSoundPool.play(soundHashMap.get(3), 1, 1, 0, 0, 1);

}

public void aa4(View view) {
mSoundPool.play(soundHashMap.get(4), 1, 1, 0, 0, 1);

}

public void aa5(View view) {
mSoundPool.play(soundHashMap.get(5), 1, 1, 0, 0, 1);

}

public void aa6(View view) {
mSoundPool.play(soundHashMap.get(6), 1, 1, 0, 0, 1);

}

public void aa7(View view) {
mSoundPool.play(soundHashMap.get(7), 1, 1, 0, 0, 1);

}

public void aa8(View view) {
mSoundPool.play(soundHashMap.get(8), 1, 1, 0, 0, 1);

}

public void aa9(View view) {
mSoundPool.play(soundHashMap.get(9), 1, 1, 0, 0, 1);

}

public void aa10(View view) {
mSoundPool.play(soundHashMap.get(10), 1, 1, 0, 0, 1);

}

public void aa11(View view) {
mSoundPool.play(soundHashMap.get(11), 1, 1, 0, 0, 1);

}

public void aa12(View view) {
mSoundPool.play(soundHashMap.get(12), 1, 1, 0, 0, 1);

}

public void aa13(View view) {
mSoundPool.play(soundHashMap.get(13), 1, 1, 0, 0, 1);

}

public void aa14(View view) {
mSoundPool.play(soundHashMap.get(14), 1, 1, 0, 0, 1);

}

public void aa15(View view) {
mSoundPool.play(soundHashMap.get(15), 1, 1, 0, 0, 1);

}

public void aa16(View view) {
mSoundPool.play(soundHashMap.get(16), 1, 1, 0, 0, 1);

}

public void aa17(View view) {
mSoundPool.play(soundHashMap.get(17), 1, 1, 0, 0, 1);

}

public void aa18(View view) {
mSoundPool.play(soundHashMap.get(18), 1, 1, 0, 0, 1);

}

public void aa19(View view) {
mSoundPool.play(soundHashMap.get(19), 1, 1, 0, 0, 1);

}

public void aa20(View view) {
mSoundPool.play(soundHashMap.get(20), 1, 1, 0, 0, 1);

}

public void aa21(View view) {
mSoundPool.play(soundHashMap.get(21), 1, 1, 0, 0, 1);

}

public void aa22(View view) {
mSoundPool.play(soundHashMap.get(22), 1, 1, 0, 0, 1);

}

public void aa23(View view) {
mSoundPool.play(soundHashMap.get(23), 1, 1, 0, 0, 1);

}

public void aa24(View view) {
mSoundPool.play(soundHashMap.get(24), 1, 1, 0, 0, 1);

}

public void aa25(View view) {
mSoundPool.play(soundHashMap.get(25), 1, 1, 0, 0, 1);

}

public void aa26(View view) {
mSoundPool.play(soundHashMap.get(26), 1, 1, 0, 0, 1);

}

public void aa27(View view) {
mSoundPool.play(soundHashMap.get(27), 1, 1, 0, 0, 1);

}

public void aa28(View view) {
mSoundPool.play(soundHashMap.get(28), 1, 1, 0, 0, 1);

}

public void aa29(View view) {
mSoundPool.play(soundHashMap.get(29), 1, 1, 0, 0, 1);

}

public void aa30(View view) {
mSoundPool.play(soundHashMap.get(30), 1, 1, 0, 0, 1);

}

public void aa31(View view) {
mSoundPool.play(soundHashMap.get(31), 1, 1, 0, 0, 1);

}

public void aa32(View view) {
mSoundPool.play(soundHashMap.get(32), 1, 1, 0, 0, 1);

}

public void aa33(View view) {
mSoundPool.play(soundHashMap.get(33), 1, 1, 0, 0, 1);

}

public void aa34(View view) {
mSoundPool.play(soundHashMap.get(34), 1, 1, 0, 0, 1);

}

public void aa35(View view) {
mSoundPool.play(soundHashMap.get(35), 1, 1, 0, 0, 1);

}

public void aa36(View view) {
mSoundPool.play(soundHashMap.get(36), 1, 1, 0, 0, 1);

}

public void aa37(View view) {
mSoundPool.play(soundHashMap.get(37), 1, 1, 0, 0, 1);

}

public void aa38(View view) {
mSoundPool.play(soundHashMap.get(38), 1, 1, 0, 0, 1);

}

public void aa39(View view) {
mSoundPool.play(soundHashMap.get(39), 1, 1, 0, 0, 1);

}

public void aa40(View view) {
mSoundPool.play(soundHashMap.get(40), 1, 1, 0, 0, 1);

}

public void b9(View view) {
mSoundPool.play(soundHashMap.get(41), 1, 1, 0, 0, 1);

}

public void b8(View view) {
mSoundPool.play(soundHashMap.get(42), 1, 1, 0, 0, 1);

}

public void b7(View view) {
mSoundPool.play(soundHashMap.get(43), 1, 1, 0, 0, 1);

}

public void b6(View view) {
mSoundPool.play(soundHashMap.get(44), 1, 1, 0, 0, 1);

}

public void b5(View view) {
mSoundPool.play(soundHashMap.get(45), 1, 1, 0, 0, 1);

}

public void b4(View view) {
mSoundPool.play(soundHashMap.get(46), 1, 1, 0, 0, 1);

}

public void b3(View view) {
mSoundPool.play(soundHashMap.get(47), 1, 1, 0, 0, 1);

}

public void b2(View view) {
mSoundPool.play(soundHashMap.get(48), 1, 1, 0, 0, 1);

}

public void b10(View view) {
mSoundPool.play(soundHashMap.get(49), 1, 1, 0, 0, 1);

}

@Override
protected void onPause() {
// TODO Auto-generated method stub
mediaPlayer.release();
super.onPause();
}

@Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
if (getRequestedOrientation() != ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
}

@Override
public void onChannelIdCb(int arg0) {
// TODO Auto-generated method stub

}

@Override
public void onSdkVersionCb(String arg0) {
// TODO Auto-generated method stub

}

@Override
public void onShowAppsFinishCb() {
// TODO Auto-generated method stub

}

@Override
public void onUpdatePointsCb(String arg0, int arg1) {
// TODO Auto-generated method stub

}

@Override
public void onBackPressed() {
// TODO Auto-generated method stub
super.onBackPressed();

Intent i = new

Intent(Intent.ACTION_MAIN);

i.setFlags

(Intent.FLAG_ACTIVITY_NEW_TASK);

i.addCategory

(Intent.CATEGORY_HOME);

startActivity(i);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// TODO Auto-generated method stub
SubMenu subMenu = menu.addSubMenu(0, 1, 0, "关于");
SubMenu subMenu2 = menu.addSubMenu(0, 2, 0, "退出");
return super.onCreateOptionsMenu(menu);
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
// TODO Auto-generated method stub
if (item.getItemId() == 1) {
Builder builder = new Builder(YoulingActivity.this);
builder.setTitle("软件信息");
builder.setMessage(R.string.about_cont1);
builder.show();

} else {
scrollview.startAnimation(new TV());
new Timer().schedule(new TimerTask() {

@Override
public void run() {

android.os.Process.killProcess(android.os.Process.myPid());

}
}, 1000);
}

return super.onOptionsItemSelected(item);
}

}

更多相关文章

  1. Android(安卓)通过handler和message在子线程里面去更新UI
  2. android 获取时间
  3. Android(安卓)Notification不显示时间
  4. Android获取UTC时间的方式
  5. Android(安卓)判断获取的时间是否是今天、昨天
  6. 关于android的des算法代码
  7. android 时间对话框
  8. android之seekBar
  9. android 入门 AlarmManager 例子

随机推荐

  1. 通过 javascript和php 实现打印问题
  2. 如何在PDO中使用RLIKE来转义星号和问号?
  3. php 读取文本文件
  4. 如何打开名称中包含特殊字符的文件
  5. 国内外常用wiki程序汇总
  6. 用Hack编写的代码比在HHVM上用PHP编写的
  7. NFS共享上的“stat failed”问题
  8. 在数组中找到键是找不到文本[重复]
  9. php实现邮件自动发送之PHPMailer
  10. [请大家关注]有关PHP大型程序开发的方法!