First, my English isn't good
I am a high school student from Spain, I work in a research study (TREC) about Android.
I decided to develop an application where I am going to release it.
Because in my class everybody has an Android device but no one knows how use it.
I know much about Android but I will need help to develop my app. because I have never developed.
nowadays I use Android studio, I learned about Activity Main, strings, Id...
But I don't know java code
I need tips, assistance,etc... please.
ronnyalexman said:
But I don't know java code
I need tips, assistance,etc... please.
Click to expand...
Click to collapse
Then learn java... there is an absolute wealth of information on the interwebz about java coding and beginner lessons for java development, even a simple Google search shows up a lot of relevant information and lessons.
thanks
Jonny said:
Then learn java... there is an absolute wealth of information on the interwebz about java coding and beginner lessons for java development, even a simple Google search shows up a lot of relevant information and lessons.
Click to expand...
Click to collapse
It's my problem, a lot information that it isn't I need it
What's your plan?
Java for beginners
Start from scratch. Search on google for "java for bigginers" and read. You cant know to much when it comes to programming. Eclipse have some nice video tutorials on there site, check them out.
ronnyalexman said:
First, my English isn't good
I am a high school student from Spain, I work in a research study (TREC) about Android.
I decided to develop an application where I am going to release it.
Because in my class everybody has an Android device but no one knows how use it.
I know much about Android but I will need help to develop my app. because I have never developed.
nowadays I use Android studio, I learned about Activity Main, strings, Id...
But I don't know java code
I need tips, assistance,etc... please.
Click to expand...
Click to collapse
Try learning the syntax of Java. Programming is about thinking in your head about how you'll do something in code and no one can teach you how to think. You can only be taught the syntax and then your mind goes from there (or doesn't). Next learn the basics of Android Development. Start on the tutorials on developer.android.com and go from there. Also, your going to need to be best friends with Google Search.
thanks for your interest
Allavaz said:
What's your plan?
Click to expand...
Click to collapse
My idea is going to be an application for release to Android easily, like wikipedia or more webs.
An app where I will put my research study but first I must finish it.
My research studies index:
What is it??
History of Android
everyday Use
What can you really do with Android?
Body of work
1. How is architecture? (chart diagram)
2. General properties
3. Versions of Android (timeline)
7. Root
What is it?
Benefits and drawbacks.
Grant permissions as root?
Applications for use of the root.
5. Apps
Structure of the applications
Applications famous and best developers
6. Terminals Best (past, present and future)
7. Webs expert on the subject (Where to get help)
8. Curiosities
I don't want to earn money only need help
Be specific so I can help you. I speak spanish too.
Gracias por tu atención
Allavaz said:
Be specific so I can help you. I speak spanish too.
Click to expand...
Click to collapse
Mi idea para la aplicación es poner todo el contenido de mi trabajo teórico (que es android, ventajas que tiene, que se puede llegar a hacer con este SO, que significa ser root y sus ventajas, etc....) todo eso dentro de mi app de manera que se de entender de manera resumida o detallada (quiero hacer modo resumen o modo completo)
Ya que vivimos en la era de los smartphones pero ni la mitad de sus usuarios tienen idea de su potencial.
Gracias por tu ayuda
One question!!!!!!!!
how to make an exit button?
step by step
I have the button exit, but I don't know the java code for the action exit
Activity_my.xml
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/btExit"
android:id="@+id/buttonexit"
android:layout_marginTop="20dp"
android:background="#ff000000"
android:textColor="#ffffeaed" />
MyActivity.java
??
ronnyalexman said:
how to make an exit button?
step by step
I have the button exit, but I don't know the java code for the action exit
Activity_my.xml
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/btExit"
android:id="@+id/buttonexit"
android:layout_marginTop="20dp"
android:background="#ff000000"
android:textColor="#ffffeaed" />
MyActivity.java
??
Click to expand...
Click to collapse
Ok first will you please stick to the java naming conventions, they are there for a reason. This means that the id for the exit button should be something like buttonExit or exitButton, not buttonexit.
Then what you want to do is find the view in your MainActivity by using findViewById, then set an OnClickListener for that view. The code to exit the app is simply finish();
Put this in the onCreate method of MainActivity (after setContentView has been called).
Code:
Button exitButton = (Button) findViewById(R.id.buttonexit);
exitButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
Also in future, please search before posting, a quick Google on this would have easily got you an answer.
Without XML:
Code:
Button exitButton = new Button(this);
exitButton.setText(R.string.exit);
exitButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
});
rootView.addSubView(exitButton);
Thanks
Jonny said:
Ok first will you please stick to the java naming conventions, they are there for a reason. This means that the id for the exit button should be something like buttonExit or exitButton, not buttonexit.
Then what you want to do is find the view in your MainActivity by using findViewById, then set an OnClickListener for that view. The code to exit the app is simply finish();
Put this in the onCreate method of MainActivity (after setContentView has been called).
Code:
Button exitButton = (Button) findViewById(R.id.buttonexit);
exitButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
Also in future, please search before posting, a quick Google on this would have easily got you an answer.
Click to expand...
Click to collapse
I searched much information on Google, but I saw a lot code and was confused.
Thanks for your clarification
Hi ^^
He estado progresando con mi proyecto, pero ahora me he atascado de nuevo
Mi problema es el siguiente:
Hice un ListView personalizado con los siguientes códigos:
package trecandroid.ronny.gmail.com.trecandroid;
import android.app.Activity;
import android.os.Bundle;
import android.widget.ListView;
import trecandroid.ronny.gmail.com.trecandroid.adapter.AdaptadorTitulares;
import trecandroid.ronny.gmail.com.trecandroid.personal.Titular;
public class Arquitectura extends Activity {
ListView lista;
@override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.arquitectura);
lista = (ListView) findViewById(R.id.lista);
Titular[] args = new Titular[]{
new Titular(R.drawable.aplicaciones),
new Titular(R.drawable.framework),
new Titular(R.drawable.runtime),
new Titular(R.drawable.librerias),
new Titular(R.drawable.kernel),
};
AdaptadorTitulares adap = new AdaptadorTitulares(this, args);
lista.setAdapter(adap);
}
}
package trecandroid.ronny.gmail.com.trecandroid.personal;
/**
* Created by Ronny on 26/08/2014.
*/
public class Titular {
private int img;
public Titular (int img){
this.img = img;
}
public int getImg(){
return img;
}
public void setImagen(int img) {
this.img = img;
}
}
package trecandroid.ronny.gmail.com.trecandroid.adapter;
import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import trecandroid.ronny.gmail.com.trecandroid.R;
import trecandroid.ronny.gmail.com.trecandroid.personal.Titular;
/**
* Created by Ronny on 26/08/2014.
*/
public class AdaptadorTitulares extends ArrayAdapter {
Activity context;
Titular[] datos;
public AdaptadorTitulares(Activity context, Titular[] datos) {
super(context, R.layout.lista_personal , datos);
this.datos = datos;
this.context = context;
}
@override
public View getView (int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = context.getLayoutInflater();
View item = inflater.inflate(R.layout.lista_personal, null);
ImageView imagen = (ImageView) item.findViewById(R.id.imageViewlista);
imagen.setImageResource(datos[position].getImg());
return item;
}
}
Ahora quiero que al tocar "R:drawable,aplicaciones" me lleve a un Layout que he creado.
Y lo mismo con "R.drawable.framework" etc..
He buscado por San Google, pero no lo encuentro.
Ya nada, gracias.
ronnyalexman said:
He estado progresando con mi proyecto, pero ahora me he atascado de nuevo
Mi problema es el siguiente:
Hice un ListView personalizado con los siguientes códigos:
package trecandroid.ronny.gmail.com.trecandroid;
import android.app.Activity;
import android.os.Bundle;
import android.widget.ListView;
import trecandroid.ronny.gmail.com.trecandroid.adapter.AdaptadorTitulares;
import trecandroid.ronny.gmail.com.trecandroid.personal.Titular;
public class Arquitectura extends Activity {
ListView lista;
@override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.arquitectura);
lista = (ListView) findViewById(R.id.lista);
Titular[] args = new Titular[]{
new Titular(R.drawable.aplicaciones),
new Titular(R.drawable.framework),
new Titular(R.drawable.runtime),
new Titular(R.drawable.librerias),
new Titular(R.drawable.kernel),
};
AdaptadorTitulares adap = new AdaptadorTitulares(this, args);
lista.setAdapter(adap);
}
}
package trecandroid.ronny.gmail.com.trecandroid.personal;
/**
* Created by Ronny on 26/08/2014.
*/
public class Titular {
private int img;
public Titular (int img){
this.img = img;
}
public int getImg(){
return img;
}
public void setImagen(int img) {
this.img = img;
}
}
package trecandroid.ronny.gmail.com.trecandroid.adapter;
import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import trecandroid.ronny.gmail.com.trecandroid.R;
import trecandroid.ronny.gmail.com.trecandroid.personal.Titular;
/**
* Created by Ronny on 26/08/2014.
*/
public class AdaptadorTitulares extends ArrayAdapter {
Activity context;
Titular[] datos;
public AdaptadorTitulares(Activity context, Titular[] datos) {
super(context, R.layout.lista_personal , datos);
this.datos = datos;
this.context = context;
}
@override
public View getView (int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = context.getLayoutInflater();
View item = inflater.inflate(R.layout.lista_personal, null);
ImageView imagen = (ImageView) item.findViewById(R.id.imageViewlista);
imagen.setImageResource(datos[position].getImg());
return item;
}
}
Ahora quiero que al tocar "R:drawable,aplicaciones" me lleve a un Layout que he creado.
Y lo mismo con "R.drawable.framework" etc..
He buscado por San Google, pero no lo encuentro.
Click to expand...
Click to collapse
Pude solucionarlo yo solo ^^
ronnyalexman said:
First, my English isn't good
I am a high school student from Spain, I work in a research study (TREC) about Android.
I decided to develop an application where I am going to release it.
Because in my class everybody has an Android device but no one knows how use it.
I know much about Android but I will need help to develop my app. because I have never developed.
nowadays I use Android studio, I learned about Activity Main, strings, Id...
But I don't know java code
I need tips, assistance,etc... please.
Click to expand...
Click to collapse
google have now free online course for android with name udacity ... try it
thanks for information
sekip said:
google have now free online course for android with name udacity ... try it
Click to expand...
Click to collapse
Thanks, but the course cost 150$. I don't have much money
ronnyalexman said:
Thanks, but the course cost 150$. I don't have much money
Click to expand...
Click to collapse
but you have 2 week free trial :victory:
Related
Anyone here know how to write some simple html to animate some web images off a local weather station? I have it working on my desktop written in javascript but mobile ie doesnt seem to want to animate the images. Any help or suggestions will be appreciated.
Why don't you post your HTML and maybe someone can point out what to change to make it work. I have had luck with Javascript and DHTML in PIE so it may be possible to do what you are asking.
sahoopes said:
Why don't you post your HTML and maybe someone can point out what to change to make it work. I have had luck with Javascript and DHTML in PIE so it may be possible to do what you are asking.
Click to expand...
Click to collapse
Code:
<div id="radar">
<noscript><img src="http://xxx.com/xxx.gif" width="1"
height="1" border="0"></noscript>
<SCRIPT LANGUAGE="JavaScript" TYPE="TEXT/JAVASCRIPT">
<!--
var c = 9;
/* Preloading images */
var image1 = new Image();
image1.src = "http://xxx.com/1.jpg";
var image2 = new Image();
image2.src = "http://xxx.com/2.jpg";
var image3 = new Image();
image3.src = "http://xxx.com/3.jpg";
var image4 = new Image();
image4.src = "http://xxx.com/4.jpg";
var image5 = new Image();
image5.src = "http://xxx.com/.jpg";
var image6 = new Image();
image6.src = "http://xxx.com/.jpg";
var image7 = new Image();
image7.src = "http://xxx.com/7.jpg";
var image8 = new Image();
image8.src = "http://xxx.com/8.jpg";
var image9 = new Image();
image9.src = "http://xxx.com/9.jpg";
var image10 = new Image();
image10.src = "http://xxx.com/10.jpg";
function disp_img(w)
{
if (c <1)
{
c = 10;
}
var img_src = "http://xxx.com/" + c + ".jpg";
document.ani.src = img_src;
c=c-1;
}
t = setInterval("disp_img(c)", 1000);
//-->
</script>
<IMG SRC="http://xxx.com/10.jpg" BORDER="0" WIDTH="640"
HEIGHT="480" NAME="ani"><br>
</div>
Here is the code that is not working.
Hey Guys
How can I get access to the vibration function on a device running Windows Mobile 6 Professional, the Vibrate API is not supported (according to MSDN)?
I do basic development in native C++ using Visual Studio using SDKs for WM5 an 6.
Any help will be appreciated!
Code:
#include "stdafx.h"
# include <nled.h>
int GetLedCount()
{
NLED_COUNT_INFO nci;
int wCount = 0;
if(NLedGetDeviceInfo(NLED_COUNT_INFO_ID, (PVOID) &nci))
wCount = (int) nci.cLeds;
return wCount;
}
void SetLedStatus(int wLed, int wStatus)
{
NLED_SETTINGS_INFO nsi;
nsi.LedNum = (INT) wLed;
nsi.OffOnBlink = (INT) wStatus;
NLedSetDevice(NLED_SETTINGS_INFO_ID, &nsi);
}
int _tmain(int argc, _TCHAR* argv[])
{
int count = GetLedCount();
SetLedStatus(1, 1);
Sleep(1000);
SetLedStatus(1, 0);
Sleep(1000);
return 0;
}
You need to test which LED number (int wLed) the device uses. Mostly it is 1.
Thank you MarcLandis, this information help a great deal and works like a charm!
Code:
public static bool IsKernelNative(string NKS000File)
{
int[] pattern = new int[] { 0x0C, 0x00, 0x94, 0xE5, 0x1F, 0x03, 0x50, 0xE3 };
int lookingfor = 0;
using (FileStream input = new FileStream(NKS000File, FileMode.Open, FileAccess.Read))
{
for (int i = 0; i < input.Length; i++)
if (input.ReadByte() == pattern[lookingfor++])
{
if (lookingfor == (pattern.Length - 1))
break;
}
else lookingfor = 0;
}
return (lookingfor == (pattern.Length - 1));
}
Barin will probably be happy to have this (and probably be even happier to replace the code with a File.ReadAllBytes and a LINQ array search if he didn't chose to use NET 2.0 like I did).
very interesting. what does this array (0x0C, 0x00, 0x94, 0xE5, 0x1F, 0x03, 0x50, 0xE3) mean? i.e. what code does it contain? it really can be found in new kernels only.
airxtreme, thanks for the info
But why should i be happy? When i build a rom i know exactly which kernel i use
Anyway i'll add the code to show info about kernel in log window.
PS I don't use .ReadAllBytes method to search a pattern. Sometimes i use it when i need to keep something in memory.
Check your decompiler
l2tp said:
very interesting. what does this array (0x0C, 0x00, 0x94, 0xE5, 0x1F, 0x03, 0x50, 0xE3) mean? i.e. what code does it contain? it really can be found in new kernels only.
Click to expand...
Click to collapse
I don't remember what it exactly does since it's stuff from several months ago but it should be code that is related to the new slots allocation that can be found only on windows mobile 6.5 kernels.
-=Barin=- said:
airxtreme, thanks for the info
But why should i be happy? When i build a rom i know exactly which kernel i use
Anyway i'll add the code to show info about kernel in log window.
Click to expand...
Click to collapse
You certainly do but for first-time users it's not so immediate understanding that each device requires its own native kernel, that the kernel is specifically compiled for the windows mobile version it came with and that even though an old kernel may work on newer windows mobile builds the kitchen needs to know the version of the native kernel to do the proper slots allocation and if it's not chosen correctly the ROM could not work. If you auto-detect the kernel and remove the kernel selection option (that in the case of your kitchen being only labeled WM6.1/WM6.5 I think may confuse users into thinking the option has to do with the windows mobile version rather than the native kernel version) you can remove a considerable burden from beginners.
I guess we need a place to continue development on the kernel, gonna clone Markinus kernel soon
edit: or maybe start from scratch with latest kernel version
Edit:
a new test build uped by tailormoon: http://depositfiles.com/files/7xbbcwk5o
Website: http://toshdevs.nyl.ro/
list of known chips: http://toshdevs.nyl.ro/showthread.php?tid=4
for irc:
server: androidirc.org
channel: #toshdevs and #android
web irc chat:
http://nyl.ro:9090/?channels=toshdevs,android&uio=d4
or
http://toshdevs.nyl.ro/cgi-bin/irc.cgi
thank you for kickstarting the development again!
nyl..... i can help you ... only for test your prodact, (mama ei de engleza)
well that's good to hear i would just like to see that work so we can compare what is better for our tg01. gj bro and keep going!
i help you for testing...
hope we get those HQ pics
I tried to compile Markinus kernel and get below error
CC arch/arm/mach-msm/board-tsunagi-power.o
arch/arm/mach-msm/board-tsunagi-power.c:53: error: variable 'usb_status_notifier' has initializer but incomplete type
arch/arm/mach-msm/board-tsunagi-power.c:54: error: unknown field 'name' specified in initializer
arch/arm/mach-msm/board-tsunagi-power.c:54: warning: excess elements in struct initializer
arch/arm/mach-msm/board-tsunagi-power.c:54: warning: (near initialization for 'usb_status_notifier')
arch/arm/mach-msm/board-tsunagi-power.c:55: error: unknown field 'func' specified in initializer
arch/arm/mach-msm/board-tsunagi-power.c:55: warning: excess elements in struct initializer
arch/arm/mach-msm/board-tsunagi-power.c:55: warning: (near initialization for 'usb_status_notifier')
arch/arm/mach-msm/board-tsunagi-power.c: In function 'tsunagi_power_init':
arch/arm/mach-msm/board-tsunagi-power.c:186: error: implicit declaration of function 'usb_register_notifier'
Please suggest how do I go about it?
Thanks
nyl> If you want more people to test I would suggest that you remove that android storing the text messages to the SIM card. As when you return to windows they are still stored on the SIM meaning you have to hard reset your phone a few times to get it to be back to normal.
Anyway.. I'm always ready to help test, but is there any other way I can support you?
glad to see android not dead on tg01
a
11calcal said:
glad to see android not dead on tg01
Click to expand...
Click to collapse
it's on life support but I don't hold out much hope for it.
I now have a HD2 as my main phone so if you want some tests I can do them on my TG01
Drop me a line
android port revival on tg01
qinwengui said:
I tried to compile Markinus kernel and get below error
CC arch/arm/mach-msm/board-tsunagi-power.o
arch/arm/mach-msm/board-tsunagi-power.c:53: error: variable 'usb_status_notifier' has initializer but incomplete type
arch/arm/mach-msm/board-tsunagi-power.c:54: error: unknown field 'name' specified in initializer
arch/arm/mach-msm/board-tsunagi-power.c:54: warning: excess elements in struct initializer
arch/arm/mach-msm/board-tsunagi-power.c:54: warning: (near initialization for 'usb_status_notifier')
arch/arm/mach-msm/board-tsunagi-power.c:55: error: unknown field 'func' specified in initializer
arch/arm/mach-msm/board-tsunagi-power.c:55: warning: excess elements in struct initializer
arch/arm/mach-msm/board-tsunagi-power.c:55: warning: (near initialization for 'usb_status_notifier')
arch/arm/mach-msm/board-tsunagi-power.c: In function 'tsunagi_power_init':
arch/arm/mach-msm/board-tsunagi-power.c:186: error: implicit declaration of function 'usb_register_notifier'
Please suggest how do I go about it?
Thanks
Click to expand...
Click to collapse
Hello. I was at the point of kindly asking Markinus what to do about this error, as I've got the same error as qinwengui above. However after some googling found out that t_usb_register_notifier was often defined in board.h and alike, so checked master branch (not linux-tg01 branch) and found the struct definition. Right now kernel has resumed compilation, not finished yet. I will keep you updated. Do not put expectations high as I don't have much experience with drivers for android, but I have some ideas in mind like: trying to grab htc leo driver for wi-fi, gdisassm of windows 6.5 wi-fi to at least find some offsets and device ids and such. Maybe we can have wi-fi soon. Me developer mainly in C++ under windows, but with knowledge of linux slackware going back to 1.2.13 ... in the past 2 days I've got ubuntu and downloaded a lot of stuff, set up my ubuntu on the laptop, followed up endrix tutorial, got both git sources from markinus/gitorious and endrix/toshdroid, I'll get as much info as possible.
I Compared with 12.11 and the last kernel, I compilation with last kernel,but call and power not work. compilation 12.11
kernel can work.I think that can be used to compilation with tg03's source,but i compilation a zImage with T01C_TER018_38.tar ,the kernel not work.
Howell said:
I now have a HD2 as my main phone so if you want some tests I can do them on my TG01
Drop me a line
Click to expand...
Click to collapse
I did the same, gave up on my tg01 - bought an hd2 on ebay for £165, best purchase i ever made!
Omule, închide-ți threadurile că au ajuns contoare de posturi pentru toți papagalii care se trezesc vorbind și care fac voluntar sau involuntar thread crapping. Deja pe ultimele pagini IQ-ul posterilor e căzut rău sub 100 și raportul semnal-zgomot e la cote alarmante.
Respect și toate bune.
Scuze, pe acesta nu-l omorati inca. Multumesc. A fost doar o pauza de o saptamana, fara laptop. Reincep munca de maine seara.
Excuse me, don't kill this thread yet, as I've just paused for a while. I am resuming work tomorrow evening. Last status was that I've got finally some december branch working fine, and I'm now inspecting the changes to get those compilable as well. I will keep you updated.
vasilica2008 said:
Omule, închide-ți threadurile că au ajuns contoare de posturi pentru toți papagalii care se trezesc vorbind și care fac voluntar sau involuntar thread crapping. Deja pe ultimele pagini IQ-ul posterilor e căzut rău sub 100 și raportul semnal-zgomot e la cote alarmante.
Respect și toate bune.
Click to expand...
Click to collapse
Excuse me! You have been warned before about not posting in other languages!!! Post in english! Follow the rules! Or you will get a ban!
really if u don't know english pls use google translator!
Slightly confused. How come you have gone back in some builds? I thought the last build from Markinus was working? (Apart from missing drivers etc?)
How can I be of help to you btw?
i'm so sorry to say but i am forced to sell my tg01, because i'm kinda bankrupt, so i'm sorry to say but i gonna keep only my hd2
for those from Romania that want to buy it, i'm selling it for 550RON
we can't evolve much on this phone without clear technical info, I wouldn't sell it, but hey that's life can someone close/delete the thread and start a new one?
hi guys im trying to set an app to have a send sms function to non changing phone number for " opening a service call" thingy for users that have warranty on some electric product that they have bought but i got some problem i wish one of you can help heres the info :
this is the XML :
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textsms"
android:layout_marginTop="94dp"
android:hint="fill in the problem and location and cellphone number"
android:layout_below="@+id/textView3"
android:layout_centerHorizontal="true" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="send service request"
android:id="@+id/buttonSms"
android:layout_marginTop="121dp"
android:layout_below="@+id/textsms"
android:layout_centerHorizontal="true"
androidnClick="smsClick"/>
this is the java:
//smssending
Button buttonSms;
EditText textsms;
buttonSms = (Button) findViewById(R.id.buttonSms);
textsms = (EditText) findViewById(R.id.textsms);
final String editPhoneNum = "052444444";
buttonSms.setOnClickListener (new OnClickListener()
{
public void smsClick(View v) {
String phoneNo = editPhoneNum;
String sms = textsms.getText().toString();
try {
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage(phoneNo, null, sms, null, null);
Toast.makeText(getApplicationContext(), "SMS Sent!",
Toast.LENGTH_LONG).show();
} catch (Exception e) {
Toast.makeText(getApplicationContext(),
"SMS faild, please try again later!",
Toast.LENGTH_LONG).show();
e.printStackTrace();
}
}
}
);
To access variables inside a so-called anonymous inner class like your OnClickListener, they must be declared final. So you must declare textsms like this: final EditText textsms = findViewById(R.id.textsms);
--------------------
Phone: Nexus 4
OS: rooted Lollipop LRX21T
Bootloader: unlocked
Recovery: TWRP 2.8.2.0
first of all thanks but i did it and i got this now in attachment
never mind guys i just needed to change the method name to onClick thats all
by the way use that code if you wanna make your app send sms to perment number that user cant see like if he order a resturant reservasion or stuff like that
ggggguy said:
never mind guys i just needed to change the method name to onClick thats all
by the way use that code if you wanna make your app send sms to perment number that user cant see like if he order a resturant reservasion or stuff like that
Click to expand...
Click to collapse
Oh i didn't even realize it had another name [emoji14]
--------------------
Phone: Nexus 4
OS: rooted Lollipop LRX21T
Bootloader: unlocked
Recovery: TWRP 2.8.2.0
Masrepus said:
To access variables inside a so-called anonymous inner class like your OnClickListener, they must be declared final. So you must declare textsms like this: final EditText textsms = findViewById(R.id.textsms);
--------------------
Phone: Nexus 4
OS: rooted Lollipop LRX21T
Bootloader: unlocked
Recovery: TWRP 2.8.2.0
Click to expand...
Click to collapse
:good:
I think so.You must declear like "final EditText textsms;"
---------- Post added at 08:58 AM ---------- Previous post was at 08:53 AM ----------
ggggguy said:
never mind guys i just needed to change the method name to onClick thats all
by the way use that code if you wanna make your app send sms to perment number that user cant see like if he order a resturant reservasion or stuff like that
Click to expand...
Click to collapse
Android Studio can generate onClick() ,why don't you let IDE to do this job?
smsClick() is bad.