PageRenderTime 30ms CodeModel.GetById 12ms app.highlight 12ms RepoModel.GetById 2ms app.codeStats 0ms

/documentation/TextToSpeech_Plugin_Engine_Examples/eSpeakEngine/src/com/google/marvin/espeak/providers/SettingsProvider.java

http://eyes-free.googlecode.com/
Java | 74 lines | 58 code | 15 blank | 1 comment | 0 complexity | d311c066949439172c10e4c686d79039 MD5 | raw file
 1
 2package com.google.marvin.espeak.providers;
 3
 4import android.content.ContentProvider;
 5import android.content.ContentValues;
 6import android.database.Cursor;
 7import android.database.MatrixCursor;
 8import android.net.Uri;
 9import android.os.Environment;
10
11public class SettingsProvider extends ContentProvider {
12    public static final Uri CONTENT_URI = Uri
13            .parse("content://com.google.marvin.espeak.providers.settingsprovider");
14
15    private class SettingsCursor extends MatrixCursor {
16        private String settings;
17
18        public SettingsCursor(String[] columnNames) {
19            super(columnNames);
20            // TODO Auto-generated constructor stub
21        }
22
23        public void putSettings(String settings) {
24            this.settings = settings;
25        }
26
27        @Override
28        public int getCount() {
29            return 1;
30        }
31
32        @Override
33        public String getString(int column) {
34            return settings;
35        }
36    }
37
38    @Override
39    public int delete(Uri uri, String selection, String[] selectionArgs) {
40        return 0;
41    }
42
43    @Override
44    public String getType(Uri uri) {
45        return null;
46    }
47
48    @Override
49    public Uri insert(Uri uri, ContentValues values) {
50        return null;
51    }
52
53    @Override
54    public boolean onCreate() {
55        return true;
56    }
57
58    @Override
59    public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs,
60            String sortOrder) {
61        String[] dummyColumns = {
62                "", ""
63        };
64        SettingsCursor cursor = new SettingsCursor(dummyColumns);
65        cursor.putSettings(Environment.getExternalStorageDirectory() + "/espeakdata/");
66        return cursor;
67    }
68
69    @Override
70    public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
71        return 0;
72    }
73
74}