Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development #10

Merged
merged 31 commits into from Mar 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
960ba24
Created Java Class for managing cache
Javinator9889 Mar 2, 2018
62bc84f
Updated cache. Edited cards for new method additions. In progress...
Javinator9889 Mar 2, 2018
e97b566
Created loading screen. Added new data into cards
Javinator9889 Mar 4, 2018
7acf264
Completed new cards values
Javinator9889 Mar 4, 2018
cadc982
Completed requirement #4
Javinator9889 Mar 5, 2018
171d725
Added load screen. Jobs persisted for requirement #6
Javinator9889 Mar 5, 2018
c085b61
Updated UptadeChecker. Included now links to Play Store
Javinator9889 Mar 5, 2018
3e4a0b0
Invitation menu repaired. Solved bug #8
Javinator9889 Mar 6, 2018
712a65b
Solved an error in donations - Google Play Services were not enabled/…
Javinator9889 Mar 6, 2018
7d44f45
Updated loading dialog
Javinator9889 Mar 6, 2018
ff4e5c8
Added transitions for enhacement #9. Solved a problem with new cache job
Javinator9889 Mar 6, 2018
91e8cee
Solved bug #2 and completed extra #7. Added new libraries to "License…
Javinator9889 Mar 6, 2018
501c5f2
Refactored code - enhancement #5
Javinator9889 Mar 6, 2018
2971aa2
Updated JavaDoc
Javinator9889 Mar 6, 2018
96e6ae3
Updated License. Exported version "1.18" of the application
Javinator9889 Mar 6, 2018
57418bd
Removed /docs because of conflicts
Javinator9889 Mar 6, 2018
66a4d39
Updated screenshots
Javinator9889 Mar 6, 2018
a2d4197
Solved exception in DataLoaderScreen for PullRequest #10
Javinator9889 Mar 7, 2018
ab86aaa
Solved notifications problems for PullRequest #10
Javinator9889 Mar 7, 2018
0169e24
Solved an error with DonationsFragment where devices with Android L w…
Javinator9889 Mar 7, 2018
da395fc
Solved an error with donations - in some devices the app was crashing…
Javinator9889 Mar 8, 2018
97b9122
Solved errors in DataLoaderScreen. Optimized transitions and animations
Javinator9889 Mar 8, 2018
38d7cc0
Solved graphic issues
Javinator9889 Mar 8, 2018
a453bd9
Added apk
Javinator9889 Mar 8, 2018
0f3b7ce
Solved a problem with calendar
Javinator9889 Mar 8, 2018
ce8eba0
Updated .apk
Javinator9889 Mar 8, 2018
a00efe1
Updated calendar
Javinator9889 Mar 8, 2018
71d12fe
Update calendar function
Javinator9889 Mar 8, 2018
2f6db87
Updated .apk
Javinator9889 Mar 8, 2018
1f6f244
Corrected UI
Javinator9889 Mar 8, 2018
1018d78
Updated .apk
Javinator9889 Mar 8, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions Green_Arrow_Up_Darker.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
348 changes: 348 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -5,6 +5,10 @@
[![BitCoinApp - Aptiode](https://img.shields.io/badge/Download%20-Aptoide-green.svg)](https://goo.gl/5sqsNP)
[![BitCoinApp - Releases](https://img.shields.io/badge/Download%20-GitHub%20APK-green.svg)](https://goo.gl/qeaU85)

## Read the docs

Here you have the link where you will be able to *read the docs* for this app: https://javinator9889.github.io/BitCoinPools/

## Changelog

With the latest update, we have just integrated the option to *recieve notifications*: as this app is for getting information about [BitCoin Pools](https://en.wikipedia.org/wiki/Mining_pool) is important to know the value of the **BitCoin**. So now, you can configure notifications and more in the app.
Expand Down
36 changes: 36 additions & 0 deletions README_conflict-20180306-220131.md
@@ -0,0 +1,36 @@
# BitCoinPools

**This is an app for retrieving latest information about BTC pools**.

[![BitCoinApp - Aptiode](https://img.shields.io/badge/Download%20-Aptoide-green.svg)](https://goo.gl/5sqsNP)
[![BitCoinApp - Releases](https://img.shields.io/badge/Download%20-GitHub%20APK-green.svg)](https://goo.gl/qeaU85)

## Changelog

With the latest update, we have just integrated the option to *recieve notifications*: as this app is for getting information about [BitCoin Pools](https://en.wikipedia.org/wiki/Mining_pool) is important to know the value of the **BitCoin**. So now, you can configure notifications and more in the app.

## What this app exactly does?

The purpose of this application is *getting information about mining pools* avaiable on Internet [(click here for getting more information)](https://en.wikipedia.org/wiki/Mining_pool), and also giving the user **more information** for the BitCoin (as its current price)

![Interface](https://github.com/Javinator9889/BitCoinPools/blob/master/screenshots/englishinterface.jpg)
![Buttons](https://github.com/Javinator9889/BitCoinPools/blob/master/screenshots/buttons.jpg)

**Now, in the latest version** I have included a notifcation system that can be *enabled or disabled* by the user in order to know when the BitCoin **reaches or not** a specific price.

![Settings](https://github.com/Javinator9889/BitCoinPools/blob/master/screenshots/choosingdays.jpg)

## Downloading different versions

Here you have to download the newest version available, on *Aptoide* or directly from *GitHub*:

[![BitCoinApp - Aptiode](https://img.shields.io/badge/Download%20-Aptoide-green.svg)](https://goo.gl/5sqsNP)
[![BitCoinApp - Releases](https://img.shields.io/badge/Download%20-GitHub%20APK-green.svg)](https://goo.gl/qeaU85)

## I have used it and I love it. What can I do?

You can do:
+ **Fork** these project and *develop* your custom version: I will like to see it
+ **Rate**, giving me a star ⭐️
+ **See my other projects** in which I spent so much time working on them 💻
+ **And watch 👁** if you would like to recieve new upgardes
7 changes: 7 additions & 0 deletions Red_Arrow_Down.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 10 additions & 10 deletions app/build.gradle
Expand Up @@ -7,7 +7,7 @@ android {
applicationId "javinator9889.bitcoinpools"
minSdkVersion 21
targetSdkVersion 27
versionCode 30
versionCode 59
versionName "1.18"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
Expand All @@ -31,27 +31,27 @@ android {

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-crash:11.8.0'
implementation 'com.google.firebase:firebase-invites:11.8.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
compile 'com.android.support:preference-v14:27.0.2'
compile 'com.android.support:preference-v7:27.0.2'
implementation 'com.android.support:design:27.0.2'
compile 'com.android.support:preference-v14:27.1.0'
compile 'com.android.support:preference-v7:27.1.0'
implementation 'com.android.support:design:27.1.0'
implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
compile 'ch.acra:acra:4.9.2'
implementation('com.mikepenz:aboutlibraries:6.0.2@aar') {
transitive = true
}
implementation 'com.android.support:recyclerview-v7:27.0.2'
implementation 'com.android.support:support-annotations:27.0.2'
compile 'com.android.support:appcompat-v7:27.0.2'
compile 'com.android.support:cardview-v7:27.0.2'
compile 'com.android.support:recyclerview-v7:27.0.2'
implementation 'com.android.support:recyclerview-v7:27.1.0'
implementation 'com.android.support:support-annotations:27.1.0'
compile 'com.android.support:appcompat-v7:27.1.0'
compile 'com.android.support:cardview-v7:27.1.0'
compile 'com.android.support:recyclerview-v7:27.1.0'
compile 'com.jpardogo.materialtabstrip:library:1.1.1'
compile 'com.google.firebase:firebase-core:11.8.0'
compile('com.crashlytics.sdk.android:crashlytics:2.7.1@aar') {
Expand Down
Binary file added app/debug/app-debug.apk
Binary file not shown.
1 change: 1 addition & 0 deletions app/debug/output.json
@@ -0,0 +1 @@
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":41},"path":"app-debug.apk","properties":{"packageId":"javinator9889.bitcoinpools","split":"","minSdkVersion":"21"}}]
Binary file added app/release/BitCoinPools-1.18.apk
Binary file not shown.
Binary file removed app/release/BitCoinPools.apk
Binary file not shown.
2 changes: 1 addition & 1 deletion app/release/output.json
@@ -1 +1 @@
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":28},"path":"app-release.apk","properties":{"packageId":"javinator9889.bitcoinpools","split":"","minSdkVersion":"21"}}]
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":59},"path":"app-release.apk","properties":{"packageId":"javinator9889.bitcoinpools","split":"","minSdkVersion":"21"}}]
30 changes: 21 additions & 9 deletions app/src/main/AndroidManifest.xml
Expand Up @@ -8,36 +8,48 @@
<!--<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />-->
<uses-permission android:name="android.permission.READ_LOGS" />
<uses-permission android:name="com.android.vending.BILLING" />

<application
android:name=".BitCoinApp"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/CustomTheme"
android:name=".BitCoinApp">
android:theme="@style/CustomTheme">
<activity
android:name=".MainActivity"
android:configChanges="orientation"
android:screenOrientation="portrait">
android:name=".DataLoaderScreen"
android:screenOrientation="portrait"
android:configChanges=
"screenSize|smallestScreenSize|screenLayout|orientation"
android:theme="@style/AppTheme.Launcher">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:screenOrientation="portrait"
android:configChanges="orientation">
</activity>
<activity
android:name=".License"
android:configChanges="orientation"
android:screenOrientation="portrait">
</activity>
android:screenOrientation="portrait"/>
<activity
android:name=".SpinnerActivity"
android:configChanges="orientation"
android:screenOrientation="portrait" />
<activity android:name=".FragmentViews.DonationsActivity" />
<activity android:name=".FragmentViews.DonationsActivity"
tools:ignore="InnerclassSeparator" />

<service android:name=".BackgroundJobs.JobSchedulerService"
<service
android:name=".BackgroundJobs.JobSchedulerService"
android:permission="android.permission.BIND_JOB_SERVICE"
tools:ignore="InnerclassSeparator" />
<service android:name=".BackgroundJobs.CacheJobSchedulerService"
android:permission="android.permission.BIND_JOB_SERVICE"
tools:ignore="InnerclassSeparator" />

Expand Down
@@ -1,15 +1,10 @@
package javinator9889.bitcoinpools.AppUpdaterManager;

import android.app.DownloadManager;
import android.content.BroadcastReceiver;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import android.os.Environment;
import android.os.StrictMode;
import android.support.annotation.NonNull;
import android.util.Log;

Expand All @@ -20,8 +15,6 @@
import org.json.JSONArray;
import org.json.JSONException;

import java.io.File;
import java.lang.reflect.Method;
import java.util.concurrent.ExecutionException;

import javinator9889.bitcoinpools.BitCoinApp;
Expand All @@ -36,55 +29,56 @@ public class CheckUpdates {
private static final String GITHUB_API_URL = "https://api.github.com/repos/";
private static String CONNECTION_URL;
private static String APP_VERSION;
private static JSONArray RETRIEVED_DATA;
private static String LATEST_VERSION;
private static String DOWNLOAD_URL = null;
private static String MORE_INFO;
private static String APK_NAME;
private static String MORE_INFO = Constants.GOOGLE_PLAY_URL;
private static boolean HTML_PAGE = false;

public CheckUpdates(@NonNull String GitHub_User, @NonNull String GitHub_Repo) {
CONNECTION_URL = GITHUB_API_URL + GitHub_User + "/" + GitHub_Repo + "/releases";
try {
APP_VERSION = BitCoinApp.getAppContext().getPackageManager().getPackageInfo(BitCoinApp.getAppContext().getPackageName(), 0).versionName;
APP_VERSION = BitCoinApp.getAppContext().getPackageManager()
.getPackageInfo(BitCoinApp.getAppContext().getPackageName(), 0)
.versionName;
} catch (PackageManager.NameNotFoundException e) {
Log.e(Constants.LOG.CTAG, Constants.LOG.NO_INFO + e.getMessage(), new PackageManager.NameNotFoundException());
Log.e(Constants.LOG.CTAG, Constants.LOG.NO_INFO + e.getMessage(),
new PackageManager.NameNotFoundException());
}
getData();
}

public void checkForUpdates(final Context dialogContext, String title, String description, String positiveText, String negativeText, String neutralText) {
if (!APP_VERSION.equals(LATEST_VERSION) && (Float.parseFloat(APP_VERSION) < Float.parseFloat(LATEST_VERSION))) {
Log.d(Constants.LOG.CTAG, Constants.LOG.NEW_VERSION + APP_VERSION + " | " + LATEST_VERSION);
public void checkForUpdates(final Context dialogContext, String title, String description,
String positiveText, String negativeText, String neutralText) {
if (!APP_VERSION.equals(LATEST_VERSION)) {
Log.d(Constants.LOG.CTAG, Constants.LOG.NEW_VERSION + APP_VERSION
+ " | " + LATEST_VERSION);
MaterialDialog materialDialog;
if (!HTML_PAGE) {
Log.d(Constants.LOG.CTAG, Constants.LOG.DOW_NOTIFICATION);
materialDialog = new MaterialDialog.Builder(dialogContext)
.title(title)
.content(description)
.positiveText(positiveText)
.negativeText(negativeText)
.neutralText(neutralText)
.neutralText(positiveText)
.cancelable(false)
.onAny(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
public void onClick(@NonNull MaterialDialog dialog,
@NonNull DialogAction which) {
switch (which) {
case POSITIVE:
DownloadManager.Request downloadRequest = new DownloadManager.Request(Uri.parse(DOWNLOAD_URL));
downloadRequest.setTitle(APK_NAME);
downloadRequest.allowScanningByMediaScanner();
downloadRequest.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
downloadRequest.setVisibleInDownloadsUi(true);
downloadRequest.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, APK_NAME);
final DownloadManager manager = (DownloadManager) dialogContext.getSystemService(Context.DOWNLOAD_SERVICE);
assert manager != null;
manager.enqueue(downloadRequest);
break;
case NEUTRAL:
Uri webUri = Uri.parse(MORE_INFO);
Intent launchBrowser = new Intent(Intent.ACTION_VIEW, webUri);
dialogContext.startActivity(launchBrowser);
try {
Uri webUri = Uri.parse(
"market://details?id=javinator9889.bitcoinpools");
Intent launchBrowser = new Intent(Intent.ACTION_VIEW,
webUri);
dialogContext.startActivity(launchBrowser);
} catch (ActivityNotFoundException e) {
Uri webUri = Uri.parse(MORE_INFO);
Intent launchBrowser = new Intent(Intent.ACTION_VIEW,
webUri);
dialogContext.startActivity(launchBrowser);
}
break;
case NEGATIVE:
dialog.dismiss();
Expand Down Expand Up @@ -127,28 +121,34 @@ private void getData() {
NetworkConnection connection = new NetworkConnection();
connection.execute(CONNECTION_URL);
try {
RETRIEVED_DATA = connection.get();
JSONArray RETRIEVED_DATA = connection.get();
int jsonLength = RETRIEVED_DATA.length();
boolean noPreRelease = false;
for (int i = 0; (i < jsonLength) && !noPreRelease; ++i) {
if (!RETRIEVED_DATA.getJSONObject(i).getBoolean("prerelease")) {
noPreRelease = true;
LATEST_VERSION = RETRIEVED_DATA.getJSONObject(i).getString("tag_name");
boolean apkFound = false;
for (int j = 0; (j < RETRIEVED_DATA.getJSONObject(i).getJSONArray("assets").length()) && !apkFound; ++j) {
if (!(RETRIEVED_DATA.getJSONObject(i).getJSONArray("assets").isNull(j) && (RETRIEVED_DATA.getJSONObject(i).getJSONArray("assets").getJSONObject(j).getString("name").contains(".apk")))) {
for (int j = 0; (j < RETRIEVED_DATA.getJSONObject(i).getJSONArray("assets")
.length()) && !apkFound; ++j)
{
if (!(RETRIEVED_DATA.getJSONObject(i).getJSONArray("assets").isNull(j)
&& (RETRIEVED_DATA.getJSONObject(i).getJSONArray("assets")
.getJSONObject(j).getString("name").contains(".apk"))))
{
apkFound = true;
DOWNLOAD_URL = RETRIEVED_DATA.getJSONObject(i).getJSONArray("assets").getJSONObject(0).getString("browser_download_url");
APK_NAME = RETRIEVED_DATA.getJSONObject(i).getJSONArray("assets").getJSONObject(j).getString("name");
DOWNLOAD_URL = RETRIEVED_DATA.getJSONObject(i)
.getJSONArray("assets").getJSONObject(0)
.getString("browser_download_url");
}
}
if (DOWNLOAD_URL == null) {
HTML_PAGE = true;
}
MORE_INFO = RETRIEVED_DATA.getJSONObject(i).getString("html_url");
}
}
} catch (InterruptedException | ExecutionException | JSONException | NullPointerException e) {
} catch (InterruptedException | ExecutionException
| JSONException | NullPointerException e) {
Crashlytics.logException(e);
Log.e(Constants.LOG.CTAG, Constants.LOG.NO_INFO + e.getMessage());
}
Expand Down
@@ -1,6 +1,7 @@
package javinator9889.bitcoinpools.AppUpdaterManager;

import android.os.AsyncTask;
import android.support.annotation.NonNull;
import android.util.Log;

import org.json.JSONArray;
Expand Down Expand Up @@ -34,6 +35,7 @@ protected JSONArray doInBackground(String... url) {
return null;
}

@NonNull
private String readAll(Reader httpsReader) throws IOException {
StringBuilder response = new StringBuilder();
int valueRead;
Expand All @@ -43,9 +45,11 @@ private String readAll(Reader httpsReader) throws IOException {
return response.toString();
}

@NonNull
private JSONArray readJSONFromURL(String url) throws IOException, JSONException {
try (InputStream JSONStream = new URL(url).openStream()) {
BufferedReader br = new BufferedReader(new InputStreamReader(JSONStream, Charset.forName("UTF-8")));
BufferedReader br = new BufferedReader(
new InputStreamReader(JSONStream, Charset.forName("UTF-8")));
String JSONText = readAll(br);
return new JSONArray(JSONText);
}
Expand Down