Back to project page SimpleReader.
The source code is released under:
Apache License
If you think the Android project SimpleReader listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.dreamteam.app.commons; /*from ww w .java2s.c o m*/ import java.util.List; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.pm.PackageInfo; import android.net.Uri; import com.iflytek.speech.SpeechUtility; /** * @description TODO * @author zcloud * @date 2014?2?22? */ public class IFlyHelper { public static void openDownloadDialog(final Context context) { AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setMessage("???????????????????").setTitle("??????????+"); builder.setPositiveButton("??", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { String url = SpeechUtility.getUtility(context).getComponentUrl(); openDownloadWeb(context, url); } }); builder.setNegativeButton("????", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); AlertDialog dialog = builder.create(); dialog.show(); } // ????????????????+ public static boolean checkSpeechServiceInstall(Context context) { String packageName = "com.iflytek.speechcloud"; List<PackageInfo> packages = context.getPackageManager() .getInstalledPackages(0); for (int i = 0; i < packages.size(); i++) { PackageInfo packageInfo = packages.get(i); if (packageInfo.packageName.equals(packageName)) { return true; } else { continue; } } return false; } /** * ???????????????? * * @param context * @param url */ public static void openDownloadWeb(Context context, String url) { Uri uri = Uri.parse(url); Intent it = new Intent(Intent.ACTION_VIEW, uri); context.startActivity(it); } }