public static void download() {
    Log.d(TAG, "download begin");
    //
    String serveriport = DomAppConfigFactory.getAppConfig().getServeripport();
    String padId = AndroidIdSupport.getAndroidID();
    String[] arguments = {serveriport, padId};

    String rspathPadInfoResult = MessageFormat.format(rspathPadInfo, arguments);
    Log.d(TAG, "rspathPadInfoResult is : " + rspathPadInfoResult);
    Thread thread = new Thread(new DownloadPadInfoRunnable(rspathPadInfoResult));
    thread.start();

    Log.d(TAG, "download end");
  } // end of download
Example #2
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    Log.d(TAG, "onCreate begin");
    super.onCreate(savedInstanceState);
    setContentView(R.layout.download_activity_main);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    //
    AppInitSupport.initApp(this.getApplicationContext(), this.getAssets());
    // 设备ID
    String androidId = AndroidIdSupport.getAndroidID();
    TextView tvAndroidId = (TextView) this.findViewById(R.id.textViewDeviceId);
    tvAndroidId.setText(androidId);
    // UI handler
    DownloadUIHandler.init(this);

    // 会议列表
    ListView lvMeetingInfo = (ListView) this.findViewById(R.id.lvMeetingList);
    BaseAdapter meetingListItemAdapter = new MeetingInfoLVButtonAdapter(this);
    lvMeetingInfo.setAdapter(meetingListItemAdapter);
    //
    toggleBtnDownload = (ToggleButton) findViewById(R.id.toggleBtnDownload);
    toggleBtnDownload.setOnClickListener(
        new OnClickListener() {
          public void onClick(View v) {
            if (toggleBtnDownload.isChecked()) {
              WsDownloadServiceSupport.getInstance().connect();
              //                    Toast.makeText(DownloadActivity.this, "进入",
              // Toast.LENGTH_LONG).show();
            } else {
              WsDownloadServiceSupport.getInstance().disconnect();
              //                    Toast.makeText(DownloadActivity.this, "退出",
              // Toast.LENGTH_LONG).show();
            }
          } // end of onClick
        });

    Button btnEntryActivateMeeting = (Button) findViewById(R.id.btnEntryActivateMeeting);
    btnEntryActivateMeeting.setOnClickListener(
        new OnClickListener() {
          public void onClick(View v) {
            // TODO:fixme
            Intent intent = new Intent();
            //        		intent.setClass(DownloadActivity.this, LoginActivity.class);
            intent.setData(Uri.parse("one"));
            startActivityForResult(intent, REQUEST_CODE); // 以传递参数的方式跳转到下一个Activity
          }
        });
    Log.d(TAG, "onCreate end");
  } // end of onCreate