Apps Please help!

c0dered22

Newbie
I am creating an android apps for our research project and we are having a problem in creating a core function of creating new xml file when the user chooses "new project".
Is this function is possible?
 

shredcode

Newbie
When you are within eclipse, you are attempting to create a new android project and you are receiving an error?

What is the error you are seeing in the console, or in a dialog box?
 

c0dered22

Newbie
Thread starter
um I mean is when the user clicks the new project on our application a core function activates that create new xml file.
 

out of ideas

Android Enthusiast
youre being way too vague.

so on the phone an end user would click a button and make an xml file?

why not have a premade xml and fill it with the data you need in there?

again you'd have to explain a lot better cuz this is just stabs in the dark.
 

c0dered22

Newbie
Thread starter
Oh sorry for that.

Okay I will explain it.

Our apps is called "VN MAKER".

A development apps that let the user create a Visual Novel.

The thing is we don't know what to do in creating new project and we are thinking

of creating new xml file as a body of the "New Project" I am talking.

And then when the user chooses the "New Project" a new XML file will be created as

the body of the "New Project" of "VN Maker"

And my problem is, I don't have an idea how can I put it in codes or s it really possible to creat that function.
 

out of ideas

Android Enthusiast
So like they could write their own novel thing? like taking a new note?

If it's something like that, then just put a blank xml page in the app, with an EditText box they can type in. that way, when they pick new project, it will open up a blank page they can add to as they see fit.
 

c0dered22

Newbie
Thread starter
thanks for the idea, but can I have another question.

Is there any function that a user can add Image by just clicking a button?

It's like you can browse a certain database folder and then chose image from that database and add it on the project.
 

out of ideas

Android Enthusiast
Yup. I'll give ya some code for a head start

Code:
 else if (item.getTitle().toString().equalsIgnoreCase("Pick an image")) {
            Intent i = new Intent(Intent.ACTION_PICK,
                    android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI);
      
                startActivityForResult(i, IMAGE);
            Toast.makeText(this, "your Screenshots are here", Toast.LENGTH_LONG).show();
                    }
        return true;
        
    }
    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      super.onActivityResult(requestCode, resultCode, data);

      if(resultCode==RESULT_OK && requestCode==IMAGE){
       Uri selectedImage=data.getData();
       String path=getPath(selectedImage);

       Bitmap bitmapImage=BitmapFactory.decodeFile(path);
//this part puts it on a imageview
       ImageView image=(ImageView)findViewById(R.id.image);
       image.setImageBitmap(bitmapImage);

      }
    }

    public String getPath(Uri uri){
      String[] filePathColumn={MediaStore.Images.Media.DATA};

      Cursor cursor=getContentResolver().query(uri, filePathColumn, null, null, null);
      cursor.moveToFirst();
      int columnIndex=cursor.getColumnIndex(filePathColumn[0]);

      return cursor.getString(columnIndex);
    }
I use that to let people use their gallery to pick an image off their sdcard and set it to an imageview.

play around with it a little and you can get them them to pull it out of a drawable folder.

you got lucky I had Eclipse open ;)
 

c0dered22

Newbie
Thread starter
I have another question.
How can I add music.
for example.
If the button is pressed it can add music in the file. like on the earlier question that is about image.
 
Top