• Breaking News

    Tuesday, November 19, 2019

    Android Dev - Dagger Party Tricks: Refactoring

    Android Dev - Dagger Party Tricks: Refactoring


    Dagger Party Tricks: Refactoring

    Posted: 18 Nov 2019 11:29 PM PST

    A study of the Parcelize feature from Kotlin Android Extensions

    Posted: 19 Nov 2019 03:56 AM PST

    How does using Flutter or React-Native code for your App affect the overall size of the Apk bigger or smaller than Native code?

    Posted: 18 Nov 2019 10:18 PM PST

    Sample Android Components Architecture

    Posted: 18 Nov 2019 09:48 PM PST

    Sample Android Components Architecture

    Sample Project that presents modern, 2019 approach to Android application development using Kotlin, MVVM architecture, single Activity pattern, latest tech-stack: androidx, gradle-dsl, dynamic-features, retrofit, coroutines, live data, room, paging, dagger and more..

    link: https://github.com/VMadalin/kotlin-sample-app

    https://preview.redd.it/n42axfp60lz31.png?width=1280&format=png&auto=webp&s=9c80a0f490ba3bda01718746e12f8ed416dae9ee

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

    can I run a apk embedded in a web page?

    Posted: 19 Nov 2019 07:10 AM PST

    my ICT dept concotioned a bastard app for one hr service, now we need to put it on a website so people can use one of its core functions while not in the tablet with the apk installed.

    is there any kind of service or app that helps me to run it embedded on a web page? or convert it from apk to web formats?

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

    Kotlin 1.3.60 Released

    Posted: 18 Nov 2019 11:57 AM PST

    Adding note to specific id in ROOM database using Kotlin

    Posted: 19 Nov 2019 06:41 AM PST

    For some reason I cannot add my notes to the database with a specific ID for each date I choose. I have been trying to fix this in my spare time for the past week or so in between studies, but I can't for the life of me figure it out.

    The purpose of it is to select the date from the calendarView and have specific notes for each date called on from the DB. There is more code involved, but it's not relevant, as this is where the error is occuring, in creating the entity/object(I don't know what something in a database is called).

    Below is the code in my DAO. I have been trying to add an id argument in the insertNote function, but it just comes up red.

    @Dao interface NotesDao { @Insert(onConflict = OnConflictStrategy.REPLACE) fun insertNote(note: Notes) @Update fun updateNote(note: Notes) @Delete fun deleteNote(note: Notes) @Query("SELECT * FROM Notes WHERE id == :id") fun getNotesByID(id: Int): List<Notes> } 

    Below is how I am trying to create the object in the database by calling the DAO, but it crashes after the this?.insertNote(notes) line.

    var notes = Notes(id = date, name = noteText) with(notesDao) { this?.insertNote(notes) } 

    And here is the entity I am using to create it.

    @Entity data class Notes( @PrimaryKey val id: Int?, val name: String ) 

    I posted this to stackoverflow, but it seems nobody has helped as of yet, and I am sick and tired of trying and failing, so it would be perfect if someone could point me in the right direction, please.

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

    Gradle 6.0.1 : Fixes Incremental Java compilation broken with Android 3.5.1

    Posted: 18 Nov 2019 09:28 PM PST

    Thought I would leave this here, since some people were having problems

    https://docs.gradle.org/6.0.1/release-notes.html

    Incremental Compilation Bug

    https://github.com/gradle/gradle/issues/11330

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

    How to not set a default date in CalendarView?

    Posted: 19 Nov 2019 02:56 AM PST

    The CalendarView is defaulting to todays(current) date with it being highlighted. I searched a bit online and there seems to be no method or for it to not default to any date. Is there a way I can clear the default date?

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

    UX/UI Tools

    Posted: 18 Nov 2019 09:17 PM PST

    Hi everyone,

    I wonder what tools are you using when building or designing the UI. Or if you have a custom Icon. Is there any third party tools that you guys used to create the UI or you just used the layout editor in android studio for all the Ui design?

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

    Abstraction epiphany

    Posted: 18 Nov 2019 10:15 AM PST

    This may be obvious for most of you but I just had the most profound epiphany while working on a side project. Lately I've been diving into the topic of functional programming and something that's been hammered home to me is how important pure functions are. However it's becoming blatantly apparent that it isn't possible to write pure functions in android most of the time for numerous reasons. Unless you abstract your code that is.

    You can achieve pure functions by encapsulating and abstracting related code into other classes, and inject them into life-cycle classes (ViewModels, Services, Activities, etc). This way the dependency classes can be composed of pure functions, resulting in MUCH easier to test code, as well as less bugs and side effects.

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

    Add firebase user id token as header in retrofit call to server.

    Posted: 18 Nov 2019 06:45 PM PST

    Hey guys. I'm working on a project in which I'm using firebase auth as authentication provider for my client and authentication middleware on my server side. For every request to my server, the client have to send his ID token which will be validated by the firebase auth middleware before giving access to the server ressources.

    I want to retrieve and put the firebase user ID token in every request made by the user to the server. Of course I can manually retrieve the ID at every request and put it in the request header but I want to know if there is a way to automatically retrieve the ID and put it in the request interceptor for retrofit call ?

    Thanks 🙏

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

    CCPA question

    Posted: 18 Nov 2019 10:56 AM PST

    Today I received an email from AdMob about the CCPA. Apparently this is a new law which makes us developers restrict how ads are delivered in California. According to the documentation I can comply with this by adding networkExtrasBundle.putInt("rdp", 1); to my AdRequest. And this means that the people will see non-personalized ads. Now with GDPR law all of my apps are using networkExtrasBundle.putString("npa", "1"); which also means that people are seeing non-personalized ads. Is there a difference between the two flags? If I offer the user the option for the "npa" is this mean that I don't need to add also a question for the "rdp"? Can someone explain what we should do with our apps? Thank you!

    Source for GDPR: https://developers.google.com/admob/android/eu-consent

    Source for CCPA: https://developers.google.com/admob/android/ccpa

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

    Trying to access storage from NDK, compiler is fine with the struct AStorageManager, but doesn't understand AStorageManager_new() even though they are littleraly defined in the same header...

    Posted: 18 Nov 2019 04:40 PM PST

    Not sure what else to say here. I have this code:

    #include <jni.h> #include <unistd.h> #include <sys/param.h> #include <android/obb.h> #include <android/storage_manager.h> #include "cJSON/cJSON.h" #include <log/log.h> ... void MyClass::loadFiles(){ AStorageManager* man; //man = AStorageManager_new(); } 

    which compiles fine until I uncomment the second line. Both are defined in the same header, afaik I have all the required includes in both the c++ src file and the Android.mk

    LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := myapp-native LOCAL_SRC_FILES += utils.cpp midiSynth.cpp testing.cpp LOCAL_SRC_FILES += generated/nativeWrapper.cpp makefile LOCAL_LDLIBS := -llog -landroid LOCAL_SRC_FILES += $(wildcard $(LOCAL_PATH)/mm/*.cpp) $(wildcard $(LOCAL_PATH)/cJSON/*.c) 

    When I uncomment the man = AStorageManager_new(); then I get the following error:

    /jni/mm/MyClasse.cpp:26: error: undefined reference to 'AStorageManager_new' 

    Android Studio has no problem finding it, I can control click to get to the header, and the autocomplete for the method works just fine. I am at a loss.

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

    A few weeks ago, I shared a standalone icon generation tool with a nice GUI I made (for generating iOS and Android icons). Following up with an Update now. FREE with this link! Please consider leave a rating if you try it out

    Posted: 18 Nov 2019 08:54 AM PST

    How does the android vector work ?

    Posted: 18 Nov 2019 09:28 AM PST

    I need make 3 stars in a row <vector android:height="24dp" android:tint="#105EE6"
    android:viewportHeight="24.0" android:viewportWidth="24.0"
    android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
    <path android:fillColor="#FF000000" android:pathData="M12,17.27L18.18,21l-1.64,-7.03L22,9.24l-7.19,-0.61L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21z"/>
    </vector>
    this is 1 star how to duplicate to make it to a 3 stars in a row ?

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

    Espresso unit testing and things to watch out in Android

    Posted: 18 Nov 2019 09:25 AM PST

    Can't find Carrier/Sim Unlock for LG Stylo 5

    Posted: 18 Nov 2019 11:53 AM PST

    Hi all, I'm trying to unlock this LM-Q720ps and XDA doesn't even have a section for this phone yet and I can't seem to find anything on this other than phishy sites that provide a supposed unlock code. Any methods available for unlocking this from boost mobile? I'm trying to use it with Mint Mobile.

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

    No comments:

    Post a Comment