What gradle tasks you use/have written to help in development

Developing Android Apps - Thu, 01/17/2019 - 15:08

Gradle is very powerful but I often feel like it's the least utilized tool by devs that includes me. I've written a few custom tasks to help me at work during the development of some proprietary products. I'm interested what plugins are you using or you've written to help you in any shape or form?

submitted by /u/fapste
[link] [comments]
Categories: Android, Linux

(Java) Is it possible to catch all Exceptions in a given package?

Developing Android Apps - Thu, 01/17/2019 - 15:03

In my case, I want to catch all exceptions that are located in* (that can be thrown in a HttpsURLConnection), but I want to handle those that are of different packages separately. Is there a way to do this without listing all of them separately?

submitted by /u/nadwal
[link] [comments]
Categories: Android, Linux

Oxford University reportedly turns off its Huawei money tap

The Register - Thu, 01/17/2019 - 15:01
No more Chinese tech vendor grants for at least three to six months, compsci students told

Oxford University is reportedly suspending all research grants and donations from Chinese tech giant Huawei, according to a Chinese newspaper.…

Where has the weekly questions section disappeared?

Developing Android Apps - Thu, 01/17/2019 - 14:49

Where has the weekly questions section disappeared?

submitted by /u/zemaitis_android
[link] [comments]
Categories: Android, Linux

What do I do with the CryptoObject generated by BiometricPrompt API?

Developing Android Apps - Thu, 01/17/2019 - 14:22

I'm sort of confused what the CryptoObject's purpose is, where to store it, and how to use it to confirm successful biometric authentication.

Do I store the object in SharedPrefs when first enabling fingerprint auth? And then use that first Crypto object to make sure it hasn't changed when the user authenticates each time using the BiometricPrompt API?

(i.e. the CryptoObject would change if a new fingerprint was added, or existing one was removed, etc. so when these events happen, I need to get the user to input the password again)

Is that true? I'm just confused how/when to use key store, crypto object when working with BiometricPrompt API.

submitted by /u/Peng-Win
[link] [comments]
Categories: Android, Linux

What’s your fav IP scanner?

Linux - Thu, 01/17/2019 - 14:20

I currently use Angry IP scanner on Linux distros as well as Win7, but I’m curious what other people use on Linux and why!

submitted by /u/GEll95
[link] [comments]
Categories: Linux

Tech giant to spend $500m dealing with housing crisis caused by tech giants

The Register - Thu, 01/17/2019 - 14:15
Redmond to throw cash at the problem, hopes some might stick to affordable homes

Microsoft has revealed it is to spank the best part of $500m on attempting to deal with the lack of affordable housing in the Seattle area.…

java.nio.ByteBuffer, Java 9+ compiler and Android

Developing Android Apps - Thu, 01/17/2019 - 14:11

I compiled my project with command-line Gradle using OpenJDK 11 on Linux and to my surprise at runtime I had a NoSuchMethodError on java.nio.ByteBuffer.rewind(). After a bit of Googling I found:

Java 9 introduces overridden methods with covariant return types for the following methods in java.nio.ByteBuffer:

position​(int newPosition) limit​(int newLimit) flip​() clear​() mark​() reset​() rewind​()

In Java 9 they all now return ByteBuffer, whereas the methods they override return Buffer, resulting in exceptions like this when executing on Java 8 and lower: java.lang.NoSuchMethodError: java.nio.ByteBuffer.limit(I)Ljava/nio/ByteBuffer This is because the generated byte code includes the static return type of the method, which is not found on Java 8 and lower because the overloaded methods with covariant return types don't exist (the issue appears even with source and target 8 or lower in compilation parameters). The solution is to cast ByteBuffer instances to Buffer before calling the method.

So the solution is to either:

  • cast ByteBuffer to Buffer in all above calls. Not really satisfactory and will not work with third party libraries
  • compile with OpenJDK 8
  • use new '--release 8' java compiler option to force the boot classpath to Java 8

So my question is how that option can be passed to the java compiler ?

submitted by /u/bubbleguuum
[link] [comments]
Categories: Android, Linux

.htaccess FilesMatch not finding files with angularjs

I'm fairly new to configuring this, and I'm trying to understand what's going on and what I should do.

I have an app built on angularjs, and it's authenticated by shibboleth.

Part of the app is public, and part of the app needs shib authentication. In my .htaccess file, I have this:

Options +FollowSymLinks RewriteEngine on Options -Indexes IndexIgnore * AuthType Shibboleth require shibboleth ShibRequireSession off <FilesMatch "^(admin|secure)$"> AuthType Shibboleth ShibRequireSession on require shibboleth require valid-user </FilesMatch> # with some rewrite rules below

Now, FilesMatch should be matching files that is being requested from the server, based on regex matching, and before the matched file is served, it will require a shibb session and valid user, as I understand it.

And in this case, it should do that for every file that has 'admin' or 'secure' in the name, right? However, because in part due to angularjs (I suppose), for some reason this is working for whenever the server is requested files in an admin directory (presumable because one or more of them have 'admin' in the name), but it is not working at all for any file that has 'secure' in the name. I was trying to make it work for a file named

I have tried numerous combinations (and I am not the best at regex), but I've tried directly reference the file name while escaping dots: "^add\.secure\.js$" and the like.

Does anyone have any familiarity with this or could point me in the right direction?


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

Using google home voice controls to unlock Schlage door lock with Smartthings, sharptools and tasker

Tasker: Total Automation for Android - Thu, 01/17/2019 - 13:59

Hi All,

I am very new to tasker and sharptools and am completely lost in trying to accomplish my goal. Using Smartthings and Google home I want to be able to unlock my door using a phrase that only I know.

How can I get this done? I have tried watching tutorials but the the systems are so complicated that I just cannot figure it out. I have Smartthings linked up into my sharptools but setting up the automation in tasker is where I am stuck.



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

Looking to create my first application

Developing Android Apps - Thu, 01/17/2019 - 13:57

Hey Guys!

I've always had dreams of making an a weather application and never really did it. I know it's simple and there are a ton out there, but I'd like to try and do it myself. I work in a software engineering company, but more on the management/operational side. Not a developer by any means. I've coded some testing work for them in the past in python, but simple scripting is a far cry from actual development work. I'm finishing my MBA and looking to start working on this soon as a new hobby.

So looking around, there are tons of mentions of new frame works and API's that I don't really know of any not sure if I need.

Any advice or sources would be great! Thanks guys!

submitted by /u/jnewman90
[link] [comments]
Categories: Android, Linux

Why does the "Source Crop" for my Camera2 preview SurfaceView keep changing when nothing else does?

Developing Android Apps - Thu, 01/17/2019 - 13:55

This follows on from a previous conversation about why my camera preview changes proportions after rotation - I think I now sort of know why it does, but what I don't know is what the blinking flip I need to do about it.

Basically I have a CameraPreview that selects the closest available image size to the available space on the view and picks the correct size to match it. You might imagine that the CameraPreview looks a bit like this:

private void createCameraPreviewSession() {

try {

mSurfaceView.getHolder().setFixedSize(width, height);

Surface surface = mSurfaceView.getHolder().getSurface();
mPreviewRequestBuilder = mCameraDevice.createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW);
if (mCameraDevice != null && mImageReader != null && fragmentState == CONNECTING_CAMERA) {

mCameraDevice.createCaptureSession(Arrays.asList(surface), createStateCallback(), null);
} else {
} catch (CameraAccessException e) {
Log.w(TAG, "Access exception during CaptureSession initialisation: " + e.getMessage());


On the current test device, the width and height are 1280x720 or 720x1280 depending on orientation. The weird part is that when I first open the activity that uses this preview, the camera view is distorted. When I rotate it, it stays distorted, when I rotate it back, it looks fine and the proportions generally, but not always, stay alright after that first rotation.

After a lot of poking around I have finally discovered the dumpsys SurfaceFlinger command, which allows me to see the details of my surface, and that gives me some new information. When the view is bad it looks like this:
Layer name
Z | Comp Type | Disp Frame (LTRB) | Source Crop (LTRB)
SurfaceView - com.myApp/com.myApp.CameraActivity#0
4294967294 | Device | 0 0 720 1229 | 39.0 0.0 960.0 720.0
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
21055 | Device | 0 20 720 1280 | 0.0 20.0 720.0 1280.0
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

But when it is good it looks like this:

Layer name
Z | Comp Type | Disp Frame (LTRB) | Source Crop (LTRB)
SurfaceView - com.myApp/com.myApp.CameraActivity#0
4294967294 | Device | 0 0 720 1184 | 0.0 0.0 1280.0 720.0
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
21055 | Device | 0 20 720 1280 | 0.0 20.0 720.0 1280.0
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Clearly the Source Crop is being set completely differently in both cases - but can anyone tell me why? Where does the Source Crop come from and how can I change it? If I can't change it, is there a way to find what the Source Crop is set to for my surface? If I know that I should be able to find a way to compensate for the disparity.

submitted by /u/CrudelyDrawnSwords
[link] [comments]
Categories: Android, Linux

[HELP] Receive telegram notification when file is downloaded.

Tasker: Total Automation for Android - Thu, 01/17/2019 - 13:47

Here's what I want to make happen:

I want to receive message on telegram when the file download is completed.

Progress So Far:

I've created a bot using botfather and connected it to a channel. Tasker successfully sends messages to it when action is executed. I'm using Auto Notifications to intercept notification of uc browser. I also found out using Auto Notification helper task that on completion of download %antexts() changes to this values: UC Music, File Name,Successfully downloaded.

Now, the Problem is I created a profile and it would run and send message to my telegram channel when the uc browser starts downloading and not when it finishes downloading. How do I query notification every few seconds to monitor changes in values and trigger task as soon as it's value has text: Successfully downloaded?

Any ideas? Thanks in advance.

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

Max resolution on Android TV 960x540?

Developing Android Apps - Thu, 01/17/2019 - 13:46

Hey guys,

I had an Android dev build a small app for Android TV that shows a webpage as the screensaver. All is great it works really well, apart from the resolution of the screensaver seems to be stuck at 960x540, on a 4K screen that looks pretty poor. He's stumped and me being only a front end web guy can't seem to figure it out.

If anyone could point me in the right direction I'd be very grateful.



Android Studio file in case it helps:

submitted by /u/wdb94
[link] [comments]
Categories: Android, Linux