My source is Oracle Database. One of my source columns is having data as shown below. I should search for contact: and get the 14 characters for all occurrences.

Source Column data:

contact:"abcd"/Location:"India"/contact:"efgh"/Gender:"Male"/contact:"ijkl"/email:"ijkl@gmail.com"

and so on....

Required output:

contact:"abcd",contact:"efgh",contact:"ijkl"

Im trying to detect if the audio and video is in sync on a live stream in an Android Device. I assume both audio and video must have a timestamp(I might be wrong, please advise). Is there any way by which I can detect if the audio and video are in sync, or can someone please redirect me from where I have to start.

Will it be possible if we could access the data from the media buffer before the video gets rendered?

If i have a submenu which has three option: Create New,Update ,Manage data . what would be the best way ? create new activity for all these? create fragments? or send intent message after menu item is clicked and use if statement ?

I want to show interstitial ads on my app's splash screen. But my admob gets error 3 with low fill rate I tried facebook audience network but my placement get blocked due to policy violation Is there any alternative or way to show fb ads on splash screen?

I have an html/css/js code with which one can design a background for your phone. It works perfectly in the browser, also on my phone, just not when I try to run it using WebView. I uploaded the scripts to a server, everything works, just when I try to use the input type="color", the app crashes. Why is this? Does the android WebView not support input type="color"? If I can fix it, any help would be appreciated! Thanks!

This is the code used to create the webView (Java, inside the onCreate() method):

WebView webView = (WebView)findViewById(R.id.webView);
webView.getSettings().setJavaScriptEnabled(true);
webView.setWebViewClient(new WebViewClient());
webView.getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NORMAL);
webView.loadUrl("https://www.grasserfamily.at/OverDesign/home.html");

I am currently facing an issue in my android app when trying to search and replace a string.

I receive a sentence which contain the keyword ${keyword} it's coming like Today we are ${keyword} and it is beautiful I have to parse it and replace ${keyword} by a specific string

below is my code:

const val PATTERN_TO_FIND = "\${keyword}"

private val keywordRegex = Regex(ContentfulTranslations.PATTERN_TO_FIND)

fun replaceMyKeyword(sentence: String): String{
    return sentence.replace(keywordRegex, "blabla")
}

The app keeps crashing when parsing the sentence and looking for the pattern.

I already use this method and it used to work but the pattern to find wasn't formatted as ${keyword}

Any idea?

Thanks

I have this React Native component displayed in a Modal:

<KeyboardAvoidingView style={modalStyle.container}>
                <View style={modalStyle.topBlock}>
                </View>
                <View style={modalStyle.dialog}>
                    <Text style={modalStyle.text}>Introduceti numele documentului</Text>
                    <TextInput placeholder="exemplu"></TextInput>
                </View>
                <View style={modalStyle.bottomBlock}>
                </View>
            </KeyboardAvoidingView>

Here is the style that I am using for this component:

container: {
        backgroundColor: "rgba(0,0,0,0.6)",
        flex:1
    },
    topBlock: {
        flex:25
    },
    dialog: {
        backgroundColor: "white",
        flex:40
    },
    bottomBlock:{
        flex:35
    },

    text: {
        paddingTop: 30,
        paddingBottom: 50,
        fontSize: 24,
        marginLeft: 20,
        fontFamily: "Roboto",
    }
}

The problem is that when the keyboard pops up,the view doesn't move upwards. I've put some texts in those 2 empty views to better see what is going on and apparently, those 2 don't get moved by the keyboard at all. The only change is in the height (or probably padding) of the dialog view as it can be seen from the screeenshots below

Obviously I don't want my View to shrink, but to move upwards, so what should I do? Thanks in advance!

Modal without keyboard

Modal with keyboard

I have a horizontal ListView in my flutter app, it loads data from Firebase Cloud Firestore. Each item has its own unique id. What I want to do is when the user scrolls, I want to update a Firestore document with the id of the ListView item in focus. Is there any way to do it?

Note:- I tried using ScrollController and adding a listener to it. When I do this either the document never updates or there is a big delay of up to 5 seconds. The code I tried is below:-


class HomeTabState extends State<HomeTab> with SingleTickerProviderStateMixin {

  ScrollController _scrollController;

  @override
  void initState() {
    super.initState();
    _scrollController = ScrollController();
    _scrollController.addListener(updateSelectedApp);
  }

  void updateSelectedApp() {
    var value = _scrollController.offset.round();
    var appIndex = (value / 200).round();
    Firestore.instance.collection("status").document(this.widget.user.uid).setData({
      "appsSection": {
        "isActive": true,
        "selectedAppId": this.widget.apps[appIndex].id,
      }
    }, merge: true);
  }

  ...

}

Я создал 2 item в RecyleView. На этих item кнопки play(воспроизведение аудиофайла). Есть код который проверят MediaPlayer, меняет иконки плэй на паузу и тд. Но так как у меня 2 item этот код я вписываю каждый и при воспроизведении звуков у меня запускается отдельных два плеера не связанных между собой.

Как мне сделать один общий плеер на все item ?

Пытался вписать данный код в Адаптер. пробовал сделать отдельный класс с MediaPlayer, тоже не получилось.

Код плеера:

       '''private void playAndStop(final View btn, int rawID) {

            // проверяем играет ли что-то сейчас
            if (!answerAboutPlay) { // если нет
                lastBtn = (Button) btn; // в переменную ПоследняяКнопка запоминаем нажатую
                mp = MediaPlayer.create(context, rawID); // запускаем нужный трэк (передается из кейса)
                mp.start();

                mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
                    @Override
                    public void onCompletion(MediaPlayer mp) {
                        btn.setSelected(false);
                        answerAboutPlay = false;
                    }
                });

                answerAboutPlay = true; // ставим переменную играет или нет в Да
                btn.setSelected(true); // меняем значёк на паузу (реализовано через селектор)

            } else { // если да

                stopPlaying(); // останавливаем то, что играет

                // проверяем какая кнопка была нажата последней (для того, чтобы просто остановить трэк или еще и запустить другой)
                if (lastBtn == btn) { // если эта (лежит в переменной ПоследняяКнопка)

                    answerAboutPlay = false; //  ставим переменную играет или нет в Нет
                    btn.setSelected(false); // меняем значёк на плэй
                } else { // если не эта

                    lastBtn.setSelected(false); // меняем значек последней нажатой кнопки (её трэк играет) на плэй

                    mp = MediaPlayer.create(context, rawID); // запускаем нужный трэк (передается из кейса)
                    mp.start();

                    mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
                        @Override
                        public void onCompletion(MediaPlayer mp) {
                            btn.setSelected(false);
                            answerAboutPlay = false;
                        }
                    });

                    answerAboutPlay = true; // ставим переменную играет или нет в Да
                    btn.setSelected(true); // меняем значёк на паузу (у нажатой кнопки)
                    lastBtn = (Button) btn; // в переменную ПоследняяКнопка запоминаем нажатую
                }
            }

        }

'''

Вызов метода:

''' private void ShowP(View v,int position ){

            v.setSelected(answerAboutPlay);

            switch (position) {
                case 0:
                    playAndStop(v,R.raw.play1);
                    break;

}

'''

Когда вывожу в отдельный файл выводит ошибку: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference

When activity+fragment are recreated on rotation the toolbar menu is inflated properly in the fragment, but then gets cleared mysteriously.

I've traced the toolbar.getMenu().size() through all of the seemingly relevant functions and it seems to get set (and stay set) perfectly fine. The last log that runs is in my activity's onPostCreate where I have to reset the toolbar title. I thought the menu item might just be set to invisible in some way, but I check the size again when another action is done, and it has dropped to 0.

The menu item is there before rotation, but gone after, despite being inflated again in my fragment's onActivityCreated and the log (up until activity onPostCreate) showing size() = 1.

"I have selected specific area(100m radius) in google map through CircleOption method in android studio.i have only center coordinates i want to restrict that area But first i have to store such area in Database.what should i store in Database? e.g Coordinates or area."

somebody has converted meters into coordinates. I have tried few solution but i am still confused

Currently what I am doing is that there is a seekbar on top of the imageView. It is free to slide. Left part is the original image and right part is the processed image. There is another seekbar to control the brightness but it should not affect the processed image.

I have tried this link: A “Before And After” Image Comparison Slide Control in Android But no luck

I follow the above link to define the seekbar like following but not working:

private SeekBar seekBar;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


        ImageView myImageView = findViewById(R.id.image);
        myImageView.setImageResource(R.drawable.flowers);

        seekBar = (SeekBar) findViewById(R.id.seekBar1);

        seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

            int progress = 0;

            @Override

            public void onProgressChanged(SeekBar seekBar, int progresValue, boolean fromUser) {
                FrameLayout target = (FrameLayout) findViewById(R.id.target);

                progress = progresValue;

                ViewGroup.LayoutParams lp = target.getLayoutParams();
                lp.height = progress;
                target.setLayoutParams(lp);

            }

            @Override
            public void onStartTrackingTouch(SeekBar seekBar) {

            }

            @Override
            public void onStopTrackingTouch(SeekBar seekBar) {

            }
        });

i have two tables below

table_a with columns (id, table_bId, name, address, postcode, allowedPermisions)

table_b with columns (id, type, level, info)

I want to create a migration strategy as we now supposed to store the allowedPermissions data in table_b instead

Here is what i tried:

UPDATE table_a, table_b
SET table_a.allowedPermissions = table_b.allowedPermissions 
WHERE table_b.id=table_a.table_bId;

I get a syntax error after UPDATE table_a, (saw an example here saying you can update more than one table?)

I then tried another approach by creating the new column allowedPermissions using

ALTER TABLE table_b
ADD COLUMN allowedPermissions TEXT

But how do i copy contents of allowedPermissions in table_a to table_b in sqlite?

How can I create a dynamic SQLite format for users to create and delete database columns

For example, let's say on the activity screen it is initially:

Trial 1:   Input 1   Input 2

But after an "add row" button is clicked it adds another row like below

Trial 1:   Input 1   Input 2
Trial 2:   Input 1   Input 2

But if the user wanted to delete the second row, it would go back to the initial state. I added images at the bottom to sort of show what I mean.

I only started learning how to use Android Studio so I was thinking that I can just set the original SQLite entities to have 20 Columns, assuming that two columns would represent each input of each trial and also assuming that they wouldn't do anything beyond 10 trials. But since I don't know how many trials the user would input, if the user were to have more than 10, it would be a problem.

Would this be right? Or is there a way for the "add row" button click to dynamically add two extra columns in the database for each input. Or would I need two different databases that save each input to each database with the same ID and get the values through same primary key id? Here are images:

Initially:

Image 1

After button click:

Image 2

I want to test a production app from android in a local network server with a self signed certificate. In order to do that in iOS I can add the certificate to the device and it will be trusted so I can use the app with that server.

When I add it using the Wifi->Advance->Install Certificate in most devices the app won´t work.

The only one where it works is a MIUI (Android 6.0.1) device wich is rooted. Is it a requierement to be rooted to be able to trust a certificate?

I am trying to fetch some images from my google dive into my android application. what is the simplest way

I am working on a project where clients are able to create objects in a database. Each of these objects has a description string that describes the object. Let's assume we are looking at an object that represents a car:

  • A red car manufactured by BMW with 62000 miles
  • A pickup-truck manufactured by Dodge from 2010
  • A car with 5 seats

The "car" class has different attributes, and not all of them are mandatory. For example:

  • type of car: car, sedan, pickup truck, SUV
  • mileage
  • brand
  • seats
  • year
  • number of previous owners

The description sentence should contain this information. E.g. if we know the number of seats, this information should be part of the sentence, otherwise it shouldn't. If we would do this in one language only, this is not too complicated. We just need to analyze the structure of the sentence and compose the sentence as follows:

A [{color}] {type of car} [manufactured by {brand name}] [with {miles} miles] [from {year}] [with {seats} seats}

parts in [....] are only part of the final sentence if the attribute (in {...}) is set.

However, this project needs to support several languages and we need a fast way of translating this. This means, that we can't just translate "manufactured by" and all the other elements of the sentence in all different languages, and then compose the sentence with the same structure. Different languages might have a very different sentence structure. Obviously, we could translate each combination of elements separately, but the effort of that is quickly getting to high, as the number of combinations can be huge (we have objects with 10 or more attributes).

What is the recommended way of dealing with this kind of scenario?

The project is implemented in Ruby on Rails, so I am ideally looking for a library that supports this.

I am a security engineer who is having to make a developmental recommendation to a provider of a least privilege solution. Their solution runs as SYSTEM but I've found a privilege escalation and a bypass for their software and I need to explain how to do two things in C++.

I need to explain how to detect attempted killing of the window/process and I need to detect if the current binary being executed has been renamed. Could someone explain programatically how this would look in VC++?

Thanks.

This question already has an answer here:

how do I find out the wrong line of plist files without having to manually search for android studio.

I have a lot of data on the plist file so it doesn't allow me to do it manually to find out where my mistakes are, please help me

I have done a piece of code that works well in swift, but I don't find the same thing in Objective C.

func playPDF(pdfPath: String!)
{
    let phrase: String? = nil // Document password (for unlocking most encrypted PDF files)
    let document = ReaderDocument.withDocumentFilePath(pdfPath, password: phrase)
    if document != nil {
        readerViewController = ReaderViewController(readerDocument: document)
        readerViewController!.delegate = self as ReaderViewControllerDelegate
        readerViewController!.navBar = self.navBar
        addChild(readerViewController!)
        readerViewController!.view.frame = self.view.frame
        view.addSubview(readerViewController!.view)
        readerViewController!.didMove(toParent: self)
    } else {
        print("\(#function) [ReaderDocument withDocumentFilePath:'\(pdfPath ?? "")' password:'\(phrase ?? "")'] failed.")
    }
}

I would like to convert that piece of Swift in Objective C to allow me to get all the characterics from a viewController readerViewController to the active one without any effort.

Thanks in advance.