Windows 10 上的领域数据浏览器
Realm data browser on Windows 10
我设法 export.realm 使用这些代码
package com.meow.meowmeow;
import android.content.Context;
import android.content.Intent;
import android.content.res.AssetManager;
import android.net.Uri;
import android.util.Log;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import io.realm.Realm;
import io.realm.RealmConfiguration;
/**
* Created by Thien on 9/1/2015.
*/
public class RealmTool {
private static String LOG_TAG = "RealmTool";
//export to email
public static void exportDatabase(Context context,RealmConfiguration configuration) {
// init realm
Realm realm = Realm.getInstance(configuration);
File exportRealmFile = null;
try {
// get or create an "export.realm" file
exportRealmFile = new File(context.getExternalCacheDir(), "export.realm");
// if "export.realm" already exists, delete
exportRealmFile.delete();
// copy current realm to "export.realm"
realm.writeCopyTo(exportRealmFile);
} catch (IOException e) {
e.printStackTrace();
}
realm.close();
// init email intent and add export.realm as attachment
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("plain/text");
intent.putExtra(Intent.EXTRA_EMAIL, "YOUR MAIL");
intent.putExtra(Intent.EXTRA_SUBJECT, "YOUR SUBJECT");
intent.putExtra(Intent.EXTRA_TEXT, "YOUR TEXT");
Uri u = Uri.fromFile(exportRealmFile);
intent.putExtra(Intent.EXTRA_STREAM, u);
// start email intent
context.startActivity(Intent.createChooser(intent, "YOUR CHOOSER TITLE"));
}
//import from assets
public static RealmConfiguration importDatabase(Context context, String realm_file_name){
RealmConfiguration defaultRealm = new RealmConfiguration.Builder(context).build();
String dir = defaultRealm.getPath();
AssetManager assetManager = context.getAssets();
try {
InputStream is;
is = assetManager.open(realm_file_name);
File dest = new File(dir);
if (dest.exists())
dest.delete();
copy(is,dest);
}catch (IOException e){
Log.e(LOG_TAG,"import database error");
}
return defaultRealm;
}
public static void copy(File src, File dst) throws IOException {
InputStream in = new FileInputStream(src);
OutputStream out = new FileOutputStream(dst);
// Transfer bytes from in to out
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
in.close();
out.close();
}
public static void copy(InputStream in, File dst) throws IOException {
OutputStream out = new FileOutputStream(dst);
// Transfer bytes from in to out
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
in.close();
out.close();
}
}
现在我想去看看。
如何在 windows 中编辑它。
开发者说他们在 Mac 上只有领域浏览器
但我正在使用 windows 10。
所以任何人都可以通过任何方式或任何工具来浏览 Windows 上的领域。
谢谢。
(免责声明:我是 Mac 领域浏览器的负责人。:))
我们听到了!不幸的是,目前,甚至要考虑 Windows 的 Realm 浏览器版本,我们首先需要在 Windows 上获取 Realm 本身 运行!这是我们绝对在努力的事情,但显然这不是一个小工作量;所以我们还没有任何发布时间表。
目前,如果您想从 Android 应用程序调试 Realm 文件,实际上有一个非常酷的开源第三方 Android Realm 浏览器应用程序,您可以使用相反:https://github.com/dmytrodanylyk/realm-browser
抱歉,我不能带来任何更好的消息,但至少,我希望在此期间有所帮助。但我们 100% 意识到,在 Windows 上拥有等效版本的 Realm Browser 将极大地帮助 Android 在该平台上进行开发。
另一种解决方案,有第三方的Stetho Realm插件https://github.com/uPhyca/stetho-realm,Stetho是AndroidFacebook开发的调试桥。它还让您能够在您的设备上查看 Realm 的数据。
在检查了所有旧答案后,我想到将我的最新研究放在这个线程上。
根据下面 link 他们还没有为 windows 准备好任何东西。如果你使用 mac.
你就幸运了
https://realm.io/docs/java/latest/
但是他们提到了 facebook 构建的用于浏览和编辑领域数据的实用程序。
http://facebook.github.io/stetho/
PS:那些不知道如何从 chrome 浏览器调试应用程序的人,可以通过单击 [=] 右上角的三个垂直点来检查设备选项26=]。
访问更多工具-->>开发者工具-->>再次点击三个垂直点-->>更多选项-->>>检查设备。之后你会看到与上面 link.
相同的特征 UI
我刚刚以 Android Studio 插件的形式编写了一个简单的领域浏览器 (Rebro)。不确定需求有多大,这更像是一个挑战。但无论如何,给你:https://github.com/Ghedeon/Rebro
我设法 export.realm 使用这些代码
package com.meow.meowmeow;
import android.content.Context;
import android.content.Intent;
import android.content.res.AssetManager;
import android.net.Uri;
import android.util.Log;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import io.realm.Realm;
import io.realm.RealmConfiguration;
/**
* Created by Thien on 9/1/2015.
*/
public class RealmTool {
private static String LOG_TAG = "RealmTool";
//export to email
public static void exportDatabase(Context context,RealmConfiguration configuration) {
// init realm
Realm realm = Realm.getInstance(configuration);
File exportRealmFile = null;
try {
// get or create an "export.realm" file
exportRealmFile = new File(context.getExternalCacheDir(), "export.realm");
// if "export.realm" already exists, delete
exportRealmFile.delete();
// copy current realm to "export.realm"
realm.writeCopyTo(exportRealmFile);
} catch (IOException e) {
e.printStackTrace();
}
realm.close();
// init email intent and add export.realm as attachment
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("plain/text");
intent.putExtra(Intent.EXTRA_EMAIL, "YOUR MAIL");
intent.putExtra(Intent.EXTRA_SUBJECT, "YOUR SUBJECT");
intent.putExtra(Intent.EXTRA_TEXT, "YOUR TEXT");
Uri u = Uri.fromFile(exportRealmFile);
intent.putExtra(Intent.EXTRA_STREAM, u);
// start email intent
context.startActivity(Intent.createChooser(intent, "YOUR CHOOSER TITLE"));
}
//import from assets
public static RealmConfiguration importDatabase(Context context, String realm_file_name){
RealmConfiguration defaultRealm = new RealmConfiguration.Builder(context).build();
String dir = defaultRealm.getPath();
AssetManager assetManager = context.getAssets();
try {
InputStream is;
is = assetManager.open(realm_file_name);
File dest = new File(dir);
if (dest.exists())
dest.delete();
copy(is,dest);
}catch (IOException e){
Log.e(LOG_TAG,"import database error");
}
return defaultRealm;
}
public static void copy(File src, File dst) throws IOException {
InputStream in = new FileInputStream(src);
OutputStream out = new FileOutputStream(dst);
// Transfer bytes from in to out
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
in.close();
out.close();
}
public static void copy(InputStream in, File dst) throws IOException {
OutputStream out = new FileOutputStream(dst);
// Transfer bytes from in to out
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
in.close();
out.close();
}
}
现在我想去看看。 如何在 windows 中编辑它。 开发者说他们在 Mac 上只有领域浏览器 但我正在使用 windows 10。 所以任何人都可以通过任何方式或任何工具来浏览 Windows 上的领域。 谢谢。
(免责声明:我是 Mac 领域浏览器的负责人。:))
我们听到了!不幸的是,目前,甚至要考虑 Windows 的 Realm 浏览器版本,我们首先需要在 Windows 上获取 Realm 本身 运行!这是我们绝对在努力的事情,但显然这不是一个小工作量;所以我们还没有任何发布时间表。
目前,如果您想从 Android 应用程序调试 Realm 文件,实际上有一个非常酷的开源第三方 Android Realm 浏览器应用程序,您可以使用相反:https://github.com/dmytrodanylyk/realm-browser
抱歉,我不能带来任何更好的消息,但至少,我希望在此期间有所帮助。但我们 100% 意识到,在 Windows 上拥有等效版本的 Realm Browser 将极大地帮助 Android 在该平台上进行开发。
另一种解决方案,有第三方的Stetho Realm插件https://github.com/uPhyca/stetho-realm,Stetho是AndroidFacebook开发的调试桥。它还让您能够在您的设备上查看 Realm 的数据。
在检查了所有旧答案后,我想到将我的最新研究放在这个线程上。
根据下面 link 他们还没有为 windows 准备好任何东西。如果你使用 mac.
你就幸运了https://realm.io/docs/java/latest/
但是他们提到了 facebook 构建的用于浏览和编辑领域数据的实用程序。
http://facebook.github.io/stetho/
PS:那些不知道如何从 chrome 浏览器调试应用程序的人,可以通过单击 [=] 右上角的三个垂直点来检查设备选项26=]。 访问更多工具-->>开发者工具-->>再次点击三个垂直点-->>更多选项-->>>检查设备。之后你会看到与上面 link.
相同的特征 UI我刚刚以 Android Studio 插件的形式编写了一个简单的领域浏览器 (Rebro)。不确定需求有多大,这更像是一个挑战。但无论如何,给你:https://github.com/Ghedeon/Rebro