gosh sorry for being such a noob, I just have a few questions. I would love to use this, however I want to use it for mp3s instead of videos.
Now im assuming I can just change line
Using java Syntax Highlighting
if(lVideoFile.endsWith("3gp") || lVideoFile.endsWith("mp4"))
Parsed in 0.031 seconds, using
GeSHi 1.0.8.4
to
Using java Syntax Highlighting
if(lVideoFile.endsWith("mp3"))
Parsed in 0.030 seconds, using
GeSHi 1.0.8.4
right?
So i have a few more noob questions cause I really dont know that much about java but im trying to make my first app. I am using eclipse, and this is my current code:
Using java Syntax Highlighting
public class SyncActivity extends Activity implements OnClickListener {
Button buttonSync, buttonBrowseMusicPhone;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
buttonSync = (Button)findViewById(R.id.buttonSync);
buttonBrowseMusicPhone = (Button)findViewById(R.id.buttonBrowseMusicPhone);
// Define button listeners
buttonBrowseMusicPhone.setOnClickListener(this);
}
@Override
public void onClick(View src) {
switch(src.getId()) {
case R.id.buttonBrowseMusicPhone:
public void FindVideosInSdcard(String aDirectoryName)
{
iCurrentPath = iCurrentPath + "/" + aDirectoryName;
File lFile = new File(iCurrentPath);
String[] lTotalFiles = lFile.list();
for(int i = 0; i < lTotalFiles.length; i++)
{
File lTempFile = new File(iCurrentPath + "/" + lTotalFiles[i]);
if(lTempFile.isDirectory())
{
lTempFile = null;
FindVideosInSdcard(lTotalFiles[i]);
}
else
{
String lVideoFile = iCurrentPath + "/" + lTotalFiles[i];
if(lVideoFile.endsWith("3gp") || lVideoFile.endsWith("mp4"))
{
iAllFilePaths.add(lVideoFile);
}
}
lTempFile = null;
}
String lTemp = "/" + aDirectoryName;
int lEnd = iCurrentPath.indexOf(lTemp);
if(lEnd != -1)
iCurrentPath = iCurrentPath.substring(0, lEnd);
lFile = null;
}
break;
}
// TODO Auto-generated method stub
}
}
Parsed in 0.041 seconds, using
GeSHi 1.0.8.4
So ive called my buttons so I can use them, however eclipse gives me errors with " FindVideosInSdcard" "iCurrentPath" and "iAllFilePaths"
im assuming I have to call those just like I did with my buttons "buttonBrowseMusicPhone" but I just dont really understand what "FindVideosInSdcard" and all that other stuff.
Hopefully you understand what im trying to get across.
Thanks for the help guys!!