Have started to develop my first "real" original app for android using android studio, so I'm still extremely new to it, though i have experience in java. My app involves using a QR code scanner and using what it outputs(the specific use will be with bitcoin addresses).
I'm having real problems integrating the QR code scanner, honestly i don't really care right know whether it's called using an intent or I'm using the libraries internally, i just really want to do it the easiest way. My problem is i really don't understand how to import the packages and what not, and i have a really hard time finding detailed explanations on how to do this online.
The ideal way would be to press a button, open the scanner, when you then have scanned a code it will go to another activity where you can maybe view the output and then have choices to what you want to do with it.
here is my main activity if you can use it for anything:
package com.JunkerDevBlog.bitcoinaddresssender;
import android.content.Intent;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBar;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.os.Build;
import android.widget.Button;
import android.widget.EditText;
public class MainActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new PlaceholderFragment())
.commit();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
public void scan(View view) {
Intent intent = new Intent(this, ScanActivity.class);
startActivity(intent);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
/**
* A placeholder fragment containing a simple view.
*/
public static class PlaceholderFragment extends Fragment {
public PlaceholderFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_main, container, false);
return rootView;
}
}
}
Also i'm using android studio, help is GREATLY appreciated.