Skip to content

Commit

Permalink
Merge pull request #46 from MindorksOpenSource/development
Browse files Browse the repository at this point in the history
Fix release mode issue
  • Loading branch information
amitshekhariitbhu authored Apr 19, 2018
2 parents 56c714a + 7994af2 commit 23940e8
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 28 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

Add this in your build.gradle
```groovy
compile 'com.mindorks.android:prdownloader:0.2.0'
compile 'com.mindorks.android:prdownloader:0.3.0'
```
Do not forget to add internet permission in manifest if already not present
```xml
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.sample"
minSdkVersion 14
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/sample/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class MainActivity extends AppCompatActivity {
final String URL8 = "http://www.appsapk.com/downloading/latest/Evernote%20-%20stay%20organized.-7.9.7.apk";
final String URL9 = "http://www.appsapk.com/downloading/latest/UC-Browser.apk";
final String URL10 = "http://www.appsapk.com/downloading/latest/Barcode%20Scanner-1.2.apk";
final String URL11 = "http://songs.djmazadownload.com/music/Zip/Hasee%20Toh%20Phasee%20[2014-MP3-VBR]%20-%20[DJMaza.Life].zip";
final String URL11 = "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_640x360.m4v";
final String URL12 = "http://www2.sdfi.edu.cn/netclass/jiaoan/englit/download/Harry%20Potter%20and%20the%20Sorcerer's%20Stone.pdf";
final String URL13 = "https://media.giphy.com/media/Bk0CW5frw4qfS/giphy.gif";
final String URL14 = "http://techslides.com/demos/sample-videos/small.mp4";
Expand Down Expand Up @@ -1059,7 +1059,7 @@ public void onClick(View view) {
PRDownloader.resume(downloadIdEleven);
return;
}
downloadIdEleven = PRDownloader.download(URL11, dirPath, "htp.zip")
downloadIdEleven = PRDownloader.download(URL11, dirPath, "BigBuckBunny.m4v")
.build()
.setOnStartOrResumeListener(new OnStartOrResumeListener() {
@Override
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'

Expand Down
20 changes: 2 additions & 18 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
#
# Copyright (C) 2017 MINDORKS NEXTGEN PRIVATE LIMITED
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

#Sun Nov 12 00:47:18 IST 2017
#Wed Apr 18 21:07:37 IST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
2 changes: 1 addition & 1 deletion prdownloader/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ apply plugin: 'com.android.library'

android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
buildToolsVersion '27.0.3'


defaultConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,15 @@ Response run() {
byte[] buff = new byte[BUFFER_SIZE];

if (!file.exists()) {
//noinspection ResultOfMethodCallIgnored
file.createNewFile();
if (file.getParentFile() != null && !file.getParentFile().exists()) {
if (file.getParentFile().mkdirs()) {
//noinspection ResultOfMethodCallIgnored
file.createNewFile();
}
} else {
//noinspection ResultOfMethodCallIgnored
file.createNewFile();
}
}

RandomAccessFile randomAccess = new RandomAccessFile(file, "rw");
Expand All @@ -189,7 +196,7 @@ Response run() {

do {

final int byteCount = inputStream.read(buff);
final int byteCount = inputStream.read(buff, 0, BUFFER_SIZE);

if (byteCount == -1) {
break;
Expand Down
2 changes: 1 addition & 1 deletion prdownloader/upload.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def siteUrl = 'https://github.com/MindorksOpenSource/PRDownloader'
def gitUrl = 'https://github.com/MindorksOpenSource/PRDownloader.git'

group = "com.mindorks.android"
version = '0.2.0'
version = '0.3.0'

install {
repositories.mavenInstaller {
Expand Down

0 comments on commit 23940e8

Please sign in to comment.