Related
Listview a bir eleman eklemek istiyorum ancak olmuyor.
İlk elemanı ekliyor. Ardından textbox temizleniyor. Daha sonra textbox a bir veri giriyorum ve ekle butonuna basıyorum ancak eklnen veri listview da gösterimiyor. Nerede hata ypıyorum?
private List<Person> list = new List<Person>();
private void btnInsert_Click_1(object sender, RoutedEventArgs e)
{
list.Add(new Person { Name = txtBox.Text });
if (list != null)
lstData.ItemsSource = list;
txtBox.Text = string.Empty;
}
Ok, I dont know android programming ...
But I'm trying to find what the problem with the USSD.
Only with running a "logcat-b radio," and using USSD code on GSM,
The logcat show me if supports but does not display the results.
Code:
04-20 14:03:54.256 1409 1409 D RILJ : [0717]> SEND_USSD *10#
04-20 14:03:54.256 1197 1284 I RIL-MAIN: onReq: reqCode = 29, dataLen = 4
04-20 14:03:54.256 1197 1286 I RIL-MX : Ch0 > 0533AT+CUSD=1,*10#,0
04-20 14:03:54.256 1197 1286 I RIL-MX :
04-20 14:03:54.287 1197 1285 I RIL-MX : Read Ch0 << 0533+CUSD:eek:K
04-20 14:03:54.287 1409 1545 D RILJ : [0717]< SEND_USSD
04-20 14:03:54.342 1409 1409 D RILJ : [0718]> SET_MUTE false
04-20 14:03:54.342 1197 1284 I RIL-MAIN: onReq: reqCode = 53, dataLen = 4
04-20 14:03:54.342 1197 1286 I RIL-MX : Ch1 > 0534AT+CMUT=0
04-20 14:03:54.365 1197 1285 I RIL-MX : Read Ch1 << 0534+CMUT:eek:K
04-20 14:03:54.365 1409 1545 D RILJ : [0718]< SET_MUTE
04-20 14:03:54.592 1197 1285 I RIL-MX : Read Ch0 << 0294~+RSSI=0,15,99,99,0,0,0
04-20 14:03:54.599 1409 1409 D GSM : handleMessage what 12
04-20 14:03:55.334 1197 1285 I RIL-MX : Read Ch0 << 0295~+CREG=1,7,297D,00008D73,0,0,0,0,0,0
04-20 14:03:55.334 1409 1545 D RILJ : [UNSL]< UNSOL_RESPONSE_NETWORK_STATE_CHANGED
04-20 14:03:55.334 1409 1409 D GSM : handleMessage what 2
04-20 14:03:55.342 1409 1409 D RILJ : [0719]> OPERATOR
04-20 14:03:55.349 1197 1284 I RIL-MAIN: onReq: reqCode = 22, dataLen = 0
04-20 14:03:55.349 1197 1286 I RIL-MX : Ch0 > 0535AT+COPS?
04-20 14:03:55.365 1409 1409 D RILJ : [0720]> GPRS_REGISTRATION_STATE
04-20 14:03:55.373 1197 1285 I RIL-MX : Read Ch0 << 0535+COPS=0,COL MOV / TIGO,TIGO COL,732103
04-20 14:03:55.373 1409 1545 D RILJ : [0719]< OPERATOR {COL MOV / TIGO, TIGO COL, 732103}
04-20 14:03:55.381 1197 1284 I RIL-MAIN: onReq: reqCode = 21, dataLen = 0
04-20 14:03:55.381 1197 1286 I RIL-MX : Ch0 > 0536AT+CGREG?
04-20 14:03:55.381 1197 1286 I RIL-MX :
04-20 14:03:55.381 1409 1409 D RILJ : [0721]> REGISTRATION_STATE
04-20 14:03:55.388 1197 1284 I RIL-MAIN: onReq: reqCode = 20, dataLen = 0
04-20 14:03:55.388 1409 1409 D RILJ : [0722]> QUERY_NETWORK_SELECTION_MODE
04-20 14:03:55.388 1197 1284 I RIL-MAIN: onReq: reqCode = 45, dataLen = 0
04-20 14:03:55.388 1409 1409 D GSM : handleMessage what 6
04-20 14:03:55.412 1197 1285 I RIL-MX : Read Ch0 << 0536+CGREG=1,7,297D,00008D73,0
04-20 14:03:55.412 1197 1286 I RIL-MOD : onReqComp: Ch0 process reqCode = 20
04-20 14:03:55.412 1197 1286 I RIL-MX : Ch0 > 0537AT+CREG?
04-20 14:03:55.412 1409 1545 D RILJ : [0720]< GPRS_REGISTRATION_STATE {1, 297d, 8d73, 2, 0}
04-20 14:03:55.412 1409 1409 D GSM : handleMessage what 5
04-20 14:03:55.451 1197 1285 I RIL-MX : Read Ch0 << 0537+CREG=1,7,297D,00008D73,0,0,0,0,0,0
04-20 14:03:55.451 1197 1286 I RIL-MOD : onReqComp: Ch0 process reqCode = 45
04-20 14:03:55.451 1197 1286 I RIL-MX : Ch0 > 0538AT+COPSM?
04-20 14:03:55.451 1409 1545 D RILJ : [0721]< REGISTRATION_STATE {1, 297d, 8d73, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
04-20 14:03:55.451 1409 1409 D GSM : handleMessage what 4
04-20 14:03:55.490 1197 1285 I RIL-MX : Read Ch0 << 0538+COPSM=0
04-20 14:03:55.490 1409 1545 D RILJ : [0722]< QUERY_NETWORK_SELECTION_MODE {0}
04-20 14:03:55.490 1409 1409 D GSM : handleMessage what 14
04-20 14:03:55.490 1409 1409 D GSM : Network selection mode = false
04-20 14:03:55.490 1409 1409 D GSM : Poll ServiceState done: oldSS=[0 home domestic COL MOV / TIGO TIGO COL 732103 EDGE CSS not supported -1 -1RoamInd: -1DefRoamInd: -1EmergOnly: false] newSS=[0 home domestic COL MOV / TIGO TIGO COL 732103 EDGE CSS not supported -1 -1RoamInd: -1DefRoamInd: -1EmergOnly: false] oldGprs=0 newGprs=0 oldType=EDGE newType=EDGE
04-20 14:03:58.646 1197 1285 I RIL-MX : Read Ch0 << 0296~+CUSD=0,15,SALDO:$180.50;BONO:$0.00,0+0minTigo,0+0+0minOtroOpdr,35smsTigo,0smsToDes,0minTigoNoche,0minOtroNoche,0minFavorito,0minDia,0minCUG
04-20 14:03:58.654 1409 1545 D RILJ : [UNSL]< UNSOL_ON_USSD 0
04-20 14:03:58.693 1197 1285 I RIL-MX : Read Ch0 << 0297~+CUSD=2,15,SALDO:$180.50;BONO:$0.00,0+0minTigo,0+0+0minOtroOpdr,35smsTigo,0smsToDes,0minTigoNoche,0minOtroNoche,0minFavorito,0minDia,0minCUG
04-20 14:03:58.693 1409 1545 D RILJ : [UNSL]< UNSOL_ON_USSD 2
The last two lines show the result that I should appear after executing the USSD.
But I always get the response of MMI complete
USSD does not work, you're limited to MMI only. Period. This device was not made with GSM in mind.
You're not the first (and not even in the first 10) person who tried to “fix” this.
Good luck if you have time to spare on this, I guess. Note that USSD processing is core Android functionality and you cannot just write an app which replaces these functions.
Try custom ROMs if you really need USSD.
I try a custom rom but still same problem...
the droid 3 has the same chip as the droid 2 global can run USSD codes.
I heard that it was a problem with not being supported in the baseband kernel. I doubt it is easily fixable.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
crDroid is designed to increase performance and reliability over stock Android for your device also attempting to bringing many of the best features existent today. It mainly based on CyanogenMod so use stuffs compatible with them.
Code:
#include
/*
* Your warranty is now void.
*
* I am not responsible for bricked devices,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at me for messing up your device, I will laugh at you.
*
All the source code for crDroid is available in the crDroid Github repo.
NOTE: This ROM is not yet tested.
First Installation
- Make sure you're running a proper working Recovery (CWM or TWRP)
- Copy crDroid zip to your SDCard
- Boot into Recovery
- DO A DATA WIPE / FACTORY RESET
- Flash crDroid zip
- Reboot
- Don't restore Apps using Titanium Backup!
Upgrading from earlier version of crDroid:
- Copy crDroid ZIP to your internal SDCard
- Boot into Recovery
- Flash crDroid zip
- Reboot
Download link :
BasketBuild: https://basketbuild.com/filedl/devs?dev=ramsudharsan&dl=ramsudharsan/surnia/crdroid-5.1.1-20150602-surnia.zip
Don't expect any support if you:
- are not running stock crDroid-kernel (the one which comes with the rom)
- have installed any mods such Xposed!
- have modified system files
XDA:DevDB Information
CrDroid Lollipop, ROM for the Moto E 2015
Contributors
#buzz, scritch007
ROM OS Version: 5.1.x Lollipop
ROM Kernel: Linux 3.10.x
ROM Firmware Required: Moto E 2nd Gen LTE, TWRP 2.8.x.x
Based On: CyanogenMod
Version Information
Status: Testing
Created 2015-06-03
Last Updated 2015-06-03
Reserved
Sources:
Device Tree: https://github.com/ramsudharsan/android_device_motorola_surnia/tree/crdroid-5.1
Other Trees: https://github.com/Motorola-CyanogenMod
Credits: @scritch007 - For his amazing work on CyanogenMod and AOSP ROMs.
Is this a unified build?
Sent from my XT1095
starkly_raving said:
Is this a unified build?
Sent from my XT1095
Click to expand...
Click to collapse
Yes. This is a unified build but for all surnia device. Otus has a completely different chipset (MSM8610) and this ROM doesn't suit with it.
Code:
assert(getprop("ro.product.device") == "XT1514" || getprop("ro.build.product") == "XT1514" || getprop("ro.product.device") == "XT1521" || getprop("ro.build.product") == "XT1521" || getprop("ro.product.device") == "XT1524" || getprop("ro.build.product") == "XT1524" || getprop("ro.product.device") == "XT1526" || getprop("ro.build.product") == "XT1526" || getprop("ro.product.device") == "XT1527" || getprop("ro.build.product") == "XT1527" || getprop("ro.product.device") == "XT1523" || getprop("ro.build.product") == "XT1523" || getprop("ro.product.device") == "surnia_uds" || getprop("ro.build.product") == "surnia_uds" || getprop("ro.product.device") == "surnia_umts" || getprop("ro.build.product") == "surnia_umts" || getprop("ro.product.device") == "surnia" || getprop("ro.build.product") == "surnia" || getprop("ro.product.device") == "surnia_udstv" || getprop("ro.build.product") == "surnia_udstv" || abort("This package is for device: XT1514,XT1521,XT1524,XT1526,XT1527,XT1523,surnia_uds,surnia_umts,surnia,surnia_udstv; this device is " + getprop("ro.product.device") + "."););
#buzz said:
Yes. This is a unified build but for all surnia device. Otus has a completely different chipset (MSM8610) and this ROM doesn't suit with it.
Code:
assert(getprop("ro.product.device") == "XT1514" || getprop("ro.build.product") == "XT1514" || getprop("ro.product.device") == "XT1521" || getprop("ro.build.product") == "XT1521" || getprop("ro.product.device") == "XT1524" || getprop("ro.build.product") == "XT1524" || getprop("ro.product.device") == "XT1526" || getprop("ro.build.product") == "XT1526" || getprop("ro.product.device") == "XT1527" || getprop("ro.build.product") == "XT1527" || getprop("ro.product.device") == "XT1523" || getprop("ro.build.product") == "XT1523" || getprop("ro.product.device") == "surnia_uds" || getprop("ro.build.product") == "surnia_uds" || getprop("ro.product.device") == "surnia_umts" || getprop("ro.build.product") == "surnia_umts" || getprop("ro.product.device") == "surnia" || getprop("ro.build.product") == "surnia" || getprop("ro.product.device") == "surnia_udstv" || getprop("ro.build.product") == "surnia_udstv" || abort("This package is for device: XT1514,XT1521,XT1524,XT1526,XT1527,XT1523,surnia_uds,surnia_umts,surnia,surnia_udstv; this device is " + getprop("ro.product.device") + "."););
Click to expand...
Click to collapse
I meant unified as in GSM LTE and CDMA LTE variants...but I found out. Thanks for responding though.
Sent from my XT1095
Question?
Does LTE work on CDMA variant of surnia moto e 2015 and how stable is this rom
No signal in xt1514
Sent from my XT1514 using XDA Free mobile app
Is the xt1514 CDMA? And anything about xt1526
Sent from my K011 using XDA Free mobile app
when i use the 'github repo ' link in the OP i end up with Blisspop github ? so it's crDroid or Blisspop ?
elix9000 said:
Is the xt1514 CDMA? And anything about xt1526
Click to expand...
Click to collapse
I'm getting no signal too, also using xt1514. Its GSM.
**for users in india**
It is very likely for indian users to break their recents app key
if that situations arise just change your time zone too somewhere west of GMT(-)
this will also solve the issue where GAPPS crash
i have problems with my project when i compile ,
this is the result
11-04 23:47:17.205 5524-5524/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
android.os.NetworkOnMainThreadException
at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1118)
at java.net.InetAddress.lookupHostByName(InetAddress.java:385)
at java.net.InetAddress.getAllByNameImpl(InetAddress.java:236)
at java.net.InetAddress.getAllByName(InetAddress.java:214)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:137)
at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:360)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:670)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:769)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:743)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:732)
at moodle.android.APLICACIONMOVILDECAMPUSVIRTUAL.General.TokenHttpRequest.doHTTPRequest(TokenHttpRequest.java:29)
at moodle.android.APLICACIONMOVILDECAMPUSVIRTUAL.General.Login.onClick(Login.java:138)
at android.view.View.performClick(View.java:4198)
at android.view.View$PerformClick.run(View.java:17158)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4918)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1004)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:771)
at dalvik.system.NativeStart.main(Native Method)
////////////////////////////////////////////////////////////////////////////
login class
public class Login extends Activity implements OnClickListener {
Button login;
EditText siteUrl, username, password;
User user;
SharedPreferences saved;
String loginDetails;
ProgressDialog dialog;
@override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.login);
try {
siteUrl = (EditText) findViewById(R.id.moodle_url);
username = (EditText) findViewById(R.id.username);
password = (EditText) findViewById(R.id.password);
login = (Button) findViewById(R.id.login_button);
try {
//
siteUrl.setHint(R.string.login_url_hint);
username.setHint(R.string.login_username_hint);
password.setHint(R.string.login_password_hint);
siteUrl.setText("https://uacjmoodle.milaulas.com");
username.setText("juan_guardado");
password.setText("Prueba123#");
} catch (Exception e) {
Log.e("NoPreferences", e.toString());
}
login.setOnClickListener(this);
} catch (Exception e) {
Log.e("Error With Login", e.toString());
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@override
public void onClick(View v) {
switch (v.getId()) {
case R.id.login_button:
dialog = ProgressDialog.show(this, "",
"Verificando Ususrio y Contraseña", true);
if (AppStatus.getInstance(Login.this).isOnline(Login.this)) {
String conType = AppStatus.getInstance(Login.this).getConnectionType(Login.this);
conType = conType == null ? "No hay cursos visibles" : conType;
Toast.makeText(getApplicationContext(), "Estas en linea (" + conType + ")!!!!", Toast.LENGTH_LONG).show();
} else {
messageHandler.sendEmptyMessage(0);
Toast.makeText(getApplicationContext(), "No tienes Internet!!!!", Toast.LENGTH_LONG).show();
}
String siteUrlVal = siteUrl.getText().toString();
String usr = username.getText().toString();
String pwd = password.getText().toString();
String usrUri = Uri.encode(usr);
String pwdUri = Uri.encode(pwd);
saved = getSharedPreferences(loginDetails, MODE_PRIVATE);
SharedPreferences.Editor e = saved.edit();
e.putString("siteUrlVal", siteUrlVal);
e.putString("usr", usr);
e.putString("pwd", pwd);
e.commit();
//moodle_mobile_app
String url = siteUrlVal + "/login/token.php?username=" + usrUri + "&password=" + pwdUri + "&rest";
//url = "https://uacjmoodle.milaulas.com/login/token.php?username=festrada&password=Profesor123!&service=&service=moodle_mobile_app";//&service=moodle_mobile_app
TokenHttpRequest tokenRequest = new TokenHttpRequest();
String token = tokenRequest.doHTTPRequest(url);
//se quito la llamada a tokenrequest y se le asigna el token manual
//se declara este tocken para acceder a la informacion del usuario festrada
//String token= "700c1d9f3af35836885b12a65a584e1e"; //acceder a la informacion del usuario festrada
if (token != null && token != "")
{
String serverurl = siteUrlVal + "/webservice/rest/server.php" + "?wstoken=" + token + "&wsfunction=";
user = new User();
user.setUsername(usr);
user.setPassword(pwd);
user.setToken(token);
user.setTokenCreateDate();
user.setUrl(url);
//AQUI SE MANDA LLAMAR A LA CLASE MOODLEWEBSERVICE
//PARA OBTENER LA INFORMACION DE LOS CURSOS EN LO QUE ESTA INSC
//Y LA INFORMACION DE LOS CURSOS
//crea objeto de tipo Moodlewebservice, para poder mandar llamar getSiteinfo
MoodleWebService webService = new MoodleWebService(Login.this);
//crea objeto siteInfo para envianrselo vacio como parametro a funcion getsiteinfo
SiteInfo siteInfo = new SiteInfo();
//IdUser idUser = new IdUser();
//LLAMADA A 1ER WEBSERVICE PARA OBTENER DATOS DE DOC XML NOMBRE COMPLETO DE USUARIO Y NOMBRE D SITIO)
webService.getSiteinfo(serverurl, siteInfo);//llamada a webservice 1
user.setSiteInfo(siteInfo);
ArrayList<Course> courses = new ArrayList<Course>();
if (courses.size() > 0) {
for (int i = 0; i < courses.size(); i++) {
Course c = courses.get(i);
ArrayList<CourseContent> coursecontents = new ArrayList<CourseContent>();
webService.getCourseContents(serverurl, c.getId(), coursecontents);
if (coursecontents.size() > 0) {
c.setCourseContent(coursecontents);
}
} //fin for
user.setCourses(courses);
Intent nextPage;
//
nextPage = new Intent(Login.this, CourseDetail.class);
nextPage.putExtra("userObject", user);
startActivity(nextPage);
} else {
messageHandler.sendEmptyMessage(0);
Log.e("Course Error", "Usuario no esta inscrito en un curso");
Toast.makeText(getApplicationContext(), "No tienes curso(s) asignados", Toast.LENGTH_LONG).show();
}
} else {
messageHandler.sendEmptyMessage(0);
Toast.makeText(getApplicationContext(), "El usuario o contraseña son incorrectos. Intenta de nuevo!", Toast.LENGTH_LONG).show();
Toast.makeText(getApplicationContext(), "Verifica si el sitio tiene habilitado el protocolo REST", Toast.LENGTH_LONG).show();
}
break;
default:
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
private Handler messageHandler = new Handler() {
public void handleMessage(Message msg) {
super.handleMessage(msg);
dialog.dismiss();
}
};
}
//////////////////////////////////////////////////////////////////////////////////////////////
Tokenhttprequest class
public class TokenHttpRequest {
public String doHTTPRequest(String url){
String responseBody = "";
String token = "";
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpGet httpPost = new HttpGet(url);
try {
ResponseHandler<String> responseHandler=new BasicResponseHandler();
responseBody = httpClient.execute(httpPost, responseHandler);
JSONObject jObject = new JSONObject(responseBody);
token = jObject.getString("token");
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ClientProtocolException e) {
// writing exception to log
e.printStackTrace();
} catch (IOException e) {
// writing exception to log
e.printStackTrace();
}
return token;
}
}
juan_guardado said:
i have problems with my project when i compile ,
this is the result
11-04 23:47:17.205 5524-5524/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
android.os.NetworkOnMainThreadException
at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1118)
at java.net.InetAddress.lookupHostByName(InetAddress.java:385)
at java.net.InetAddress.getAllByNameImpl(InetAddress.java:236)
at java.net.InetAddress.getAllByName(InetAddress.java:214)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:137)
at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:360)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:670)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:769)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:743)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:732)
at moodle.android.APLICACIONMOVILDECAMPUSVIRTUAL.General.TokenHttpRequest.doHTTPRequest(TokenHttpRequest.java:29)
at moodle.android.APLICACIONMOVILDECAMPUSVIRTUAL.General.Login.onClick(Login.java:138)
at android.view.View.performClick(View.java:4198)
at android.view.View$PerformClick.run(View.java:17158)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4918)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1004)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:771)
at dalvik.system.NativeStart.main(Native Method)
////////////////////////////////////////////////////////////////////////////
login class
public class Login extends Activity implements OnClickListener {
Button login;
EditText siteUrl, username, password;
User user;
SharedPreferences saved;
String loginDetails;
ProgressDialog dialog;
@override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.login);
try {
siteUrl = (EditText) findViewById(R.id.moodle_url);
username = (EditText) findViewById(R.id.username);
password = (EditText) findViewById(R.id.password);
login = (Button) findViewById(R.id.login_button);
try {
//
siteUrl.setHint(R.string.login_url_hint);
username.setHint(R.string.login_username_hint);
password.setHint(R.string.login_password_hint);
siteUrl.setText("https://uacjmoodle.milaulas.com");
username.setText("juan_guardado");
password.setText("Prueba123#");
} catch (Exception e) {
Log.e("NoPreferences", e.toString());
}
login.setOnClickListener(this);
} catch (Exception e) {
Log.e("Error With Login", e.toString());
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@override
public void onClick(View v) {
switch (v.getId()) {
case R.id.login_button:
dialog = ProgressDialog.show(this, "",
"Verificando Ususrio y Contraseña", true);
if (AppStatus.getInstance(Login.this).isOnline(Login.this)) {
String conType = AppStatus.getInstance(Login.this).getConnectionType(Login.this);
conType = conType == null ? "No hay cursos visibles" : conType;
Toast.makeText(getApplicationContext(), "Estas en linea (" + conType + ")!!!!", Toast.LENGTH_LONG).show();
} else {
messageHandler.sendEmptyMessage(0);
Toast.makeText(getApplicationContext(), "No tienes Internet!!!!", Toast.LENGTH_LONG).show();
}
String siteUrlVal = siteUrl.getText().toString();
String usr = username.getText().toString();
String pwd = password.getText().toString();
String usrUri = Uri.encode(usr);
String pwdUri = Uri.encode(pwd);
saved = getSharedPreferences(loginDetails, MODE_PRIVATE);
SharedPreferences.Editor e = saved.edit();
e.putString("siteUrlVal", siteUrlVal);
e.putString("usr", usr);
e.putString("pwd", pwd);
e.commit();
//moodle_mobile_app
String url = siteUrlVal + "/login/token.php?username=" + usrUri + "&password=" + pwdUri + "&rest";
//url = "https://uacjmoodle.milaulas.com/login/token.php?username=festrada&password=Profesor123!&service=&service=moodle_mobile_app";//&service=moodle_mobile_app
TokenHttpRequest tokenRequest = new TokenHttpRequest();
String token = tokenRequest.doHTTPRequest(url);
//se quito la llamada a tokenrequest y se le asigna el token manual
//se declara este tocken para acceder a la informacion del usuario festrada
//String token= "700c1d9f3af35836885b12a65a584e1e"; //acceder a la informacion del usuario festrada
if (token != null && token != "")
{
String serverurl = siteUrlVal + "/webservice/rest/server.php" + "?wstoken=" + token + "&wsfunction=";
user = new User();
user.setUsername(usr);
user.setPassword(pwd);
user.setToken(token);
user.setTokenCreateDate();
user.setUrl(url);
//AQUI SE MANDA LLAMAR A LA CLASE MOODLEWEBSERVICE
//PARA OBTENER LA INFORMACION DE LOS CURSOS EN LO QUE ESTA INSC
//Y LA INFORMACION DE LOS CURSOS
//crea objeto de tipo Moodlewebservice, para poder mandar llamar getSiteinfo
MoodleWebService webService = new MoodleWebService(Login.this);
//crea objeto siteInfo para envianrselo vacio como parametro a funcion getsiteinfo
SiteInfo siteInfo = new SiteInfo();
//IdUser idUser = new IdUser();
//LLAMADA A 1ER WEBSERVICE PARA OBTENER DATOS DE DOC XML NOMBRE COMPLETO DE USUARIO Y NOMBRE D SITIO)
webService.getSiteinfo(serverurl, siteInfo);//llamada a webservice 1
user.setSiteInfo(siteInfo);
ArrayList<Course> courses = new ArrayList<Course>();
if (courses.size() > 0) {
for (int i = 0; i < courses.size(); i++) {
Course c = courses.get(i);
ArrayList<CourseContent> coursecontents = new ArrayList<CourseContent>();
webService.getCourseContents(serverurl, c.getId(), coursecontents);
if (coursecontents.size() > 0) {
c.setCourseContent(coursecontents);
}
} //fin for
user.setCourses(courses);
Intent nextPage;
//
nextPage = new Intent(Login.this, CourseDetail.class);
nextPage.putExtra("userObject", user);
startActivity(nextPage);
} else {
messageHandler.sendEmptyMessage(0);
Log.e("Course Error", "Usuario no esta inscrito en un curso");
Toast.makeText(getApplicationContext(), "No tienes curso(s) asignados", Toast.LENGTH_LONG).show();
}
} else {
messageHandler.sendEmptyMessage(0);
Toast.makeText(getApplicationContext(), "El usuario o contraseña son incorrectos. Intenta de nuevo!", Toast.LENGTH_LONG).show();
Toast.makeText(getApplicationContext(), "Verifica si el sitio tiene habilitado el protocolo REST", Toast.LENGTH_LONG).show();
}
break;
default:
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
private Handler messageHandler = new Handler() {
public void handleMessage(Message msg) {
super.handleMessage(msg);
dialog.dismiss();
}
};
}
//////////////////////////////////////////////////////////////////////////////////////////////
Tokenhttprequest class
public class TokenHttpRequest {
public String doHTTPRequest(String url){
String responseBody = "";
String token = "";
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpGet httpPost = new HttpGet(url);
try {
ResponseHandler<String> responseHandler=new BasicResponseHandler();
responseBody = httpClient.execute(httpPost, responseHandler);
JSONObject jObject = new JSONObject(responseBody);
token = jObject.getString("token");
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ClientProtocolException e) {
// writing exception to log
e.printStackTrace();
} catch (IOException e) {
// writing exception to log
e.printStackTrace();
}
return token;
}
}
Click to expand...
Click to collapse
Hello, and welcome to XDA!
This would be best (or better) asked in the Apk Development forum:
> App Development Forums > Coding Discussion, Q&A, and Educational Resources > Java for Android App Development
Hope this helps, and good luck!
hi there
i am trying to port miui 8 marchmellow using patchrom project to our device
But after flashing the rom it stuck in mi logo (bootloop)
Code:
W init : type=1400 audit(0.0:22): avc: denied { execute } for name="shelld" dev="mmcblk0p19" ino=90304 scontext=u:r:init:s0 tcontext=u:object_r:unlabeled:s0 tclass=file permissive=0
W init : type=1400 audit(0.0:23): avc: denied { execute } for name="fdpp" dev="mmcblk0p19" ino=40996 scontext=u:r:init:s0 tcontext=u:object_r:unlabeled:s0 tclass=file permissive=0
W init : type=1400 audit(0.0:24): avc: denied { execute } for name="shelld" dev="mmcblk0p19" ino=90304 scontext=u:r:init:s0 tcontext=u:object_r:unlabeled:s0 tclass=file permissive=0
W init : type=1400 audit(0.0:25): avc: denied { execute } for name="fdpp" dev="mmcblk0p19" ino=40996 scontext=u:r:init:s0 tcontext=u:object_r:unlabeled:s0 tclass=file permissive=0
W init : type=1400 audit(0.0:26): avc: denied { execute } for name="shelld" dev="mmcblk0p19" ino=90304 scontext=u:r:init:s0 tcontext=u:object_r:unlabeled:s0 tclass=file permissive=0
W init : type=1400 audit(0.0:27): avc: denied { execute } for name="fdpp" dev="mmcblk0p19" ino=40996 scontext=u:r:init:s0 tcontext=u:object_r:unlabeled:s0 tclass=file permissive=0
W init : type=1400 audit(0.0:28): avc: denied { execute } for name="shelld" dev="mmcblk0p19" ino=90304 scontext=u:r:init:s0 tcontext=u:object_r:unlabeled:s0 tclass=file permissive=0
W init : type=1400 audit(0.0:29): avc: denied { execute } for name="fdpp" dev="mmcblk0p19" ino=40996 scontext=u:r:init:s0 tcontext=u:object_r:unlabeled:s0 tclass=file permissive=0
W init : type=1400 audit(0.0:30): avc: denied { execute } for name="shelld" dev="mmcblk0p19" ino=90304 scontext=u:r:init:s0 tcontext=u:object_r:unlabeled:s0 tclass=file permissive=0
W init : type=1400 audit(0.0:31): avc: denied { execute } for name="fdpp" dev="mmcblk0p19" ino=40996 scontext=u:r:init:s0 tcontext=u:object_r:unlabeled:s0 tclass=file permissive=0
W init : type=1400 audit(0.0:7): avc: denied { execute_no_trans } for path="/system/xbin/su" dev="mmcblk0p19" ino=90310 scontext=u:r:init:s0 tcontext=u:object_r:su_exec:s0 tclass=file permissive=0
W init : type=1400 audit(0.0:8): avc: denied { execute } for name="mcd" dev="mmcblk0p19" ino=41033 scontext=u:r:init:s0 tcontext=u:object_r:unlabeled:s0 tclass=file permissive=0
W init : type=1400 audit(0.0:9): avc: denied { execute } for name="miuioneshots" dev="mmcblk0p19" ino=90292 scontext=u:r:init:s0 tcontext=u:object_r:unlabeled:s0 tclass=file permissive=0
Sadly I can't help you, because I'm not an expert,but can I ask you how is development going? Did you find a solution?
Maybe you need a permissive kernel cos I'm seeing a lot of selinux denials
osas514 said:
Maybe you need a permissive kernel cos I'm seeing a lot of selinux denials
Click to expand...
Click to collapse
it already permissive
i will build another one
thanks for reply
AymenDe7 said:
it already permissive
i will build another one
thanks for reply
Click to expand...
Click to collapse
A proper full log will be necessary here..
Goodluck
Any luck with miui8 for Samsung galaxy s2 plus ?
@AymenDe7
Any luck?
Ribin Manuel said:
Any luck with miui8 for Samsung galaxy s2 plus ?
@AymenDe7
Click to expand...
Click to collapse
aborted
AymenDe7 said:
aborted
Click to expand...
Click to collapse
Oops