protected void onCreate(Bundle bundle) {
   logger.v("onCreate() ---> Enter");
   super.onCreate(bundle);
   requestWindowFeature(1);
   setContentView(R.layout.activity_online_music_column_detail_layout);
   mController = Controller.getInstance(MobileMusicApplication.getInstance());
   mViewFlipper = (ViewFlipper) findViewById(R.id.song_viewflipper);
   mTitleBar = (TitleBarView) findViewById(R.id.title_view);
   Intent intent = getIntent();
   if (intent.getExtras() != null) {
     mTitleBar.setTitle(intent.getStringExtra("title"));
     title = intent.getStringExtra("title");
     mIsFromPushService = intent.getBooleanExtra("fromPushService", false);
   }
   MusicListColumnItem musiclistcolumnitem =
       (MusicListColumnItem) intent.getParcelableExtra("COLUMITEM");
   logger.v("MusicListColumnItem.category_type ----" + musiclistcolumnitem.category_type);
   switch (Integer.parseInt(musiclistcolumnitem.category_type)) {
     case 1:
       deleteType = 0;
       SongListView songlistview = new SongListView(this);
       songlistview.setURL(musiclistcolumnitem.url);
       songlistview.setName(musiclistcolumnitem.title);
       mViewInterface = songlistview;
       mViewFlipper.addView(songlistview);
       break;
     case 2:
       break;
     default:
       break;
   }
   logger.v("onCreate() ---> Exit");
 }
Пример #2
0
 /**
  * 判断是否是中国移动的SIM卡
  *
  * @return
  */
 public static boolean isChinaMobileSIMCard() {
   boolean flag = false;
   String s =
       ((TelephonyManager) MobileMusicApplication.getInstance().getSystemService("phone"))
           .getSubscriberId();
   if (s != null) {
     if (!s.startsWith("46000") && !s.startsWith("46002")) {
       boolean flag1 = s.startsWith("46007");
       if (flag1) flag = true;
     }
   }
   return flag;
 }
Пример #3
0
 /**
  * 退出应用
  *
  * @param useForClear
  */
 public static void exitMobileMusicApp(final boolean useForClear) {
   Dispatcher dispatcher = MobileMusicApplication.getInstance().getEventDispatcher();
   dispatcher.sendMessage(dispatcher.obtainMessage(22));
   final MobileMusicApplication app = MobileMusicApplication.getInstance();
   if (PlayerControllerImpl.getInstance(app).isPlaying())
     PlayerControllerImpl.getInstance(app).stop();
   PlayerControllerImpl.getInstance(app).cancelPlaybackStatusBar();
   DLControllerImpl.getInstance(app).cancelDownloadRemainNotification();
   DLControllerImpl.getInstance(app).cancelDownloadNotification();
   shutDownHttpClient();
   MobileMusicService.stopService(app);
   if (useForClear) MobileMusicApplication.getInstance().setIsInitService(false);
   (new Handler())
       .postDelayed(
           new Runnable() {
             public void run() {
               if (!useForClear) {
                 Process.killProcess(Process.myPid());
                 DBControllerImpl.getInstance(app).closeDB();
               }
             }
           },
           600L);
 }
Пример #4
0
 /**
  * 创建HTTP的网络连接
  *
  * @param flag
  * @return
  */
 public static DefaultHttpClient createNetworkClient(boolean flag) {
   DefaultHttpClient defaulthttpclient;
   if (NetUtil.netState == 8) defaulthttpclient = null;
   else if (!NetUtil.isNetStateWap() && !flag) {
     logger.v("createNetworkClient() ---> !WlanUtils.isNetStateWap() && !isHttpReqIfWlan");
     if (NetUtil.netState != 1 && NetUtil.netState != 6) {
       logger.d("Wlan has been closed.");
       defaulthttpclient = null;
       return defaulthttpclient;
     } else {
       if (mHttpsClient == null) mHttpsClient = createHttpsClient();
       defaulthttpclient = mHttpsClient;
     }
   } else {
     MobileMusicApplication mobilemusicapplication = MobileMusicApplication.getInstance();
     if (NetUtil.netState != 3
         && NetUtil.netState != 5
         && !SystemControllerImpl.getInstance(mobilemusicapplication).checkWapStatus()) {
       logger.d("WAP has been closed.");
       defaulthttpclient = null;
       return defaulthttpclient;
     } else {
       if (mHttpClient == null) mHttpClient = createHttpClient();
       defaulthttpclient = mHttpClient;
       if (NetUtil.netState == 3) {
         HttpHost httphost =
             new HttpHost(
                 MusicBusinessDefine_WAP.CMCC_WAP_PROXY_HOST,
                 MusicBusinessDefine_WAP.CMCC_WAP_PROXY_PORT);
         if (defaulthttpclient == null) defaulthttpclient = createHttpsClient();
         defaulthttpclient.getParams().setParameter("http.route.default-proxy", httphost);
       }
     }
   }
   logger.v("createNetworkClient() ---> Exit");
   return defaulthttpclient;
 }
Пример #5
0
 public static boolean checkWapStatus() {
   logger.v("checkWapStatus ----> enter");
   ArrayList arraylist;
   ConnectivityManager connectivitymanager;
   boolean flag = false;
   MobileMusicApplication mobilemusicapplication = MobileMusicApplication.getInstance();
   arraylist = new ArrayList();
   connectivitymanager =
       (ConnectivityManager) mobilemusicapplication.getSystemService("connectivity");
   if (connectivitymanager == null) {
     logger.v("connectivitymanager == null");
     logger.v("return ----> " + flag);
     return flag;
   } else {
     NetworkInfo anetworkinfo[];
     anetworkinfo = connectivitymanager.getAllNetworkInfo();
     if (anetworkinfo == null) {
       logger.v("anetworkinfo == null");
       logger.v("return ----> " + flag);
       return flag;
     } else {
       for (int i = 0; i < anetworkinfo.length; i++) {
         if (anetworkinfo[i].getState() == android.net.NetworkInfo.State.CONNECTED)
           arraylist.add(anetworkinfo[i].getTypeName());
       }
       int j;
       j = arraylist.size();
       if (j <= 0) {
         logger.v("arraylist.size() <= 0");
         logger.v("return ----> " + flag);
         return flag;
       } else {
         boolean flag1;
         flag1 = arraylist.contains("WIFI");
         if (!flag1) {
           boolean flag2;
           flag2 = arraylist.contains("mobile");
           if (!flag2) {
             logger.v("arraylist do not contains 'mobile'");
             logger.v("return ----> " + flag);
             return flag;
           } else {
             for (int k = 0; k < anetworkinfo.length; k++) {
               if (anetworkinfo[k].getState() != android.net.NetworkInfo.State.CONNECTED) {
                 logger.v("not connected to network");
                 logger.v("return ----> " + flag);
                 return flag;
               } else {
                 String s = anetworkinfo[k].getExtraInfo();
                 if (s == null || !s.equals("cmwap")) {
                   logger.v("networkinfo not cmwap");
                   logger.v("return -----> " + flag);
                   return flag;
                 }
                 flag = true;
               }
             }
           }
         } else {
           logger.v("return ----> true");
           return true;
         }
       }
     }
   }
   return flag;
 }