Ich möchte eine App, die Systemschriftart in Galaxy Handy ändern können, nach der Installation meiner App Benutzer können Schriftart von Einstellung> mein Gerät> Schriftart ändern und wählen Sie aus der Liste ohne root Erlaubnis. Ich habe meinen eigenen Schriftstil in TrueType-Datei. Klicken Sie auf here, um ein Beispiel für eine App zu sehen, die ich erstellen möchte.FlipFont App für Galaxy Handys
Down Voting wird nicht helfen Bitte beantworten oder nicht abstimmen.
manidest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="2" android:versionName="1.1" package="com.monotype.android.font.presentltroman" platformBuildVersionCode="23" platformBuildVersionName="6.0-2438415">
<uses-sdk android:minSdkVersion="7" />
<application android:label="@string/app_name" android:icon="@drawable/icon">
<provider android:name=".FontContentProvider" android:authorities="com.example.myfont" />
<support-screens android:largeScreens="true" android:xlargeScreens="true" />
</application>
</manifest>
Es gibt nur eine Aktivität
import android.content.ContentProvider;
import android.content.ContentValues;
import android.content.UriMatcher;
import android.content.res.AssetFileDescriptor;
import android.content.res.AssetManager;
import android.database.Cursor;
import android.net.Uri;
import android.os.ParcelFileDescriptor;
import android.util.Log;
import java.io.FileNotFoundException;
public class FontContentProvider extends ContentProvider {
private static final UriMatcher uriMatcher = new UriMatcher(-1);
public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException {
return null;
}
public AssetFileDescriptor openAssetFile(Uri uri, String mode) throws FileNotFoundException {
String file_name = uri.getPath();
if (file_name == null) {
throw new FileNotFoundException();
}
if (file_name.startsWith("/")) {
file_name = file_name.substring(1);
}
AssetFileDescriptor ad = null;
try {
ad = getContext().getAssets().openFd(file_name);
} catch (Exception e) {
Log.v("CPFontTest", "cp - openAssetFile EXCEPTION");
}
return ad;
}
public int delete(Uri uri, String selection, String[] selectionArgs) {
return 0;
}
public String getType(Uri uri) {
AssetManager am = getContext().getAssets();
StringBuilder xmlfileStringBuilder = new StringBuilder();
try {
for (String s : am.list("xml")) {
xmlfileStringBuilder.append(s + "\n");
}
return xmlfileStringBuilder.toString();
} catch (Exception e) {
return null;
}
}
public Uri insert(Uri uri, ContentValues values) {
return null;
}
public boolean onCreate() {
return true;
}
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
return null;
}
public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
return 0;
}
static {
uriMatcher.addURI(".fontcontentprovider", "fonts", 1);
}
}
Was ist Ihre Frage? –
wie man flipfont app mit android studio machen –