هل تريد التفاعل مع هذه المساهمة؟ كل ما عليك هو إنشاء حساب جديد ببضع خطوات أو تسجيل الدخول للمتابعة.


 
الرئيسيةجستجوأحدث الصورثبت نامورود

 

 mobile settings access????

اذهب الى الأسفل 
2 مشترك
نويسندهپيام
rasty




تعداد پستها : 3
Registration date : 2007-09-22

mobile settings access???? Empty
پستعنوان: mobile settings access????   mobile settings access???? Icon_minitimeالسبت سبتمبر 22, 2007 3:12 am

Besmela,
mano bebaxshid azizan ke ba hrofe latin minevisam,
baad az tashakor az modirane een forum aziz,
dears i am trying to write a midlet which can access the setting and configurations of mobile handsets,like insert,update or deleting the APNs or sms center numbers...and any other setting in any category.could you help?
so i appreciate all the replys, and very thanx to mr hamed and greetings from kurdistan-iraq.
loves
بازگشت به بالاي صفحه اذهب الى الأسفل
Admin
Admin
Admin


تعداد پستها : 455
Location : Linux
Registration date : 2007-08-28

mobile settings access???? Empty
پستعنوان: پاسخ   mobile settings access???? Icon_minitimeالسبت سبتمبر 22, 2007 12:58 pm

سلام دوست عزیزم. سلام من و تمامی و اعضای فروم را به تمامی دوستانمان در کردستان عراق برسانید.
در پاسخ به سوال شما باید بگم که در j2me امکان دستیابی به phonebook و اطلاعات شخصی کاربر موبایل به صورت گسترده وجود ندارد زیرا که جاوا بر پایه حفظ امنیت بنا نهاده شده.به فرض مثال شما به سادگی امکان دستیابی به phonebook را ندارید و مثلا به سادگی نمی توانید اس ام اس های پیش دریافت شده را مشاهده نمایید. انجمن jcp یک jsr به شماره 75 منتشر کرده که اجازه udateو delete و read کردن از phonebook را میدهد در حالی که این api در همه گوشی های موبایل ساپورت نمی شود و هنوز فراگیر نشده اما مثلا با یک تکنیک ساده برنامه نویسی و با استفاده از یک textbox قادر به فقط خواندن از phonebook خواهید بود به مثال زیرکه با استفاده از همان jsr75 است توجه نمایید:


JSR75 provides facility of accessing native database like contacts, events and to-dos of phone.

The example below lists the contacts from phone book and on selection prints the phone number of selected contact.

import java.io.*;
import java.util.*;
import javax.microedition.io.*;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
import javax.microedition.pim.*;

public class ContactMIDlet extends MIDlet implements CommandListener {

private final Form form;
private final Display display;
private final Command exitCommand, findCommand;
private TextField number;

public ContactMIDlet() {

findCommand = new Command("Find Contacts", Command.OK, 0);
exitCommand = new Command("Exit", Command.EXIT, 1);
form = new Form("Contact");
form.addCommand(findCommand);
form.addCommand(exitCommand);
form.setCommandListener(this);
display = Display.getDisplay(this);

}


public void startApp() {

Displayable current = Display.getDisplay(this).getCurrent();

if (current == null) {

// check that the API is available
boolean isAPIAvailable =(System.getProperty(
"microedition.pim.version") != null);

StringBuffer sbuf = new StringBuffer(
getAppProperty("MIDlet-Name"));

sbuf.append("\n").append(getAppProperty("MIDlet-Vendor")).
append(isAPIAvailable?"":"\nPIM API not available");

Alert alertScreen = new Alert(null, sbuf.toString(), null,
AlertType.INFO);

alertScreen.setTimeout(3000);

if (!isAPIAvailable) {
display.setCurrent(splashScreen);
} else {
display.setCurrent(form);
}
} else {
Display.getDisplay(this).setCurrent(current);
}
}

public void pauseApp(){}

public void destroyApp(boolean unconditional){}

void showMessage(String message, Displayable displayable) {

Alert alert = new Alert("");
alert.setTitle("Error");
alert.setString(message);
alert.setType(AlertType.ERROR);
alert.setTimeout(5000);
display.setCurrent(alert, displayable);

}

void showMain() {
display.setCurrent(form);
}

void showContactsList() {
display.setCurrent(new ContactListForm(ContactMIDlet.this));
}


void contactSelected(String telephoneNumber) {
this.setPhoneNumber(telephoneNumber);
showMain();
}

void setPhoneNumber(String phoneNumber) {
number = new TextField("Contact","",20,TextField.PHONENUMBER);
number.setString(phoneNumber);
form.append(number);
}

public void commandAction(Command cmd, Displayable displayable) {

if (cmd == exitCommand) {
notifyDestroyed();
} else if (cmd == findCommand) {
showContactsList();
}
}
}

import java.util.*;
import javax.microedition.lcdui.*;
import javax.microedition.pim.*;

class ContactListForm extends List implements CommandListener {

private final Command exitCommand, selectCommand, backCommand;
private final ContactMIDlet parent;
private boolean available;
private Vector allTelNumbers = new Vector();

public ContactListForm(ContactMIDlet parent) {

super("Contacts", Choice.IMPLICIT);
this.parent = parent;
selectCommand = new Command("Select", Command.OK, 0);
backCommand = new Command("Back", Command.BACK, 1);
exitCommand = new Command("Exit", Command.EXIT, 1);
addCommand(backCommand);
addCommand(exitCommand);
setCommandListener(this);
setFitPolicy(Choice.TEXT_WRAP_ON);

LoadContacts l = new LoadContacts();

}

public void commandAction(Command cmd, Displayable displayable) {

// if no names are available return
if (!available) {
parent.showMain();
return;
} else if (cmd == selectCommand) {
int selected = getSelectedIndex();
if (selected >= 0) {
parent.contactSelected(
(String) allTelNumbers.elementAt(selected));
} else {
parent.showMain();
}
} else if (cmd == backCommand) {
parent.showMain();
} else if (cmd == exitCommand) {
parent.notifyDestroyed();
}

}


// loads the names of a named contact list
private void loadNames(String name)
throws PIMException, SecurityException {

ContactList contactList = null;
try {
contactList = (ContactList) PIM.getInstance()
.openPIMList(PIM.CONTACT_LIST, PIM.READ_ONLY, name);

// First check that the fields we are interested in
// are supported by the PIM List
if (contactList.isSupportedField(Contact.FORMATTED_NAME)
&& contactList.isSupportedField(Contact.TEL)) {

setTitle("Contacts");
Enumeration items = contactList.items();
delete(0);
Vector telNumbers = new Vector();

while (items.hasMoreElements()) {

Contact contact = (Contact) items.nextElement();
int telCount = contact.countValues(Contact.TEL);
int nameCount = contact.countValues(
Contact.FORMATTED_NAME);

if (telCount > 0 && nameCount > 0) {
String contactName =contact.getString(
Contact.FORMATTED_NAME, 0);

for (int i = 0; i < telCount; i++) {

int telAttributes =
contact.getAttributes(Contact.TEL, i);

String telNumber =
contact.getString(Contact.TEL, i);

telNumbers.addElement(telNumber);
allTelNumbers.addElement(telNumber);

}

// insert elements in the list in order
for (int i = 0; i < telNumbers.size(); i++) {

append(contactName+ ": "+
telNumbers.elementAt(i), null);
}

telNumbers.removeAllElements();
}
}

available = true;

} else {

append("Contact list required items not supported", null);
available = false;
}
} finally {

// always close it
if (contactList != null) {
contactList.close();
}
}
}

private class LoadContacts implements Runnable {

public LoadContacts() {
new Thread(this).start();
}

public void run() {

try {

String[] allContactLists =
PIM.getInstance().listPIMLists(PIM.CONTACT_LIST);

if (allContactLists.length != 0) {
for (int i = 0; i < allContactLists.length; i++) {
loadNames(allContactLists[i]);
}
addCommand(selectCommand);
} else {
append("No Contact lists available", null);
available = false;
}

} catch (PIMException e) {

parent.showMessage(e.getMessage(), ContactListForm.this);
available = false;

} catch (SecurityException e) {

parent.showMessage(e.getMessage(), ContactListForm.this);
available = false;

}
}
}
}
بازگشت به بالاي صفحه اذهب الى الأسفل
http://j2me.blogfa.com
rasty




تعداد پستها : 3
Registration date : 2007-09-22

mobile settings access???? Empty
پستعنوان: رد: mobile settings access????   mobile settings access???? Icon_minitimeالسبت سبتمبر 22, 2007 10:34 pm

thank you for your being involved...
and thank you for your answer... i promise to go with your way and help your forum as i can as i am software engineer and my main pro lang was java.
dear your answer is clear and there is no doubt in java's security restriction..but let me make it clear for you...
to provide subscribers of a mobile company with services like mms,gprs and other stuffs..
currently the Over-the-air (OTA) is used for these purpose..but it makes some troubles for short-message-center (SMSC) and it gets so busy with provisioning by sending and recieving confirmations to provide the configurations for mobile types...rather than its normal issue which is transfering peoples normal smsing.so a midlet ,i need to provide subscribers to download once and run it to continue delet-update-insertion of infos like
wap gateway,mms center,smscenter which are numbers and address everyone must define in his own mobile to us services..
sorry for taking your time..
but mor than your forum.. i want to be your friend if you accept and have your id in messenger.
thank you for your greetings...
بازگشت به بالاي صفحه اذهب الى الأسفل
Admin
Admin
Admin


تعداد پستها : 455
Location : Linux
Registration date : 2007-08-28

mobile settings access???? Empty
پستعنوان: پاسخ   mobile settings access???? Icon_minitimeالإثنين سبتمبر 24, 2007 2:52 am

سلام . دوست عزیز این فروم یک فروم فارسی است . لطفا فقط به زبان فارسی و نه انگلیسی و نه فینگلیش پست کنید.
ضمن تشکر از شفاف سازی موضوع باید بگم که این تنظیمات به صورت پیش فرض توسط Service Provider اعمال می شوند و نیازی به تنظیم دستی آنها نیست.حداقل در ایران که اینطور است. و اینکه من اطلاعاتی در مورد چگونگی retrive کردن این اطلاعات از گوشی توسط جاوا ندارم اما مطمئنا با یک جستجوی ساده در دکتر گوگل به نتایجی دست خواهید یافت.من هم بدنبال جواب خواهم گشت و در صورت یافتن آن در همین تاپیک منتشر خواهم کرد...موفق باشید.
بازگشت به بالاي صفحه اذهب الى الأسفل
http://j2me.blogfa.com
 
mobile settings access????
بازگشت به بالاي صفحه 
صفحه 1 از 1
 مواضيع مماثلة
-
» Mobile camera
» Pocket PC vs. Mobile
» Mobile book howto

صلاحيات هذا المنتدى:شما نمي توانيد در اين بخش به موضوعها پاسخ دهيد
 :: سوال و جواب-
پرش به: