• Breaking News

    Monday, January 27, 2020

    Android Dev - Weekly "who's hiring" thread!

    Android Dev - Weekly "who's hiring" thread!


    Weekly "who's hiring" thread!

    Posted: 27 Jan 2020 04:44 AM PST

    Looking for Android developers? Heard about a cool job posting? Let people know!

    Here is a suggested posting template:

    Company: <Best Company Ever>
    Job: [<Title>](https://example.com/job)
    Location: <City, State, Country>
    Allows remote: <Yes/No>
    Visa: <Yes/No>

    Feel free to include any other information about the job.

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

    Weekly Questions Thread - January 27, 2020

    Posted: 27 Jan 2020 02:56 AM PST

    This thread is for simple questions that don't warrant their own thread (although we suggest checking the sidebar, the wiki, our Discord, or Stack Overflow before posting). Examples of questions:

    • How do I pass data between my Activities?
    • Does anyone have a link to the source for the AOSP messaging app?
    • Is it possible to programmatically change the color of the status bar without targeting API 21?

    Important: Downvotes are strongly discouraged in this thread. Sorting by new is strongly encouraged.

    Large code snippets don't read well on reddit and take up a lot of space, so please don't paste them in your comments. Consider linking Gists instead.

    Have a question about the subreddit or otherwise for /r/androiddev mods? We welcome your mod mail!

    Also, please don't link to Play Store pages or ask for feedback on this thread. Save those for the App Feedback threads we host on Saturdays.

    Looking for all the Questions threads? Want an easy way to locate this week's thread? Click this link!

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

    Dynamic screens using server-driven UI in Android

    Posted: 26 Jan 2020 04:22 PM PST

    Working with byte streams in Kotlin

    Posted: 27 Jan 2020 06:55 AM PST

    Need help with Webview displaying pdf

    Posted: 27 Jan 2020 07:44 AM PST

    Hey I am having a small problem with trying to display online pdf's using webview and google drive. Most of the times it works fine, but around once in every 3 times I try to go into the pdf file what happens is that the google drive will display no no preview available, and I will get this error in the console:

    I/chromium: [INFO:CONSOLE(92)] "Uncaught CustomError: Did not receive drive#about kind when fetching import map:undefined", source: https://www.gstatic.com/_/apps-viewer/_/js/k=apps-viewer.standalone.iw.nPmJUigVjYY.O/d=1/ct=zgms/rs=AC2dHMJ5W67xChDpdTOaSavkSV5aN0BM8g/m=main (92) I/chromium: [INFO:CONSOLE(92)] "Uncaught [object Object]", source: https://www.gstatic.com/_/apps-viewer/_/js/k=apps-viewer.standalone.iw.nPmJUigVjYY.O/d=1/ct=zgms/rs=AC2dHMJ5W67xChDpdTOaSavkSV5aN0BM8g/m=main (92)

    I tried looking up everywhere about this error, it seems other people have had it, but I couldn't find a fix. I would really appreciate any kind of help.

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

    UI, is this too far from Material Design guidelines?

    Posted: 27 Jan 2020 07:35 AM PST

    I love playing around with UI to make it functional and beatuiful. I know that we should be following Material Design guidelines and that a certain amount of theming is totally legitimate, however, I'm worried my choice of font and general layout are slightly too far from a 'normal' Material Design experience.

    Screen 1: https://i.imgur.com/0V0L9Kg.jpg

    Video 1: https://i.imgur.com/w2j5VQ0.mp4

    Any advice/critique is welcomed.

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

    How can I add more vector icons to the built in list in Android Studio?

    Posted: 27 Jan 2020 07:30 AM PST

    Android Studio has a nice collection of vector icons to use as drawables without third party libs, but their variety is way too small. How can I supercharge this collection with other vector icons of the same format? There are a bunch around, under different licenses. Thanks

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

    Simple location tracker?

    Posted: 27 Jan 2020 07:09 AM PST

    I need to write a very simple background app (service?) for Android.

    It basicly needs to every 60 seconds call www.mydomain.com/location.php?lon=x&lat=y&deviceid=deviceid where

    • lat = phone's latitude
    • lon = phone's longtitude
    • deviceid = phone's deviceid

    That's it.

    How do i get around doing this as easily as possible? I have written python, java, c#, php and most other things but never apps.

    I figure this must have been solved many times before, but i can't seem to find anything that fits with my requirements.

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

    Delete current app on Play Store and upload with new Certificate?

    Posted: 27 Jan 2020 06:51 AM PST

    So I made a huge mistake creating my Cert for verifying my App!

    I didnt want to put my whole name in there to show on Google Play. I wanted to have my username display but I forgot to write sth in the Company field.

    Can I simply delete my app from the Play Store and reupload it with a new Cert but same package name?

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

    How can I display a large online pdf file?

    Posted: 27 Jan 2020 02:34 AM PST

    I am trying to save a lot of pdf files on a firebase database, and display them at will using webview. My problem is that some of them are large(100 pages or so), and when using google drive to display the file it says it is too large. Downloading the file is also no good since it could take a long time to download, and id rather it displays it page by page like google docs does. Any idea how I can do so?

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

    Auto read OTP android with SMS User Consent API

    Posted: 26 Jan 2020 09:45 AM PST

    Android WebView not working with CipherInputStream

    Posted: 27 Jan 2020 05:19 AM PST

    I am building an Application which will be showing downloaded Encrypted web-pages (web pages contains might contain webm files also).

    To achieve this goal I override shouldInpterceptRequest method which returns WebResourceResponse. The constructor of WebResourceResponse needs multiple argument one of which is InputStream.

    Every thing is working fine When I am using Decrypted files and getting FileInputStream and passing the same to WebResourceResponse

    private WebResourceResponse getFile(String filePath) { FileInputStream fileInputStream = null; String mimeType = ""; String encoding = null; switch (filePath.substring(filePath.lastIndexOf('.'))) { case ".html" : mimeType = "text/html"; encoding = "utf-8"; break; case ".png" : mimeType = "image/png"; break; case ".webm" : mimeType = "video/webm"; break; case ".css" : mimeType = "text/css"; encoding = "utf-8"; break; case ".js" : mimeType = "text/javascript"; encoding = "utf-8"; break; } fileInputStream = new FileInputStream(new File(path, filePath)); } catch (FileNotFoundException e) { e.printStackTrace(); } return new WebResourceResponse(mimeType, encoding, fileInputStream); } 

    But When I am passing CipherInputStream (While using encrypted file) its not working.

     private WebResourceResponse getFile(String filePath) { String mimeType = ""; String encoding = null; switch (filePath.substring(filePath.lastIndexOf('.'))) { case ".html" : mimeType = "text/html"; encoding = "utf-8"; break; case ".png" : mimeType = "image/png"; break; case ".webm" : mimeType = "video/webm"; break; case ".css" : mimeType = "text/css"; encoding = "utf-8"; break; case ".js" : mimeType = "text/javascript"; encoding = "utf-8"; break; } TestFileInputStream TestFileInputStream = null; TestCipherInputStream testCipherInputStream = null; try { if(!filePath.contains("favicon.ico") ) { testFileInputStream = new TestFileInputStream(new File(path, filePath)); testCipherInputStream = new TestCipherInputStream(testFileInputStream, cipher); fileInputStreamArrayList.add(testFileInputStream); cipherInputStreamArrayList.add(testCipherInputStream); } //fileInputStream = new FileInputStream(new File(path, filePath)); } catch (FileNotFoundException e) { e.printStackTrace(); } return new WebResourceResponse(mimeType, encoding, testCipherInputStream); } 

    // Custom Class so that CipherInputStream will not Closed

    public class TestCipherInputStream extends CipherInputStream { private boolean canClose = false; public TestCipherInputStream(InputStream is, Cipher c) { super(is, c); } @Override public void close() throws IOException { if(canClose) super.close(); } public void canCloseStream() { canClose = true; } } 

    // Custom Class so that fileInputStream will not Closed

    public class TestFileInputStream extends FileInputStream { private boolean canClose = false; public TestFileInputStream(File file) throws FileNotFoundException { super(file); } @Override public void close() throws IOException { if(canClose) super.close(); } public void canCloseStream() { canClose = true; } } 

    Its shows syntax error in js, html etc file. I thought it might be an error because of synchronisation (When using cipherInputStream that time before getting the whole js file WebView started calling other files) So I put some delay and its working.

    But then I faced one more issue (My web-Page have one scroll feature which when user scroll it fetch different quality of video) When user scroll shouldInpterceptRequest was called and I am passing the right video but its not displaying.

    When I tried to debug that I saw that WebView not calling available() and read() method over that stream.

    Thank You.

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

    How-To In-App Subscriptions for an app?

    Posted: 27 Jan 2020 04:26 AM PST

    Hi!

    I have a free app with basic functionality, but I would like to add many more. In order to do so, I've planned to implement in-app purchase (subscription) so people wanting premium features and to support my development can do so as it'd take plenty time and research from my part.

    But I don't know where to start, I've already looked StackOverflow and other sites. My questions:

    • Is it a good idea to do so? (I'm approaching it right?)
    • How to handle in-app subscriptions? (Firebase?)
    • Should I make it so code (modules?) will be downloaded into user's device when the subscription is brought?
    • App's functionality, for now, doesn't require a server but should I make an auth system (sign-in with Google account for example) to verify premium users?
    submitted by /u/noner22
    [link] [comments]

    Android Biometric Authentication with Face Auth

    Posted: 27 Jan 2020 03:50 AM PST

    Hi all,

    I recently noticed some banking apps adding in their change logs that the app can now be unlocked using your face through the biometric prompt API. This is a feature I am interested in testing and getting working in some past apps I have worked on, however, I cannot seem to find a list of phones that are supported. I currently use a OnePlus 6T which does support system face unlock but doesn't use your face for the biometric prompt. I believe it's something to do with google deeming their technology not secure enough or whatever.

    Does anyone know of a phone or a list of phones that support this new API feature as I will be looking to purchase one to test. I imagine it would be the latest pixel phones but I don't want to buy one to find out it doesn't work on it!

    Thanks in advance

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

    How to make drawers in Jetpack Compose

    Posted: 27 Jan 2020 03:26 AM PST

    Rewareded Ads not working

    Posted: 26 Jan 2020 11:03 PM PST

    today I wanted to publish my 2nd app, it included rewarded video ads for the first time, and so I changed the ad unit id from the test id to my real id, but now the ads won't load, does it take a while or is it because of the app isn't in the play store?

    I used the new API and followed this guide to include my ad in my app: https://developers.google.com/admob/android/rewarded-ads

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

    Offline-first Android app with local database and online sync

    Posted: 26 Jan 2020 02:24 PM PST

    I'm developing an android app that needs to function well offline, but I also want to be able to backup and sync the database with the cloud for paid users. Almost all data in the app will be user-created. If I didn't care about backup and sync, then Room database would be all I needed. But I'm not sure how to arrange backup and sync across devices for Room/SQLite.

    I've been learning about Firestore as an alternative, but I have two concerns:

    1. Reading and writing the same data that is already stored locally (cache/offline persistence turned on) causing unnecessarily high charges. The user is expected to access the app multiple times a day for very brief periods. I've read that after 30 minutes of inactivity, all the data will be re-fetched, which would be a LOT of read charges!
    2. The speed of queries when offline. Apparently reading data from the cache only is slow.

    Has anyone used Firestore for an offline-first app? Is there a way to use both Room for free users who only want data on their device and Firestore for paid users who want backup and sync? What would be an appropriate alternative? I'm pretty much a newbie at android dev. I have one app released, but it's all offline (Room database), so this is my first time looking at online solutions.

    TIA.

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

    How come some annoying recruiters bypass Do Not Disturb and even the zeroed media volume and still harass me with ringing calls? Is this a privilege they pay for?

    Posted: 27 Jan 2020 05:20 AM PST

    How do push notifications interact with doze mode? Can you get regular pushes in doze mode? What about high priority pushes?

    Posted: 26 Jan 2020 07:03 PM PST

    Call Mainactivity's method

    Posted: 27 Jan 2020 03:19 AM PST

    Greetings,

    I'm trying to call a method for my mainactivity, to no avail. On the root of my project, I have 2 files, Bth.cs and MainActivity.cs

    For context, my knowledge in Xamarin is... Lackluster. I'm self taught, as the project was basically thrown on my lap. I learned C#, but Xamarin is brand new to me, I only got a few days of tutorials on my back. The project was created a few years ago and there is absolutely NO documentation and there are barely any comments (most of them don't help in any ways). Now onto the problem:

    In Mainactivity, I have a timer that runs in the background to check for user activity. If nothing happen within 5 minutes, shut down the app (necessary, as we are looking to facture the time spent, so we need relatively accurate readings)

    Bth is the code partaining to the barcode readers we use.

    I've managed to pinpoint The part of the code that run whenever I scan a barcode. I would like to be able to call the Method in MainActivity that reset the variables used by the timer. But I cannot find a way to reach MainActivity. If that helps, know that Bth task that runs the connection to the barcode reader is an async method. Bth itself isn't an activity.

    Here are the relevant signatures:

    //MainActivity, which is an activity public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity{} //The method that resets the timer public void ResetTimer(){} //Bth class, IBth being an interface public class Bth : IBth //loop being the async task run all the time in the background. private async Task loop(string name, int sleepTime, bool readAsCharArray) 

    Thank you for your help.

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

    Upcoming storage change confusion.

    Posted: 26 Jan 2020 08:10 PM PST

    I simply don't understand what changes with Android 10 regarding storage. I have an app, based on Unity which saves the savegame like this:

    String filename = Application.persistentDataPath + "/" + filename;

    Stream fileStream = File.Open(filename, FileMode.Create, FileAccess.Write);

    BinaryFormatter formatter = new BinaryFormatter();

    formatter.Serialize(fileStream, obj);

    fileStream.Close();

    Will I have problem or not? If I have a problem: What should be the new approach?

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

    Dagger2: Module depends on another Module

    Posted: 26 Jan 2020 11:31 PM PST

    Dagger2: Module depends on another Module

    So, given this illustration:

    https://preview.redd.it/3l5tu0oby9d41.png?width=1746&format=png&auto=webp&s=29d4c6d5fd6d2cf8789a3c55bab6916ec4b4c5ba

    My MainActivityVM (ViewModel) requires a UrbanDictionaryRepo to be injected by constructor:

    https://preview.redd.it/4uvbaxhfw9d41.png?width=1848&format=png&auto=webp&s=3da81267262dccd4a696ed070f17015cc8a53563

    And this is the actual UrbanDictionaryRepo class:

    https://preview.redd.it/iungu9qnw9d41.png?width=1946&format=png&auto=webp&s=3c6efb76206ffe2bf1bc69a72f1babe36fa3c782

    As you can see, the previous class gets a UrbanDictionaryAPI interface injection, and here is the NetworkModule that provides it:

    https://preview.redd.it/4clw2dldw9d41.png?width=1466&format=png&auto=webp&s=d9b8be507b75e0a66b64ca7b62b5d66ccbba8565

    Now, I have a separate RepositoryModule that wraps all my Repository classes and as you can see in the very first image in this post just as I am injecting UrbanDictionaryAPI into the UrbanDictionaryRepo... the UrbanDictionaryRepo class gets injected in the MainActivityVM... but the problem begins right in the RepositoryModule class cause now my provider method is asking me to Inject by constructor the UrbanDictionaryAPI object:

    https://preview.redd.it/88gx5q61w9d41.png?width=1138&format=png&auto=webp&s=f6c140f88347552eed7fffec19463f3f8a25d420

    So how can I make my RepositoryModule aware of NetworkModule? How do this even works? I am so confused

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

    Need ideas for UI design or app flow for the below scenario.

    Posted: 26 Jan 2020 06:45 PM PST

    There is one admin which is in charge of handling 1+ users. The admin has to ask user specific questions to a user. There is nothing predetermined. The question can be something like "Did you have a healthy dinner today?" And the user would answer "Yes, I ate salad for dinner.". So, I need to make an app which can do this. I initially had built a chat system using SQL server hosted on AWS RDS but it was extremely laggy and didn't do the job perfectly.

    One option that I have in mind is maybe the admin decides what question to ask to which user and enters it in some textbox on admin's version of the app. The entered question is sent to some database on the server along with the intended user. Now, on the user's view of the app there is a textview which is is set based on the question entered by the admin for the user. It would maybe query a database and check whether the admin has asked a question. If not then display some default message. If the admin has asked a question then set text to that question and then allow the user to enter their answer.

    Thank you for your suggestions and time

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

    AdMob: View All Countries' Match Rates

    Posted: 26 Jan 2020 10:57 AM PST

    When viewing a report in AdMob that shows match rate by country, it allows me to sort those countries between Impressions, Impression RPM and Estimated Earnings. According to what you choose, it displays the exact match rate for 5 top countries and compiles the rest into an average which is classified as "Other".

    Is it possible to view a report that displays all countries' exact match rates individually, like the first 5 are displayed in the example below?

    AdMob Screenshot

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

    No comments:

    Post a Comment