diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index c0567b3dbe..6b60d95412 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1,27 +1,27 @@
-
-
-
-
-
-
-
+ package="com.quran.labs.androidquran" android:versionCode="1"
+ android:versionName="1.0">
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
-
-
+
+
\ No newline at end of file
diff --git a/gen/com/quran/labs/androidquran/R.java b/gen/com/quran/labs/androidquran/R.java
index 313b28a398..a8dc080baa 100644
--- a/gen/com/quran/labs/androidquran/R.java
+++ b/gen/com/quran/labs/androidquran/R.java
@@ -11,43 +11,72 @@ public final class R {
public static final class attr {
}
public static final class drawable {
- public static final int icon=0x7f020000;
- public static final int list=0x7f020001;
- public static final int splash=0x7f020002;
+ public static final int about=0x7f020000;
+ public static final int icon=0x7f020001;
+ public static final int jump=0x7f020002;
+ public static final int list=0x7f020003;
+ public static final int settings=0x7f020004;
+ public static final int splash=0x7f020005;
}
public static final class id {
- public static final int bgPageview=0x7f050004;
- public static final int cancelButton=0x7f050001;
- public static final int jumpButton=0x7f050002;
- public static final int pageScrollView=0x7f050006;
- public static final int page_field=0x7f050000;
- public static final int pageview=0x7f050005;
- public static final int splashview=0x7f050007;
- public static final int surarow=0x7f050003;
+ public static final int bgPageview=0x7f06000b;
+ public static final int btnAboutBack=0x7f060005;
+ public static final int btnEmailUs=0x7f060006;
+ public static final int cancelButton=0x7f060008;
+ public static final int chkArbaicNames=0x7f06000e;
+ public static final int chkHideTitle=0x7f06000f;
+ public static final int jumpButton=0x7f060009;
+ public static final int linear=0x7f060000;
+ public static final int menu_item_about_us=0x7f060012;
+ public static final int menu_item_jump=0x7f060011;
+ public static final int menu_item_settings=0x7f060013;
+ public static final int pageScrollView=0x7f06000d;
+ public static final int page_field=0x7f060007;
+ public static final int pageview=0x7f06000c;
+ public static final int splashview=0x7f060010;
+ public static final int surarow=0x7f06000a;
+ public static final int txtAbout=0x7f060001;
+ public static final int txtCopyRights=0x7f060004;
+ public static final int txtDevelopedBy=0x7f060003;
+ public static final int txtSupport=0x7f060002;
}
public static final class layout {
- public static final int jump_to=0x7f030000;
- public static final int quran_error=0x7f030001;
- public static final int quran_list=0x7f030002;
- public static final int quran_row=0x7f030003;
- public static final int quran_view=0x7f030004;
- public static final int splash_screen=0x7f030005;
+ public static final int about_us=0x7f030000;
+ public static final int jump_to=0x7f030001;
+ public static final int quran_error=0x7f030002;
+ public static final int quran_list=0x7f030003;
+ public static final int quran_row=0x7f030004;
+ public static final int quran_view=0x7f030005;
+ public static final int settings=0x7f030006;
+ public static final int splash_screen=0x7f030007;
+ }
+ public static final class menu {
+ public static final int option_menu=0x7f050000;
}
public static final class string {
+ public static final int aboutUs=0x7f040015;
public static final int app_name=0x7f040001;
- public static final int cancel=0x7f04000e;
+ public static final int cancel=0x7f040010;
+ public static final int copyRights=0x7f040012;
+ public static final int developedBy=0x7f040011;
public static final int downloadPrompt=0x7f040003;
public static final int downloadPrompt_no=0x7f040005;
public static final int downloadPrompt_ok=0x7f040004;
public static final int downloadPrompt_title=0x7f040002;
public static final int downloading_message=0x7f040007;
public static final int downloading_title=0x7f040006;
+ public static final int email_subject=0x7f040013;
+ public static final int email_to=0x7f040014;
public static final int errorString=0x7f040000;
public static final int extracting_message=0x7f040009;
public static final int extracting_title=0x7f040008;
- public static final int go=0x7f04000d;
- public static final int jump_dialog_title=0x7f04000b;
+ public static final int go=0x7f04000f;
+ public static final int hide_title=0x7f040017;
+ public static final int jump_dialog_title=0x7f04000d;
+ public static final int menu_about=0x7f04000b;
public static final int menu_jump=0x7f04000a;
- public static final int page_hint=0x7f04000c;
+ public static final int menu_settings=0x7f04000c;
+ public static final int page_hint=0x7f04000e;
+ public static final int use_arabic_names=0x7f040016;
}
}
diff --git a/res/drawable/about.png b/res/drawable/about.png
new file mode 100644
index 0000000000..fabc1fcb13
Binary files /dev/null and b/res/drawable/about.png differ
diff --git a/res/drawable/jump.png b/res/drawable/jump.png
new file mode 100644
index 0000000000..34dc4c04e2
Binary files /dev/null and b/res/drawable/jump.png differ
diff --git a/res/drawable/settings.png b/res/drawable/settings.png
new file mode 100644
index 0000000000..1cfeb8e6a9
Binary files /dev/null and b/res/drawable/settings.png differ
diff --git a/res/layout/about_us.xml b/res/layout/about_us.xml
new file mode 100644
index 0000000000..dd06c7d878
--- /dev/null
+++ b/res/layout/about_us.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/res/layout/settings.xml b/res/layout/settings.xml
new file mode 100644
index 0000000000..732405adde
--- /dev/null
+++ b/res/layout/settings.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
diff --git a/res/menu/option_menu.xml b/res/menu/option_menu.xml
new file mode 100644
index 0000000000..a5a210bebf
--- /dev/null
+++ b/res/menu/option_menu.xml
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 42fa596e8e..6f14d48396 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1,20 +1,34 @@
- Could not download Quran Pages!
- Quran
- Download Required Files?
- For optimal performance, some files must be downloaded to the sd card.
- If you choose not to do this now, each page will take significantly longer to load. Would you
- like to download the required files now?
- Yes
- No
- Downloading...
- Please wait for the files to download.
- Processing...
- Please wait the files are processed.
- Jump
- Jump To Page
- Page Number
- Go
- Cancel
+ Could not download Quran Pages!
+ Quran Android
+ Download Required Files?
+ For optimal performance, some files must be
+ downloaded to the sd card.
+ If you choose not to do this now, each page will take significantly
+ longer to load. Would you
+ like to download the required files now?
+ Yes
+ No
+ Downloading...
+ Please wait for the files to download.
+ Processing...
+ Please wait the files are processed.
+ Jump
+ About Us
+ Settings
+ Jump To Page
+ Page Number
+ Go
+ Cancel
+ Quran Android - Muslim Developers
+ Copy Rights - All Muslims
+ Feedback
+ quran.android@gmail.com
+ Quran Android is a free, open source Quran
+ application for Android.\nUpcoming features include:\n- Bookmarks.\n-
+ Translations.\n- Search.\n- And more..\n\nLa tansawna men saleh el
+ doaa.
+ Use arabic names
+ Full Screen Mode.\nHave a larger view area for pages.
diff --git a/src/com/quran/labs/androidquran/AboutUsActivity.java b/src/com/quran/labs/androidquran/AboutUsActivity.java
new file mode 100644
index 0000000000..da2abd5430
--- /dev/null
+++ b/src/com/quran/labs/androidquran/AboutUsActivity.java
@@ -0,0 +1,61 @@
+package com.quran.labs.androidquran;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.text.method.ScrollingMovementMethod;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.Button;
+import android.widget.TextView;
+
+public class AboutUsActivity extends Activity implements OnClickListener {
+ protected Button btnBack;
+ protected Button btnEmailUs;
+ protected TextView txtDevelopedBy;
+ protected TextView txtCopyRights;
+ protected TextView txtAbout;
+
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.about_us);
+ btnBack = (Button)findViewById(R.id.btnAboutBack);
+ btnBack.setOnClickListener(this);
+
+ btnEmailUs = (Button)findViewById(R.id.btnEmailUs);
+ btnEmailUs.setOnClickListener(this);
+
+ txtDevelopedBy = (TextView)findViewById(R.id.txtDevelopedBy);
+ txtDevelopedBy.setOnClickListener(this);
+
+ txtCopyRights = (TextView)findViewById(R.id.txtCopyRights);
+ txtCopyRights.setOnClickListener(this);
+
+ txtAbout = (TextView)findViewById(R.id.txtAbout);
+ txtAbout.setMovementMethod(new ScrollingMovementMethod());
+
+ if (getWindowManager().getDefaultDisplay().getHeight() <
+ getWindowManager().getDefaultDisplay().getWidth())
+ txtAbout.setMaxLines(6);
+ else
+ txtAbout.setMaxLines(16);
+ }
+
+ @Override
+ public void onClick(View v) {
+ switch (v.getId()) {
+ case R.id.btnAboutBack:
+ finish();
+ break;
+ case R.id.btnEmailUs:
+ final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
+ emailIntent.setType("plain/text");
+ emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, getString(R.string.email_subject));
+ emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{getString(R.string.email_to)});
+ startActivity(Intent.createChooser(emailIntent, "Send mail..."));
+ break;
+ default:
+ break;
+ }
+ }
+}
diff --git a/src/com/quran/labs/androidquran/QuranActivity.java b/src/com/quran/labs/androidquran/QuranActivity.java
index 4c8f9d5971..24c132fa62 100644
--- a/src/com/quran/labs/androidquran/QuranActivity.java
+++ b/src/com/quran/labs/androidquran/QuranActivity.java
@@ -12,6 +12,7 @@
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
+import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.ListView;
@@ -20,6 +21,7 @@
import com.quran.labs.androidquran.common.ApplicationConstants;
import com.quran.labs.androidquran.common.QuranInfo;
import com.quran.labs.androidquran.util.QuranScreenInfo;
+import com.quran.labs.androidquran.util.QuranSettings;
public class QuranActivity extends ListActivity {
@@ -28,6 +30,7 @@ public class QuranActivity extends ListActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.quran_list);
+ QuranSettings.load(getSharedPreferences(ApplicationConstants.PREFERNCES, 0));
Intent i = new Intent(this, QuranDataActivity.class);
this.startActivityForResult(i, ApplicationConstants.DATA_CHECK_CODE);
@@ -39,7 +42,10 @@ public void onConfigurationChanged(Configuration newConfig) {
}
public void onActivityResult(int requestCode, int resultCode, Intent data){
- if (requestCode == ApplicationConstants.DATA_CHECK_CODE){ showSuras(); }
+ if (requestCode == ApplicationConstants.DATA_CHECK_CODE
+ || requestCode == ApplicationConstants.SETTINGS_CODE) {
+ showSuras();
+ }
}
@Override
@@ -64,20 +70,27 @@ public void onCancel(DialogInterface dialog) {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
- MenuItem item;
- item = menu.add(0, ApplicationConstants.JUMP_MENU_ID, 0, R.string.menu_jump);
- item.setIcon(android.R.drawable.ic_menu_set_as);
+ MenuInflater inflater = getMenuInflater();
+ inflater.inflate(R.menu.option_menu, menu);
return true;
}
@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
+ Intent intent;
switch (item.getItemId()){
- case ApplicationConstants.JUMP_MENU_ID:
- showDialog(ApplicationConstants.JUMP_DIALOG);
+ case R.id.menu_item_jump:
+ showDialog(ApplicationConstants.JUMP_DIALOG);
+ break;
+ case R.id.menu_item_about_us:
+ intent = new Intent(getApplicationContext(), AboutUsActivity.class);
+ startActivity(intent);
+ break;
+ case R.id.menu_item_settings:
+ intent = new Intent(getApplicationContext(), SettingsActivity.class);
+ startActivityForResult(intent, ApplicationConstants.SETTINGS_CODE);
break;
}
-
return super.onMenuItemSelected(featureId, item);
}
@@ -85,7 +98,7 @@ private void showSuras(){
ArrayList< Map > suraList =
new ArrayList< Map >();
for (int i=0; i<114; i++){
- String suraStr = (i+1) + ". Surat " + QuranInfo.SURA_NAMES[i];
+ String suraStr = (i+1) + ". " + QuranInfo.getSuraTitle() + " " + QuranInfo.getSuraName(i);
Map map = new HashMap();
map.put("suraname", suraStr);
suraList.add(map);
diff --git a/src/com/quran/labs/androidquran/QuranViewActivity.java b/src/com/quran/labs/androidquran/QuranViewActivity.java
index 6e2acc3fab..d9788b6cd6 100644
--- a/src/com/quran/labs/androidquran/QuranViewActivity.java
+++ b/src/com/quran/labs/androidquran/QuranViewActivity.java
@@ -24,6 +24,7 @@
import com.quran.labs.androidquran.R;
import com.quran.labs.androidquran.common.QuranInfo;
import com.quran.labs.androidquran.util.QuranScreenInfo;
+import com.quran.labs.androidquran.util.QuranSettings;
import com.quran.labs.androidquran.util.QuranUtils;
public class QuranViewActivity extends Activity implements AnimationListener {
@@ -51,6 +52,11 @@ public class QuranViewActivity extends Activity implements AnimationListener {
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
+ if (QuranSettings.getInstance().isHideTitle()) {
+ requestWindowFeature(Window.FEATURE_NO_TITLE);
+ getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
+ WindowManager.LayoutParams.FLAG_FULLSCREEN);
+ }
setContentView(R.layout.quran_view);
@@ -175,8 +181,8 @@ private String getPageFileName() {
}
private void showPage(){
- String title = "Quran, page " + page +
- " - [Surat " + QuranInfo.getSuraNameFromPage(page) + "]";
+ String title = QuranInfo.getPageTitle() + page +
+ " - [" + QuranInfo.getSuraTitle() + " " + QuranInfo.getSuraNameFromPage(page) + "]";
setTitle(title);
String filename = getPageFileName();
diff --git a/src/com/quran/labs/androidquran/SettingsActivity.java b/src/com/quran/labs/androidquran/SettingsActivity.java
new file mode 100644
index 0000000000..64418c058e
--- /dev/null
+++ b/src/com/quran/labs/androidquran/SettingsActivity.java
@@ -0,0 +1,46 @@
+package com.quran.labs.androidquran;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.CompoundButton.OnCheckedChangeListener;
+
+import com.quran.labs.androidquran.common.ApplicationConstants;
+import com.quran.labs.androidquran.util.QuranSettings;
+
+public class SettingsActivity extends Activity implements OnCheckedChangeListener {
+ protected CheckBox chkArabicNames;
+ protected CheckBox chkHideTitle;
+ private QuranSettings settings;
+
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.settings);
+ settings = QuranSettings.getInstance();
+ chkArabicNames = (CheckBox)findViewById(R.id.chkArbaicNames);
+ chkArabicNames.setOnCheckedChangeListener(this);
+ chkHideTitle = (CheckBox)findViewById(R.id.chkHideTitle);
+ chkHideTitle.setOnCheckedChangeListener(this);
+ loadSettings();
+ }
+
+ private void loadSettings() {
+ chkArabicNames.setChecked(settings.isArabicNames());
+ chkHideTitle.setChecked(settings.isHideTitle());
+ }
+
+ @Override
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+ switch (buttonView.getId()) {
+ case R.id.chkArbaicNames:
+ settings.setArabicNames(isChecked);
+ break;
+ case R.id.chkHideTitle:
+ settings.setHideTitle(isChecked);
+ break;
+ }
+ QuranSettings.save(getSharedPreferences(ApplicationConstants.PREFERNCES, 0));
+ }
+
+}
diff --git a/src/com/quran/labs/androidquran/common/ApplicationConstants.java b/src/com/quran/labs/androidquran/common/ApplicationConstants.java
index fbd7aec563..8674432ea4 100644
--- a/src/com/quran/labs/androidquran/common/ApplicationConstants.java
+++ b/src/com/quran/labs/androidquran/common/ApplicationConstants.java
@@ -1,15 +1,17 @@
package com.quran.labs.androidquran.common;
-import android.view.Menu;
public class ApplicationConstants {
// activity codes
public static final int DATA_CHECK_CODE = 1;
+ public static final int SETTINGS_CODE = DATA_CHECK_CODE + 1;
// dialogs
public static final int JUMP_DIALOG = 1;
- // menu options
- public static final int JUMP_MENU_ID = Menu.FIRST;
+ // Settings Key
+ public static final String PREFERNCES = "QuranAndroid_Settings";
+ public static final String USE_ARABIC_NAMES = "useArabicNames";
+ public static final String HIDE_TITLE = "hideTitle";
}
diff --git a/src/com/quran/labs/androidquran/common/QuranInfo.java b/src/com/quran/labs/androidquran/common/QuranInfo.java
index a210b7f139..f1e9e23cba 100644
--- a/src/com/quran/labs/androidquran/common/QuranInfo.java
+++ b/src/com/quran/labs/androidquran/common/QuranInfo.java
@@ -1,5 +1,7 @@
package com.quran.labs.androidquran.common;
+import com.quran.labs.androidquran.util.QuranSettings;
+
public class QuranInfo {
public static String[] SURA_NAMES = {
@@ -27,6 +29,43 @@ public class QuranInfo {
"An-Nas"
};
+ public static String[] SURA_NAMES_AR = {
+ "الفاتحة", "البقرة", "آل عمران", "النساء", "المائدة",
+ "اﻷنعام", "اﻷعراف", "اﻷنفال", "التوبة", "يونس", "هود",
+ "يوسف", "الرعد", "إبراهيم", "الحجر", "النحل", "اﻹسراء",
+ "الكهف", "مريم", "طه", "اﻷنبياء", "الحج", "المؤمنون",
+ "النور", "الفرقان", "الشعراء", "النمل", "القصص",
+ "العنكبوت", "الروم", "لقمان", "السجدة", "اﻷحزاب", "سبأ",
+ "فاطر", "يس", "الصافات", "ص", "الزمر", "غافر",
+ "فصلت", "الشعراء", "الزخرف", "الدخان", "الجاثية",
+ "الحاقة", "محمد", "الفتح", "الحجرات", "ق",
+ "الذاريات", "الطور", "النجم", "القمر", "الرحمن",
+ "الواقعة", "الحديد", "المجادلة", "الحشر", "الممتحنة",
+ "الصف", "الجمعة", "المنافقون", "التغابن", "الطلاق",
+ "التحريم", "الملك", "القلم", "الحاقة", "المعارج", "نوح",
+ "الجن", "المزمل", "المدثر", "القيامة", "اﻹنسان",
+ "المرسلات", "النبأ", "النازعات", "عبس", "التكوير",
+ "الانفطار", "المطففين", "الانشقاق", "البروج", "الطارق",
+ "اﻷعلى", "الغاشية", "الفجر", "البلد", "الشمس",
+ "الليل", "الضحى", "الشرح", "التين", "العلق", "القدر",
+ "البينة", "الزلزلة", "العاديات", "القارعة", "التكاثر",
+ "العصر", "الهمزة", "الفيل", "قريش", "الماعون", "الكوثر",
+ "الكافرون", "النصر", "المسد", "اﻹخلاص", "الفلق",
+ "الناس"
+ };
+
+ public static String getSuraTitle() {
+ return QuranSettings.getInstance().isArabicNames() ? "سورة" : "Surat";
+ }
+
+ public static String getSuraName(int index) {
+ return QuranSettings.getInstance().isArabicNames() ? SURA_NAMES_AR[index] : SURA_NAMES[index];
+ }
+
+ public static String getPageTitle() {
+ return QuranSettings.getInstance().isArabicNames() ? "القرآن الكريم، صفحة " : "Quran, page ";
+ }
+
public static int[] SURA_PAGE_START = {
1, 2, 50, 77, 106, 128, 151, 177, 187, 208, 221, 235, 249, 255, 262,
267, 282, 293, 305, 312, 322, 332, 342, 350, 359, 367, 377, 385, 396,
@@ -42,9 +81,9 @@ public class QuranInfo {
public static String getSuraNameFromPage(int page){
for (int i = 0; i < 114; i++){
if (SURA_PAGE_START[i] == page)
- return SURA_NAMES[i];
+ return getSuraName(i);
else if (SURA_PAGE_START[i] > page)
- return SURA_NAMES[i-1];
+ return getSuraName(i-1);
}
return "";
}
diff --git a/src/com/quran/labs/androidquran/util/QuranSettings.java b/src/com/quran/labs/androidquran/util/QuranSettings.java
new file mode 100644
index 0000000000..71f1b5a7fc
--- /dev/null
+++ b/src/com/quran/labs/androidquran/util/QuranSettings.java
@@ -0,0 +1,53 @@
+package com.quran.labs.androidquran.util;
+
+import android.content.SharedPreferences;
+import android.content.SharedPreferences.Editor;
+
+import com.quran.labs.androidquran.common.ApplicationConstants;
+
+
+public class QuranSettings {
+
+ private static QuranSettings instance = new QuranSettings();
+ private boolean arabicNames = false;
+ private boolean hideTitle = false;
+
+ private QuranSettings() {
+
+ }
+
+ public static QuranSettings getInstance(){
+ return instance;
+ }
+
+ public boolean isArabicNames() {
+ return arabicNames;
+ }
+
+ public void setArabicNames(boolean useArabicNames) {
+ this.arabicNames = useArabicNames;
+ }
+
+
+
+ public boolean isHideTitle() {
+ return hideTitle;
+ }
+
+ public void setHideTitle(boolean hideTitle) {
+ this.hideTitle = hideTitle;
+ }
+
+ public static void load(SharedPreferences preferences) {
+ instance.arabicNames = preferences.getBoolean(ApplicationConstants.USE_ARABIC_NAMES, false);
+ instance.hideTitle = preferences.getBoolean(ApplicationConstants.HIDE_TITLE, false);
+ }
+
+ public static void save(SharedPreferences preferences) {
+ Editor editor = preferences.edit();
+ editor.putBoolean(ApplicationConstants.USE_ARABIC_NAMES, instance.arabicNames);
+ editor.putBoolean(ApplicationConstants.HIDE_TITLE, instance.hideTitle);
+ editor.commit();
+ }
+
+}
diff --git a/src/com/quran/labs/androidquran/util/QuranUtils.java b/src/com/quran/labs/androidquran/util/QuranUtils.java
index aa5d2e51f0..530d04d4df 100644
--- a/src/com/quran/labs/androidquran/util/QuranUtils.java
+++ b/src/com/quran/labs/androidquran/util/QuranUtils.java
@@ -16,7 +16,7 @@ public class QuranUtils {
public static boolean failedToWrite = false;
public static String IMG_HOST = "http://labs.quran.com/androidquran/";
- private static String QURAN_BASE = "/quran/";
+ private static String QURAN_BASE = "/quran_android/";
public static boolean debugRmDir(String dir, boolean deleteDirectory){
File directory = new File(dir);