發表文章

目前顯示的是 2月, 2016的文章

Eclipse 軟體編輯器,風格背景、字體設定 - 超方便

圖片
最近發現,現在有了 Eclipse Color Theme 的外掛程式,以下是步驟分享: 來源: Eclipse Color Theme http://eclipsecolorthemes.org 首先開啟 Eclipse ,然後找到選單 Help → Install New Software... 點選 Add Name 輸入 Eclipse Color Theme(可隨自己高興而取名) Location 輸入 http://eclipse-color-theme.github.com/update 按下OK,就可以看到 Eclipse Color Theme 的套件,勾選後點選 Next 按下 Next 確定安裝 勾選 I accept the terms of the license agreement, 同意授權 如果確定安裝來源沒問題,請按下OK。 安裝完畢,必須重新啟動 Eclipse,點選 Yes 接下來,我們到選單中的 Windows → Preferences 在 General → Appearance 就會出現 Color Theme 的選項,裡面就有網站上提供的各種範例可以直接下使用,並且隨時都可以切換,比起早期的方式方便。 ..... 修改字形及大小,預設的字體非等寬字,在同一個設定畫面底下 General  →  Appearance 有一個 Colors and Fonts 。 找到底下的 Text Font ,選擇後點 Edit。 Consolas識別度比較推薦,大小改為 12甚至是14都很不錯(眼睛比較不易脫窗) 按下確定後就可以觀看結果了! .... 完整的IDE風格大改變: Dark Juno - Dark UI Theme for Eclipse 4+ http://rogerdudler.github.io/eclipse-ui-themes/ 連結下載佈景主題檔案: https://github.com/downloads/rogerdudler/eclipse-ui-themes/com.github.eclipsecolortheme.themes_1.0.0.201207121019.zip 會有一個 jar

How To Create A WebView On Layout & Catch HTML code - Android Coding

One day, I needed to ensure the HTML code on mobile works, and checked every segment is ready in my WebView object. So, I found this way and share to everyone need it. This is a simple code for tutorial in Java below: @SuppressLint({ "SetJavaScriptEnabled", "JavascriptInterface" }) public class MainActivity extends Activity { private WebView mWebView; private ProgressBar mProgress; private boolean mPageLoading = false; private static final String mUrl = [ The URL you want to go ] ; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Initialize WebView object. mWebView = (WebView) findViewById(R.id.webview); mProgress = (ProgressBar)findViewById(R.id.progressbar); mProgress.setVisibility(View.GONE); // Make the po

How To Know The APP You Want To Start Is Installed - Android

圖片
1. If you just want a detector to ensure whether or not the app is existed, you can do this as below: public static boolean isAppInstalled(Context ctx, String packageName) {     PackageManager pm = ctx.getPackageManager();     boolean installed = false;     try {         pm.getPackageInfo(packageName, PackageManager.GET_ACTIVITIES); installed = true;     } catch (PackageManager.NameNotFoundException e) { installed = false;     }     return installed; } 2. Or, you can do this to ensure that you can find a app to get start without error as below: Intent activityIntent = new Intent(); .... (set the Intent for the Activity get ready to start.) try {     activity.startActivity( Intent.createChooser( activityIntent ,              activity.getString( "chooser title" ) ) ); } catch ( android.content.ActivityNotFoundException ex ) {     // if there is no application working, go to google play      // and install the any APP  in play store  for start

Share/Send Files to Google Drive via share-button - Android

ArrayList<Uri> fileURIs = [ uris of files in mobile device ] Intent shareIntent = new Intent(); shareIntent.setAction( Intent.ACTION_SEND_MULTIPLE ); shareIntent.putExtra( Intent.EXTRA_SUBJECT, [ subject text ] ); shareIntent.putExtra( Intent.EXTRA_TEXT, [ contents text ] ); shareIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, fileURIs ); shareIntent.setType( "text/*" );    // set the type you want // Google Drive package name :  com.google.android.apps.docs shareIntent.setPackage(" com.google.android.apps.docs "); // It will start the Google Drive APP. activity.startActivity( shareIntent );