• Breaking News

    [Android][timeline][#f39c12]

    Saturday, October 26, 2019

    App Feedback Thread - October 26, 2019 Android Dev

    App Feedback Thread - October 26, 2019 Android Dev


    App Feedback Thread - October 26, 2019

    Posted: 26 Oct 2019 05:28 AM PDT

    This thread is for getting feedback on your own apps.

    Developers:

    • must provide feedback for others
    • must include Play Store, GitHub, or BitBucket link
    • must make top level comment
    • must make effort to respond to questions and feedback from commenters
    • may be open or closed source

    Commenters:

    • must give constructive feedback in replies to top level comments
    • must not include links to other apps

    To cut down on spam, accounts who are too young or do not have enough karma to post will be removed. Please make an effort to contribute to the community before asking for feedback.

    As always, the mod team is only a small group of people, and we rely on the readers to help us maintain this subreddit. Please report any rule breakers. Thank you.

    - Da Mods

    submitted by /u/AutoModerator
    [link] [comments]

    Android Dev Summit 2019, all sessions Playlist

    Posted: 26 Oct 2019 08:04 AM PDT

    Drop in Admob CPM's today?

    Posted: 26 Oct 2019 12:23 PM PDT

    Anyone see significant drop in Admob CPM in US region today? It seems its almost 50% drop compared to usual numbers.

    submitted by /u/mksreddy
    [link] [comments]

    Having dificult time undestanding unit testing.

    Posted: 26 Oct 2019 06:07 AM PDT

    I've been doing android development for quite some time. But I've never tried to learn about testing. I recently tried to write a test case for simple login function but I'm having a hard time writing even the simple test case like that. I don't know why I don't understand the testing like I understand other programming staff. I am posting this to clear some of those doubts.

    My application in MVVM architecture with repository pattern and dependency injection is handled by KOIN. UI is developed with a navigation architecture component.

    LoginActivity

    class LoginActivity : AppCompatActivity() { private val navigationController: NavController by currentScope.inject{ parametersOf(this@LoginActivity) } override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_login) initialization() } private fun initialization(){ setSupportActionBar(toolbar) NavigationUI.setupActionBarWithNavController(this,navigationController) } } 

    LoginFragment

    class LoginFragment : Fragment() { private val loginViewModel: LoginViewModel by viewModel() private val sharedPreference: SharedPreferences by inject() override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { val view = inflater.inflate(R.layout.fragment_login, container, false) initialization() observeLoginStatus() onClickLogin(view) return view } private fun initialization() {} private fun observeLoginStatus(){ loginViewModel.userSessionLiveData.observe(viewLifecycleOwner, Observer { val resource = it.getContentIfNotHandled() if (resource != null){ if (resource.status) { Toast.makeText( context, "Hi, " + resource.data?.displayName, Toast.LENGTH_SHORT ).show() val editor = sharedPreference.edit() editor.putString(getString(R.string.user_id), resource.data?.email).apply() editor.putString(getString(R.string.user_name), resource.data?.email).apply() activity?.finish() } else { Toast.makeText( context, "Error, " + resource.message, Toast.LENGTH_SHORT ).show() } } }) } private fun onClickLogin(view: View) { view.loginButton.setOnClickListener { val emailAddress = view.emailTextInputEditText.text.toString() val password = view.passwordTextInputEditText.text.toString() loginViewModel.generalLogin(emailAddress, password) } 

    }

    LoginViewModel

    class LoginViewModel(val loginRepository : LoginRepository) : ViewModel() { var userSessionLiveData: LiveData<SingleLiveEvent<Resource<UserSession>>> init { userSessionLiveData = Transformations.map(loginRepository.getLoginStatus()) { return@map SingleLiveEvent(it.peekContent()) } } fun generalLogin(email: String, password: String) { val encryptedPassword = MCryptHelper.bytesToHex(MCryptHelper().encrypt(password)) loginRepository.generalLogin(email, encryptedPassword) } } 

    LoginRepository

    class LoginRepository: KoinComponent { val network: APIService by inject() var loginMutableData = MutableLiveData<SingleLiveEvent<Resource<UserSession>>>() fun getLoginStatus(): LiveData<SingleLiveEvent<Resource<UserSession>>> { return loginMutableData } fun generalLogin(email: String, encryptedPassword: String){ val login = network.login(email, encryptedPassword) login.enqueue(object : Callback<LoginResponse> { override fun onResponse(call: Call<LoginResponse>, response: Response<LoginResponse>) { if(response.isSuccessful){ if(response.body()?.status == 1){ val resource = Resource<UserSession>(true,"Success") response.body().let { if(it?.session != null){ resource.data = UserSession(it.session.userId!!,it.session.fullName!!) } } loginMutableData.value = SingleLiveEvent(resource) }else{ val resource = Resource<UserSession>(false,response.body()?.msg ?: "Login failed. Try again") loginMutableData.value = SingleLiveEvent(resource) } }else{ loginMutableData.value = SingleLiveEvent(Resource(false, response.message())) } } override fun onFailure(call: Call<LoginResponse>, t: Throwable) { loginMutableData.value = SingleLiveEvent(Resource(false, t.localizedMessage)) } }) } } 

    Please correct the below statements if I'm wrong.

    I think this code is written in a way that is testable.

    This is what I think as a correct approach for testing this application. First I should start with the bottom layer which is LoginRepository. There I should test whether I get the expected results out of generalLogin(email: String, encryptedPassword: String) function with wrong and right input. To test this I have to compare the value in loginMutableData with what I'm expecting. After that check the LoginViewModel ( I don't think it is necessary to test LoginViewModel since it is not doing much. As the final testing should do the integration testing with all the components.

    This is the test class I came up with.

    class LoginRepositoryTest : KoinTest { private val loginRepository: LoginRepository by inject() @get:Rule val rule = InstantTaskExecutorRule() @Before fun before() { MockitoAnnotations.initMocks(this) startKoin { printLogger() modules(listOf(applicationModule, activityModule, viewModelModule, repositoryModule)) } } @Test fun testLoginWithCorrectCredentials() { val email = "valid_email_address@gmail.com" val password = "valid_password" loginRepository.generalLogin(email, password) loginRepository.getLoginStatus().observeForever { it.getContentIfNotHandled()?.also { resource -> Assert.assertEquals(email, resource.data?.email) } } 

    }

     @Test fun testLoginWithWrongCredentials() { val email = "invalid_email_address@gmail.com" val password = "invalid_password" loginRepository.generalLogin(email, password) loginRepository.getLoginStatus().observeForever { it.getContentIfNotHandled()?.also { resource -> Assert.assertNotEquals(email, resource.data?.email) } } 

    }

     @After fun after() { stopKoin() } } 

    This class runs fine and gives the result as both test cases passed. But it did not trigger the retrofit enqueue and gives a response wich means my test is wrong. Anyway I know it's not gonna make the network in a unit test environment. But I don't know how to mock the response. More importantly how to even access val login = network.login(email, encryptedPassword)to call trigger enqueue from LoginRepositoryTest.

    Not having good time understanding unit testing in android. Any help is appreciated. Thanks.

    submitted by /u/ghost_rider_007
    [link] [comments]

    Introduction to Jetpack Compose - Codelab

    Posted: 25 Oct 2019 10:00 PM PDT

    It seems like someone is botting admob requests on one of my apps. Any way to solve this?

    Posted: 26 Oct 2019 11:34 AM PDT

    So yesterday i saw a large number of requests made to one of my apps. Considering the usual daily requests are between 0 and about 20 on this app, it seems highly likely that someone is botting the requests or my ids are somehow bugged.

    I got in total about 12k requests with 3 impressions which are probably from real users: https://i.gyazo.com/bad45598cfaea71dce741c89be97dea1.png

    Here are the countries: https://i.gyazo.com/9159b64c4408dc3c8e8f7b560f7b5f9c.png

    Has anybody experienced something like this?

    submitted by /u/xhunter61
    [link] [comments]

    Android Dev Summit Theme Song / Soundtrack

    Posted: 26 Oct 2019 09:55 AM PDT

    For anyone, who enjoys this lively music while watching the Dev Summit stream, this is it, keep replaying.

    https://soundcloud.com/terramonk/android-dev-summit-2019

    submitted by /u/pal_codes
    [link] [comments]

    Do you think that staying on Java and ignoring Kotlin would be bad idea for future of app business?

    Posted: 26 Oct 2019 02:28 AM PDT

    As someone who has average knowledge in C# and Java, i feel meh about Kotlin.

    I see it being used more and more, but i just dislike the whole language. Kind of reminds me of JavaScript and for that reason I feel aversion towards Kotlin and haven't invested any time in trying to learn the basics. Do you think that Kotlin will be a must know language in the future, and that ignoring it will eventually bite me in the ass for ignoring it? As the saying goes, ignoring the sings of change is a risky long term strategy. And Google started acting as if Java doesn't exist.

    submitted by /u/TADSRCOP
    [link] [comments]

    Android fluoride

    Posted: 26 Oct 2019 02:45 PM PDT

    Hi when I build fluoride stack in Ubuntu, will I be able to create two devices that will comunicate each other using the stack and possibly through HCI packets that are handled by the android IPC and Linux IPC mechanisms. ?

    submitted by /u/pauter
    [link] [comments]

    GitHub - googlesamples/easypermissions: Simplify Android M system permissions

    Posted: 26 Oct 2019 01:43 AM PDT

    Any website for hosting images for free for a commercial app?

    Posted: 26 Oct 2019 12:31 PM PDT

    I have my own server for hosting normal images for the app. But I've worked on a new feature which requires hosting of high resolution images. I was just wondering if there was any way for me to host these images for free? I know about flickr, but can we use their hosting for commercial applications? I'm looking for free option because the app doesn't make a lot of money.

    submitted by /u/AwkwardShake
    [link] [comments]

    Light weight android Linear Graph library

    Posted: 26 Oct 2019 09:46 AM PDT

    Light weight android Linear Graph library

    Hi,I've recently published a library for displaying color-coded information in sort of a linear graph. I hope it can be useful to others. Check it out, all types of feedback and feature requests are appreciated.

    https://github.com/swapnil1104/LinearGraphView

    I'm not even sure what this type of representation of information is called, if y'all can come up with a better name, please do suggest!!

    DEMO

    Edit: Fixed the demo gif.

    submitted by /u/xBlackSwagx
    [link] [comments]

    Build fast-forward/time-lapse Android App

    Posted: 26 Oct 2019 12:15 AM PDT

    I have a small dilemma.

    After doing some window-shopping of different video editing apps and a quick review of GitHub, I can't seem to find a decent piece of code that can timelapse videos longer than 10 minutes to 30-40 second long vids. That's anywhere between 4000% and 7000% faster.

    I need this capability for a small side project of mine, and would love to have the ability to take a 10-15 minute video on my phone and - on my phone, without the overhead of transferring the video to my machine and editing it there - get a timelapsed version of it that's 30 seconds long.

    It does not need to be pretty, nor do anything fancy with the output file - just open it when it's done doing its thing.

    Can I get some direction of where to look? Bonus points for open source apps that already do that, and can be stripped down of all extra parts and tuned to achieve this.

    Super-duper bonus points for a nice tutorial written about the topic.

    submitted by /u/tomgs
    [link] [comments]

    Flutter Animation: Login dashboard - (Speed Code)

    Posted: 26 Oct 2019 07:22 AM PDT

    No comments:

    Post a Comment

    Fashion

    Beauty

    Travel