小编Mat*_*Pag的帖子

如何启用Google Play App签名

我认为很多开发者都在尝试了解更多有关Google I/O 2017上展示的新版Google Play App Signing功能的信息.

存储密钥库以在Google Play内部对应用进行签名的功能可以节省您安全存储密钥库的工作量,并可以帮助系统根据硬件和操作系统特性优化为每个设备提供的APK.

您可以在官方文档中阅读有关此主题的更多信息:https://developer.android.com/studio/publish/app-signing.html#google-play-app-signing.

通过以下答案,我将更好地解释您上传原始密钥库所需遵循的步骤以及如何创建新的上传密钥库,从此点开始您需要签署APK.

android google-play android-signing android-app-signing

84
推荐指数
6
解决办法
7万
查看次数

如何在Windows 10中将文件夹添加到`Path`环境变量(带截图)

一般来说,在StackOverflow和网络上,有关如何将特定文件夹添加到用户的Windows 10 Path环境变量的过时指南.

我认为对于具有分步说明和屏幕截图的新开发人员来说,完整的指南可能非常有用,可以帮助他们从命令提示符执行实用程序而无需完整路径,从而简化了操作.

windows path

12
推荐指数
3
解决办法
2万
查看次数

如何在 JUnit 4 和 Kotlin for Android 中创建参数化测试用例?

我需要类似于 C# NUnit TestCase场景的东西,具有固定的预期结果。

我已经在 SO 上找到了这个问题,它有很好的解决方案,但它们仅适用于 Java,并且正如我遵循本教程的一些答案中所建议的那样,但简单地将其转换为 Kotlin 是行不通的。

@RunWith(value = Parameterized.class)
public class EmailIdValidatorTest {

    private String emailId;
    private boolean expected;

    public EmailIdValidatorTest(String emailId, boolean expected) {
        this.emailId = emailId;
        this.expected = expected;
    }
    @Parameterized.Parameters(name= "{index}: isValid({0})={1}")
    public static Iterable<Object[]> data() {
        return Arrays.asList(new Object[][]{
                        {"mary@testdomain.com", true},
                        {"mary.smith@testdomain.com", true},
                        {"mary_smith123@testdomain.com", true},
                        {"mary@testdomaindotcom", false},
                        {"mary-smith@testdomain", false},
                        {"testdomain.com", false}
                }
        );
    }
    @Test
    public void testIsValidEmailId() throws Exception {
        boolean actual= EmailIdUtility.isValid(emailId);
        assertThat(actual, is(equalTo(expected)));
    } …
Run Code Online (Sandbox Code Playgroud)

junit android unit-testing kotlin

9
推荐指数
2
解决办法
6335
查看次数

8
推荐指数
5
解决办法
1961
查看次数

如何从我的 Android 应用中检测已安装的 Chrome 版本?

我正在开发一项功能,只有当设备上安装的 chrome 版本高于版本 65 时,我才需要将用户从 Android Native APP 转换为 Chrome 自定义选项卡。 所以我的问题是,有没有办法从 Android 检测 chrome 版本原生应用?

android google-chrome

7
推荐指数
1
解决办法
2496
查看次数

Dagger 2:如何从FragmentFactory的子组件绑定父组件中的Fragment Map

我有这个Dagger 2配置:

AppComponent.kt

@Singleton
@Component(
    modules = [
        AndroidSupportInjectionModule::class,
        AppModule::class,
        ActivityBindingModule::class,
    ]
)
interface AppComponent : AndroidInjector<AppApplication> {
    @Component.Builder
    abstract class Builder : AndroidInjector.Builder<AppApplication>()
}
Run Code Online (Sandbox Code Playgroud)

ActivityBindingModule.kt

@Module
abstract class ActivityBindingModule {
    @ActivityScoped
    @ContributesAndroidInjector(
        modules = [
            MainActivityModule::class,
            FragmentModule::class //a fragment factory for each activity
        ]
    )
    internal abstract fun mainActivity(): MainActivity
}
Run Code Online (Sandbox Code Playgroud)

MainActivityModule.kt

@Module(subcomponents = [LoginFragmentSubcomponent::class])
abstract class MainActivityModule {
    //uncommenting this works fine but Fragment can't be scoped
    //@Binds
    //@IntoMap
    //@FragmentKey(LoginFragment::class)
    //abstract fun bindLoginFragment(loginFragment: LoginFragment): Fragment

    //...other things which …
Run Code Online (Sandbox Code Playgroud)

android android-fragments dagger dagger-2

6
推荐指数
0
解决办法
507
查看次数

在 xml 中设置工具栏一半 attr/actionBarSize 的高度

无论如何要在布局xml文件中设置“android.support.v7.widget.Toolbar”一半的预定义属性的高度,例如“?android:attr/actionBarSize”?事实上,我希望我的工具栏的高度是这样的:

<android.support.v7.widget.Toolbar
    android:layout_width="match_parent"
    android:layout_height=("?android:attr/actionBarSize")/2
    >
Run Code Online (Sandbox Code Playgroud)

android android-layout android-view android-resources android-styles

5
推荐指数
1
解决办法
6635
查看次数

JobIntentService:无法安排其他应用程序的作业 - 奥利奥

我正在尝试安排JobIntentService另一个应用程序(2个不同的进程)的工作.

ComponentName componentName = new ComponentName(context.getPackageName(),
                   "com.anotherapp.service.MyJobIntentService");

JobIntentService.enqueueWork(this,componentName,100,new Intent());
Run Code Online (Sandbox Code Playgroud)

这给出了以下例外.

java.lang.IllegalArgumentException:uid 10000无法将作业调度到"com.anotherapp.service"

问题是,我们是否能够与JobIntentService我们的应用程序之外进行通信?

注意:在应用程序中,可以安排作业.

android intentservice android-backup-service android-8.1-oreo

5
推荐指数
1
解决办法
731
查看次数

FragmentScenario configuration - Binary XML file line, Error inflating class &lt;widget&gt; while testing with espresso

Inflating error while trying to use FragmentScenario with launchFragment and launchFragmentInContainer if using material component in XML.

android.view.InflateException: Binary XML file line #41: Binary XML file line #41: Error inflating class <widget class>
Caused by: android.view.InflateException: Binary XML file line #41: Error inflating class <widget class>
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:334)
at android.view.LayoutInflater.createView(LayoutInflater.java:647)
at com.android.internal.policy.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:58)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:720)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:788)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
...
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:886)
at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1227)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1293)
at …
Run Code Online (Sandbox Code Playgroud)

android android-fragments android-espresso

4
推荐指数
1
解决办法
547
查看次数

设置所有Git子模块的分支

是否有命令为所有现有的 Git子模块设置相同的分支名称

git submodule add -b develop *
Run Code Online (Sandbox Code Playgroud)

基本上,我需要一种方法来递归设置.gitmodules文件中每个模块的分支。

git git-submodules

3
推荐指数
2
解决办法
1924
查看次数