我知道,我可以使用debugCompile
只在拉dependency
了debug build
.是否有一个好的,简化的方法来做到这code initialization
一点也是必需的?如果没有依赖关系,其他变体将无法编译.
Stetho 和 Google Chrome DevTools 在 macOS 更新后变得无法使用(我怀疑 macOS 更新是此错误的根源,但我更愿意提及它)。
这是在设备上打开“检查模式”后 DevTools 的外观(由 Facebook Stetho 库提供,适用于 Android 和 OKHttp)。
页面上不再有“CSS”样式表,字体也发生了变化。许多标签页没有显示(即网络请求),我只能访问一些错误消息:
There were 84 bytes that were not consumed while processing request 4
There were 84 bytes that were not consumed while processing request 5
There were 84 bytes that were not consumed while processing request 6
Failed to clear temp storage: undefined
Run Code Online (Sandbox Code Playgroud)
我按照有关此问题的说明进行操作:无法清除临时存储和此问题:无法清除临时存储:Chrome 中的安全错误但我无法解决该问题。
这是我尝试过的:
~/Library/Application\ …
我想知道Android Studio有哪些SQLite插件允许用户浏览创建的数据库?
为我的请求创建了一个凌空单例类.这是我的单例类
public class VolleySingleton {
private static VolleySingleton instance;
private RequestQueue reQueue;
private VolleySingleton(Context context) {
reQueue = Volley.newRequestQueue(context,new OkHttpStack(new OkHttpClient()));
}
public static VolleySingleton getInstance(Context context) {
if(instance == null)
instance = new VolleySingleton(context);
return instance;
}
public RequestQueue getRequestQueue() {
return reQueue;
}
public <T> void addToRequestQueue(Request<T> request) {
request.setTag("app");
request.setShouldCache(false);
request.setRetryPolicy(new DefaultRetryPolicy(10000, DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
getRequestQueue().add(request);
}
}
Run Code Online (Sandbox Code Playgroud)
并且使用OKHTTP堆栈和我的Volley实现.这是我的 OKHttp.class
public class OkHttpStack implements HttpStack {
private final OkHttpClient mClient;
public OkHttpStack(OkHttpClient client) {
this.mClient = client;
} …
Run Code Online (Sandbox Code Playgroud) 您好我正在为我的应用程序使用Stetho调试平台.我已经在我的gradle中添加了Stetho,如下所示
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.facebook.stetho:stetho:1.2.0'
Run Code Online (Sandbox Code Playgroud)
}
并将其初始化为onCreate方法,如下所示
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Stetho.initializeWithDefaults(this);
findElementsByIds();
addDataIntoDBs();
initData();
}
Run Code Online (Sandbox Code Playgroud)
我已经为demo创建了Category表(作为cat_id和cat_name列)并在其中添加了一些条目,请参阅 此截图.
任何人都可以告诉它为什么显示两个与图像中名称相同的列
我为表创建所做的代码
public class DBHelper extends SQLiteOpenHelper{
private static String DATABASE_NAME = "citizan.db";
private static int DATABASE_VERSION = 1;
private static DBHelper dbHelperInstance = null;
private static SQLiteDatabase dbInstance= null;
public static String CATEGORY_TABLE = "category";
public static String CAT_ID = "cat_id";
public static String CAT_NAME …
Run Code Online (Sandbox Code Playgroud) 使用Stetho的一切都在我的示例应用程序中运行得很好,我在浏览了这个YouTube教程(SQLite,SharedPreferences show)之后进行了测试,除了看到我喜欢的网络调用.
我在加载应用程序时进行了大量的API调用.例如,在我的Service.java类中,如下面的链接所示.也许它没有出现在Stetho中,因为API调用在应用程序加载之前发生,然后才能打开Stetho.任何想法都将得到赞赏,以使此功能正常工作.
我在MainActivity.java中初始化Stetho.在onCreate()我有
// Initialize Stetho
Stetho.initialize(
Stetho.newInitializerBuilder(this)
.enableDumpapp(new SampleDumperPluginsProvider(this))
.enableWebKitInspector(Stetho.defaultInspectorModulesProvider(this))
.build());
Run Code Online (Sandbox Code Playgroud)
然后我还在底部加入了一个Stetho Class.
// Create class for Stetho
private static class SampleDumperPluginsProvider implements DumperPluginsProvider {
private final Context mContext;
public SampleDumperPluginsProvider(Context context){mContext = context;}
@Override
public Iterable<DumperPlugin> get() {
ArrayList<DumperPlugin> plugins = new ArrayList<>();
for (DumperPlugin defaultPlugin : Stetho.defaultDumperPluginsProvider(mContext).get()) {
plugins.add(defaultPlugin);
}
//plugins.add(new SyncAdapterFragment());
return plugins;
}
}
Run Code Online (Sandbox Code Playgroud)
当然,我也有适当的依赖
compile 'com.facebook.stetho:stetho:1.3.0'
Run Code Online (Sandbox Code Playgroud)
谢谢!
我正在使用Stheto在我的Android应用程序中检查数据库,但是当表中有很多对象时,我在所有列中看到"截断".我怎么能看到他们呢?
使用Stetho和Stetho领域.
Stetho.initialize(
Stetho.newInitializerBuilder(this)
.enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
.enableWebKitInspector(RealmInspectorModulesProvider.builder(this).build())
.build());
Run Code Online (Sandbox Code Playgroud)
我能够通过Google Developer Console查看Realm DB内容,但最大索引是249,之后的所有值都被截断 -
如何强制它显示所有值?
android stetho google-developer-tools google-developers-console
我一直在使用android调试模式,并尝试通过“资源”部分中的Stetho查询数据。当我键入查询并按Enter键时,它不会显示我想要的结果,而会在我键入的查询下添加另一个空行。
例
Select * From employees
Run Code Online (Sandbox Code Playgroud)
然后按回车键
结果
Select * From employees
<new line starts here>
Run Code Online (Sandbox Code Playgroud)
我想知道它是如何发生的,并希望找到解决方案。