diff --git a/SUBMISSION.MD b/SUBMISSION.MD new file mode 100644 index 0000000..aa6a9bd --- /dev/null +++ b/SUBMISSION.MD @@ -0,0 +1,17 @@ +**Email Address**: tobiaswoerthle@gmail.com, daniel@pollithy.com, [Wlad's email] + +**Full Name**: Tobias Woerthle, Daniel Pollithy, Wlad Meixner + +**Name of Project**: Wifiota + +**Description of your project**: Buy and sell data from your android device with WiFi direct paired peers through a generated hotspot. Transactions occur via the IOTA tangle and Flash Channels. + +**Link to demo of project**: https://tobywoerthle.github.io/flashWiFiSite/ + +**Type of Project**: Peer to Peer Payments + +**Any further comments**: +GitHub - https://github.com/DanielPollithy/flashwifi + +**Submisison Form**: +https://docs.google.com/forms/d/e/1FAIpQLSe28W7jk-y4iEd8kN0mznk7oEs6ZtxQNL49R6tpc4bGN04UBA/viewform diff --git a/app/src/main/java/com/flashwifi/wifip2p/iotaAPI/Requests/WalletAddressChecker.java b/app/src/main/java/com/flashwifi/wifip2p/iotaAPI/Requests/WalletAddressChecker.java index 617d633..63337c2 100644 --- a/app/src/main/java/com/flashwifi/wifip2p/iotaAPI/Requests/WalletAddressChecker.java +++ b/app/src/main/java/com/flashwifi/wifip2p/iotaAPI/Requests/WalletAddressChecker.java @@ -21,8 +21,11 @@ public class WalletAddressChecker { private Context context; private String prefFile; - boolean containsPendingTransaction = false; - boolean keyIndexChanged = false; + private boolean containsPendingTransaction = false; + private boolean keyIndexChanged = false; + private int keyIndex; + private String nextAddress; + public WalletAddressChecker(Context inContext, String inPrefFile){ @@ -62,11 +65,13 @@ public class WalletAddressChecker { } } + + public List getAddress(String seed) { Boolean foundAddress = false; List addressList = new ArrayList<>(); - int keyIndex = getKeyIndex(); + keyIndex = getKeyIndex(); ArrayList hashStringList = new ArrayList<>(); while(foundAddress == false){ @@ -102,6 +107,7 @@ public class WalletAddressChecker { if(transactionsForAddress == null || transactionsForAddress.isEmpty() || (transactionsForAddress.size() == 0)){ //Transactions not found, use this address + nextAddress = addressResponse.getAddresses().get(0); foundAddress = true; } else{ @@ -151,6 +157,14 @@ public class WalletAddressChecker { return addressList; } + public int getNextKeyIndex(){ + return keyIndex; + } + + public String getNextAddress(){ + return nextAddress; + } + private int getKeyIndex() { SharedPreferences sharedPref = context.getSharedPreferences(prefFile, Context.MODE_PRIVATE); int keyIndex = sharedPref.getInt("keyIndex",0);