Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

181
Views
How to open an Android app with its package name in javascript/react?

I'm currently creating a react app that needs to be able to launch any app on an Android device by specifying its package name. I tried using the react-open-app library to no avail, and I don't think i'd be able to use deep links considering I don't want to open a specific activity, but feel free to prove me wrong- Any help would be appreciated. Here is my code:

import OpenApp from "https://cdn.skypack.dev/react-open-app";

class CheckList extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      inputValue: '',
      apps: [
      ],
    };
  }
  
  addApp() {
    if (this.state.inputValue!=='') {
      this.setState({
        apps: this.state.apps.concat(this.state.inputValue),
        inputValue: ''
      });
    }
  }
  removeApp(app) {
    this.setState({
      apps: this.state.apps.filter((apps) => apps !== app)
    });
  }
  updateInputValue(evt) {
    this.setState({inputValue: evt.target.value});
  }

  render() {
    const apps = this.state.apps;
    const applaunch = apps.map((app) => {
      return (
        <li key={app}>
          <button onClick={() => this.removeApp(app)}>-</button>
          <OpenApp android={app}>{app}</OpenApp>
        </li>
      );
    });
    
    return (
      <div classname="checklist">
        <ul>
          {applaunch}
          <li>
            <button onClick={() => this.addApp()}>+</button>
            <input value={this.state.inputValue} onChange={evt => this.updateInputValue(evt)} placeholder="app link"/>
          </li>
        </ul>
      </div>
    );
  }
}

ReactDOM.render(<CheckList />, document.getElementById("root"));

And the OpenApp tries to open whatever I feed into it as an url, which makes sense since it's meant to use deep links, but means I am, as of now, pretty clueless as to what I should do.

Any ideas for me?

Thanks!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!