• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Sequence of the program running

I am running a fragment that as you switch to it, it queries a MySQL database and populates a spinner.
On choosing an item in the spinner and then pressing a button, I want it to again query the database and extract info corresponding to the item selected.
However, it seems to complete all the steps in the setOnClickListener method first before it returns the results from the query, whose call is also included in the setOnClickListener method.

Below is my method, as well as the code that does the querying of the database.

This is in the onCreateView method and does the initial retrieving of records to populate the spinner.
Code:
if (getUserVisibleHint()) {
    GetTrainingVideosMySql getTrainingVideosMySql = new GetTrainingVideosMySql();
    getTrainingVideosMySql.execute("");
}

This following code also in the oncreateView method, and is when an item has been selected in the spinner, and now the button has been pressed. The objective is to again query the database, set the class string called fileUrl, and then use this fileUrl in vw.setVideoPath(fileUrl):
Code:
btnFetch.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
        fileUrl = "";
        GetVideoUrlMySql getVideoUrl = new GetVideoUrlMySql();
        getVideoUrl.execute("");
        vw.setVideoPath(fileUrl);
        vw.start();
    }
});

Below is the method that does the extracting of the information required of the database:
Code:
private class GetVideoUrlMySql extends AsyncTask<String, Void, String> {
    String fileLocation = "";
    @Override
    protected void onPreExecute() {
        super.onPreExecute();
    }

    @Override
    protected String doInBackground(String... params) {
        try {
            Class.forName("com.mysql.jdbc.Driver");
            Connection con = DriverManager.getConnection(url, user, pass);

            Statement st = con.createStatement();
            ResultSet rs = st.executeQuery("SELECT url FROM training.training_videos WHERE id = 1");
            ResultSetMetaData rsmd = rs.getMetaData();

            while (rs.next()) {
                fileLocation = rs.getString(1).toString() + "\n";
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return fileLocation;
    }

    @Override
    protected void onPostExecute(String result) {
        fileUrl = fileLocation;
    }

The sequence that I would expect the program flow to take when the button is pressed, is first to get the file URL because of the statement getTrainingVideosMySql.execute(""), which sets fileUrl, then use this fileUrl string as the video required.
Instead, it responds to the button click and runs the method setOnClickListener.
It first sets fileUrl to an empty string, then goes to "protected void onPreExecute()" in "private class GetVideoUrlMySql", then sets the video url to this empty string, tries to start the video, then the doInBackground method, then the onPostExecute method.

I need the onPostExecute method to complete and then set this fileUrl to the video needed before trying to start the video.

Sorry if all confusing how I've explained it.

Help Radio Band Changed while trip abroad

Hi,

my girlfriend runs an German Sony Xperia X Compact on Android 8.0.0.

She traveled for three months in the US and now her phone worked well until it suddenly stoped. Now its stuck on "radio band USA" (A guy at a reapair shop found that out with using *#*#4636#*#*) and she can't get back to the German network.

I tried the factory reset already but that didn't solve the problem.

Is there any other way?

I realy appreciate any help.

Cheers,
Julian

outgoing message sound

I have a new MOTOROLA G6 running pie9 software, outgoing message sound is a very low single beep meaning you need to look at screen for message sent. Using default message app, tried whatsapp and no change contacted Motorola support no resolution. Other forums report same issue phone reviews do not mention problem.

robsie:(

Kyocera Dura Force Pro 2 Bugs

So I'm a long time Kyocera Dura Force user. Love the phone but bought a new one in March from Verizon. Initially it was great then came the shove down your throat updates. Now my phone rings twice over itself, volume turns itself down, if I miss a call display shows I missed 2 calls from the same caller at the same time. Got replacement phone that does the same thing. Verizon tier 3 support duplicated the issue on their same phone. I constantly miss calls because volume turns itself down on ringer and text notifications. Verizon says software update issues since their phone did it too. Kyocera says nothing wrong. I sent my phone in with a video showing the problems, but nothing is wrong they say... Anyone elses Dura Force Pro 2 doing this?

[Game][Free] TriPeaks Solitaire Challenge

New vision of solitaire experience. Free and wide-platform tripeaks solitaire arena.

Everyone who likes tri peaks, pyramid, freecell, spider, diamond, klondike, mahjong and other classic free solitaire games will play the global TriPeaks solitaire challenge.

We have collected the best social tripeaks solitaire experience to bring it to you.

TriPeaks Solitaire Challenge is the most powerful global classic solitaire arena. Reach new skills, explore new powerups, collect gold and silver, reach achievements, open new tournaments, and become the TriPeaks Solitaire Champion of the World!!

Features:
- excellent QHD graphics
- thrilling sound effects
- the game is superior balanced and is completely free, but if you wish, you can buy some packs to boost your experience
- all-in-one friends integration: once connected to the Facebook, you will get not only super boost to your max hearts amount, but more friends for the competition
- additionally, every your friend can help you with a hearts every hour 24/7.
- different card types reflect your preferred options

Solitaire Tournaments:
- Classic Tripeaks Solitaire Tournament: challenge The Globe every day! Here you will find solitaire masters of your level.
- World Challenge Tournament: the most extreme tripeaks solitaire arena you had before. New conditions, new competitors, new prizes every day!
- Facebook Tripeaks Tournament: challenge your friends and keep them in touch of your success.

Some tips:
- use bonuses to boost your score. For example, taking the Timer Freeze Powerup before you play, you will get more time to play and more time bonus score in case to clear the all game field. And taking the Joker Card powerup, you get the wildcard that beat any other one.
- some levels are quite complicated, but all of them are real, don't give up!
- make fast combinations, Quick Hand is your friend on the way to high score
- clean up all the cards, every cleaned Tower card will give you 10000 bonus points
- keep the deck as full as possible, every card there is your bonus points, but upgraded Joker powerup will get you ever more bonus score
- play fast, time is your score points too
- play smart, be the Solitaire Champion!

Invite as many friends as you can to get more fun and more challenge.

Thank you for joining us and welcome to our TriPeaks Solitaire Challenge club!

Download from Google Play: TriPeaks Solitaire Challenge


1.jpg
2.jpg
3.jpg
4.jpg

Whatsapp phishing attempt

This morning I've had two texts allegedly from Whatsapp with a code for 2 factor authentication. The first was from a UK mobile (cell) number, and the second had a Whatsapp logo displayed by the text message. Naturally I deleted both of them as I don't use Whatsapp, and it's not installed on my phone.

I also had a voice calll saying '"Your Authorization code is 999999" with no clue what it was referring to. I blocked the number.

As 2FA is coming to UK banks and other online transactions soon, be aware of these ,maybe not so obvious, scam calls and texts.

After flashing twrp recovery phone is stuck at (set warranty bit :recovery)

I tried to root my Samsung galaxy on7 sm-g600fy using Odin
After flashing tar.md5 I tried to boot the phone into twrp recovery mode to flash SuperSU but it is not opening twrp recovery mode instead it is stuck at
(set warranty bit:recovery) .on top of screen
..
(Samsung galaxy on7 ) in middle

(Powered by Android) in the bottom

If someone can help please help me to get root access o my device

Default keyboard Galaxy Tab A

Can't seem to change default keyboards on my Galaxy Tab A. I'm Seeking a keyboard with a DEL key, like Google's or Swiftkey. Can't find a path in SETTINGS to change away from SAMSUNG. Web searching says to go to PHONE SETTINGS which don't apply of course.

I have the Google keyboard app downloaded but don't see a way to implement it.

I'd much appreciate some help here.

Should I repair my smartphone or buy a new one?

I have a Lenovo Vibe K5 Note 32 GB, 3GB RAM bought on Nov 2015 running on Android Marshmallow. I formatted & reset it 9 months ago as the performance was slow. Now I have 2 GB Space left. Still there is occasional lag in using the smartphone. The phones camera lens cover lost its glue & has detached from phone. The volume up key sometimes won't work & needs to be pressed hard. Also there are black spots on pictures taken with camera. Should I repair this smartphone or buy a new one?
Is it worth waiting for Android 10 smartphones?

Accessories Wired earbud sound quality......

Blows compared to bluetooth earbuds. Both are AKG. What gives?

Anyone else notice this? I'm an audiophile thus I take my music quality very seriously. Usually I've found bluetooth buds lack the punch and crispness of high quality playback.

The exact opposite is true with the earbuds that came with the phone and the AKG BT buds I bought. Strange indeed.
.

Link to my local_manifest.xml files for a bunch of custom rom builds from source

For any compilers on google devices that may struggle with local_manifest.xml files for custom rom makers such as Bootleggers, DU etc I have created a repo of my local_manifest files as well as some bash scripts I put together cause im just lazy and would rather not set my build env up cmd by cmd.

git clone https://github.com/Centurion83/local_manifest.xml.git

Live Video to TV

Hi all!

I'm using the default app and device to go from the phone to HDMI. It's all working as expected.... except....

The Android bar is displaying during the video. I've turned it off accidentally once, but every time I start it up it comes back up and I can't figure out what I did. :D

Hopefully someone has run into this before.

Here's an image of the bar I'm talking about

Thanks!

Phil

Attachments

  • PhoneBar2.jpg
    PhoneBar2.jpg
    53.4 KB · Views: 133

MHL Question

I'd like to connect my LG L56VL phone to my TV, but the PHONE does not support MHL. My TV has an MHL port, but the phone does not support MHL.

So am I correct that because my phone doesn't support MHL, I can't use EITHER a passive cable connection OR an active MHL/HDMI adapter to connect my phone to the TV?

I think that's right, but want to be sure.

How to recover deleted videos if not saved on cloud

I deleted some important videos from my phone is it possible to recover them using any way .I tried app disk drigger but it asks to root my device for getting videos back . Does this app really works
I also tried Dr fone using laptop but it is not recovering any deleted video. There is pro version of these apps which has to be purchased , I want to know that does these apps pro version works. ??
How does these apps works to recover deleted data????

Need solution to casting to smart tv

So I am trying to cast or mirror screen my J7 crown to my smart tv. I do not have internet at my home and I know that limits what I can do. I used to use my moble hotspot to connect my smart tv to and I was able to cast threw that but my mobile carrier has shut my hotspot off. I have tried to connect my phone to the tv with a USB and my tv doesn't show anything under the usb setting almost like it cant see it. I made sure usb file transfer was on. So my question is how can I get my phone to stream to my TV so I can watch Netflix or downloaded movies. Any help would be great, thank you.

Filter

Back
Top Bottom