Hi,
I've been developing my first android app and I hit a wall not knowing how to launch a method from an override method.
I need to launch another method in order to update my sql db.
Is it even possible? If not how could I get around it.
Could you give us your code and further explain which method you want to invoke at which position in the code?
domiq123 said:
Hi,
I've been developing my first android app and I hit a wall not knowing how to launch a method from an override method.
I need to launch another method in order to update my sql db.
Is it even possible? If not how could I get around it.
Click to expand...
Click to collapse
You mean you want to launch a method in the same class from for instance your onCreate method? Just call the methods name:
Code:
methodName(Object object);
With the params in brackets. Or what is the problem?
SimplicityApks said:
You mean you want to launch a method in the same class from for instance your onCreate method? Just call the methods name:
Code:
methodName(Object object);
With the params in brackets. Or what is the problem?
Click to expand...
Click to collapse
I think you get my problem.
I need to call a method in the same class so I have an Override method
Code:
public boolean onOptionsItemSelected(MenuItem item)
And from it I need to call my method
Code:
private void myMethod (SQLiteDatabase db)
With your suggestion I need to pass 2 arguments but I don't know what dose are since they aren't any of my variables.
domiq123 said:
I think you get my problem.
I need to call a method in the same class so I have an Override method
Code:
public boolean onOptionsItemSelected(MenuItem item)
And from it I need to call my method
Code:
private void myMethod (SQLiteDatabase db)
With your suggestion I need to pass 2 arguments but I don't know what dose are since they aren't any of my variables.
Click to expand...
Click to collapse
If you have a SQLiteDatabase instance variable, just pass that one: myMethod(mySQLite);
Or, you have to create a new one first and the pass it. Probably myMethod(new SQLiteDatabase(...));
SimplicityApks said:
If you have a SQLiteDatabase instance variable, just pass that one: myMethod(mySQLite);
Or, you have to create a new one first and the pass it. Probably myMethod(new SQLiteDatabase(...));
Click to expand...
Click to collapse
Thank, I've solved it.
Related
Hi,
Does anyone know if there is a way to get a list of the STK Apps installed on the SIM and execute them on user's request. I'am not looking for an app to do that, I'm interestend in implementing this functionality in my application. So I am basically asking is if there is any way to do that using the APIs provided by the SDK.
SimReadRecord could be an option, provided somebody knew which address to look for and how data is formated. Anyone has any ideas?
Thanks in advance.
Nikos.
no, you won't have it with SimReadRecord (as the toolkit menu is generated "on the fly" as the card notify the phone). There is a way to retrieve it through the RIL, but I don't have understood it fully, yet, but it's probably related to an internal command (such as RILSendMsg). If you have a way to "spy" the exchanged RIL messages, it may help you :wink:
it's easier to execute them, with the appropriate envelope command. See the RIL SIM commands and your favorite 11.14 standard :wink:
Do u know if I can succesfully use RIL_SendSimToolkitEnvelopeCmd() to send envelope commands?
I read and implemented function to build a ENVELOPE CMD SMS-PP (11.14) DOWNLOAD, but when I execute RIL_SendSimToolkitEnvelopeCmd() I get
Ril_* error RIL_RESULT_ERROR = 0x00000003 ...
Can you help me?
What about directly accessing ril.dll ?
Thank
Please help me out a little, I am rather new at XDA development.
I'm developing an embedded application for GPS/GSM vehicle tracking, so there is this app which autoanswers GSM data calls, and provides access for software on the operator pc, so it can read the vehicle's position when needed. I have a problem with cprog.exe and the OS in general - it's getting in the way. I need to do the following:
a) Put a logo in the bootloader, so when it boots it needs to show a picture and some text
b) Somehow disable cprog.exe gsm phone app, detach it from the green button etc... but I still need the GSM to be operative and come up (I disabled the pin on the sim card). I don't want any announcements of any kind, just that it register to network and can recieve data calls.
c) To remove the ugly start button and the upper status line, so that nothing else can be run besides my program. I have put the program in startup but am wondering is there a more suitable way to run it... I don't need the today screen or any other **** OS provides, just the GSM data functionality and the application running. How do I strip down the OS and loose all the unnecessary features?
Thanks for your kind help in advance,
Mirko
p.s. Oh yes, the device is a T-Mobile MDA ARM SA1110/206, PW10A2, ROM 3.16.48, Radio 3.19.00, Protocol ver 32S54
a) see romtools on how to do that.
b) if you call RegisterHotKey with key 0x73, right after killing cprog, cprog will stay dead.
c) call SHFullScreen with HIDESTARTICON
XDA developer Itsme said:
a) see romtools on how to do that.
b) if you call RegisterHotKey with key 0x73, right after killing cprog, cprog will stay dead.
c) call SHFullScreen with HIDESTARTICON
Click to expand...
Click to collapse
Thanks for great advices! Did you mean to register 0x72 (that should be the answer key) and then kill cprog? I've tried doing this but it returns 0xb7 as error (and the header file states "wrong flags" as the meaning of 0xb7). 0x73 is supposed to be the hangup button, should I register him right after killing cprog?
Few more questions, and thanks again for helping me.
a) how do I disable smsreciever.exe, SMSDaemon.exe and what do other exe processes do ? (Ussd.exe, aFlashMan.exe, cFlashMan.exe, etc..)
b) I would like exclusiveness for my app, on unix systems I would call it instead /bin/init right from the kernel and it would run alone on the system. Is it possible to do something like that here, that the kernel executes my program directly, and when program perhaps crashes, control isn't returned to the system but device needs to be rebooted. This application is the only thing that is allowed to be ran in XDA, any suggestions would be highly appreciated! Oh yes, how do I put it in rom? Simply with mkrom?
c) What is the best way to implement a copy protection on XDA in Your opinion? Is there perhaps source code of bootloader available? I know M$ recently published WinCE 3.0 source, but I assume XDA still hides it's secrets?
d) I've specified my hardware platform in previous post, is it's PDA rom part allowed to be upgraded with special edition 1.2 ROM ? Can I use ROMKitchen to cook my own ROM?
e) Is it possible for app to read/write device's own flash? To put information inside.
Sorry for going all the way to e) but I have nobody else to ask..
Thank you,
Mirko
Please help - I am trying to kill cprog.exe, but cannot find the romtools page, it says the page cannot be found? Has it been moved/deleted??
Is there anywhere else I can get the necesary prog to kill of cprog.exe??
Thanks
icarusbop said:
Please help - I am trying to kill cprog.exe, but cannot find the romtools page, it says the page cannot be found? Has it been moved/deleted??
Is there anywhere else I can get the necesary prog to kill of cprog.exe??
Thanks
Click to expand...
Click to collapse
Come on. How hard have you tried getting this file(s) Ißm sure you didn't do anything more than clicking on the link.....
But here comes the working link.....
http://www.xs4all.nl/~itsme/projects/xda/romtools.html
Stefan
Ho hum: Actually i did a search as well and did end up at the page you sent me, but I was expecting a help file when I started searching; not a page of text, so I assumed it was the wrong page.
I now have the tools however, thanks for your help.
This is what I'm trying to do: I have been told if you kill cprog.exe the phone no longer works, and it does not load when you press the green button. I have tried this...
I killed cprog.exe with the rom tools, but pressing the green button still loads the phone. Is there something Else I need to do to stop this???
Thanks
itsme said:
b) if you call RegisterHotKey with key 0x73, right after killing cprog, cprog will stay dead.
Click to expand...
Click to collapse
Pushing the green button activates cprog.exe again, I think.
So call RegisterHotKey with key 0x73 to prevent that.
Why do feel like I am being think here??? Sorry to mither but...
Am, I right in thinking the registerhotkey is a C function?? I cannot find it in the romtools list. So I assume I need C++ ( and some knowledge) to execute registerhotkey??
Could some good man make me a simple app that kills Cprog.exe? (I dont have the tools and pc to build it this time)
No need to call registerhotkey 0x73.
/* Terminate cprog */
void kill_cprog()
{
HANDLE Proc, ProcTree;
PROCESSENTRY32 pe;
BOOL ret_val;
/* Get processes tree */
ProcTree = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
pe.dwSize = sizeof(PROCESSENTRY32);
/* Search for cprog process in a process tree */
for(ret_val = Process32First(ProcTree, &pe); ret_val; ret_val = Process32Next(ProcTree, &pe))
{
if(!wcsicmp(TEXT("cprog.exe"),pe.szExeFile))
{
/* Terminate cprog */
Proc = OpenProcess(0, 0, pe.th32ProcessID);
TerminateProcess(Proc, 0);
CloseHandle(Proc);
break;
}
}
CloseToolhelp32Snapshot(ProcTree);
}
other way:
just copy something to \windows\cprog.exe and reset
IIIu30uD said:
other way:
just copy something to \windows\cprog.exe and reset
Click to expand...
Click to collapse
Does overwriting this file cause anything to stop working, other than the phone GUI?
a) how do I disable smsreciever.exe, SMSDaemon.exe and what do other exe processes do ? (Ussd.exe, aFlashMan.exe, cFlashMan.exe, etc..)
Click to expand...
Click to collapse
Unless you dont know, what all these apps do, I dont recommend to disable them. To disable them, replace the exe files with one of your choice. Maybe with just a dummy win32 app that does nothing.
b) I would like exclusiveness for my app, on unix systems I would call it instead /bin/init right from the kernel and it would run alone on the system. Is it possible to do something like that here, that the kernel executes my program directly, and when program perhaps crashes, control isn't returned to the system but device needs to be rebooted. This application is the only thing that is allowed to be ran in XDA, any suggestions would be highly appreciated! Oh yes, how do I put it in rom? Simply with mkrom?
Click to expand...
Click to collapse
Run your app after the initial shell. Take a look at the registry, there will be HKLM\init, which defines which apps/drivers have to load in which order. Search for shell.exe and shell32.exe. To launch your app before the shell, enter new keys for Launchxx and Dependxx, with xx before shell32.exe. Be aware, that some helper apps need to be started. To lock the device, your app should not call SignalStarted(). Further, some API functions are only available, if shell32 is started.
c) What is the best way to implement a copy protection on XDA in Your opinion? Is there perhaps source code of bootloader available? I know M$ recently published WinCE 3.0 source, but I assume XDA still hides it's secrets?
Click to expand...
Click to collapse
Although I am not a specialist for this, you normally need M$ Platform builder to create a ROM images for a device. AFAIK there is no way to have a boot loader of your own, you always have to build the whole rom image.
d) I've specified my hardware platform in previous post, is it's PDA rom part allowed to be upgraded with special edition 1.2 ROM ? Can I use ROMKitchen to cook my own ROM?
Click to expand...
Click to collapse
:?:
e) Is it possible for app to read/write device's own flash? To put information inside.
Click to expand...
Click to collapse
:?:
Hi,
I have a question concerning the using of the MFC class CString (eVC++):
The class owns a method GetBuffer() to allocate memory and a method ReleaseBuffer() to free the allocated memory.
My question is, when I am NOT using the method GetBuffer() for allocation, but instead I use some other methods CString offeres to parse strings and to cut them. Is it then necassary to use the method ReleaseBuffer()? Because my problem is I've a memory leak and I don't know where it could be. So, ich checked all my CString operations and maybe there is the answer. Can anybody help me?
Thanks a lot!
Hi, My question is, when I am NOT using the method GetBuffer() for allocation, but instead I use some other methods CString offeres to parse strings and to cut them. Is it then necassary to use the method ReleaseBuffer()?
Click to expand...
Click to collapse
No, you don't need to call ReleaseBuffer(), unless you call GetBuffer(). Note that the address returned by GetBuffer() is invalid after ReleaseBuffer() is called.
~Zzz
Hi .
Im trying to do an aplication for practice exam test but i have a lot of doubts.
Well, the first is when you launch the app, it have to load automatically the test from a specific folder. I dont know how to make that.
Second is about how can i "tell" to the app where answer is the right.
with a T and making a space between questions for autodetect questions, like this example...
1. Which number is 2+2?
F. 5
F. 6
F. 2
T. 4
2. Which letter is the last from abecedario?
T. z
F. t
F. j
F. m
Click to expand...
Click to collapse
Im a noob programe, in fact, i dont know anything about programming and all that i know is about reading the book "Hello android" but i need to do this app for practice my exams because i didnt found any app like that.
anyone can help me with that?
Thanks in advanced
This seems like a good exercise for you to learn about Android development or Java development in general. You should definitely learn the basics of Java development first, there exist already topics on this (i.e. http://forum.xda-developers.com/archive/index.php/t-660598.html)
Some more specific help for your problem. I will only give a suggestion on how to do this. You could for instance have a folder (say myquestions/) where you put all your questions in (question1.txt, question2.txt).
Code:
File externalDir = Environment.getExternalStorageDirectory();
File questionDir = new File(externalDir, "myquestions");
Now you can list all files in your myquestions directory and read/parse the contents.
Code:
try{
for (File questionFile : questionDir.listFiles()) {
BufferedReader in = new BufferedReader(new FileReader(questionFile));
//Read and parse your questions
while ((strLine = in.readLine()) != null) {
// You should parse your lines here
}
in.close();
}
}catch (Exception e){
//Catch exception if any
}
To parse your answers for T or F you can use existing String methods like indexOf(), substring(),...
I did not test the above code, but it should get you started.
Good luck!
Stijn
Thanks for your help spolfliet.
After reading your contents im now sure that i cant do my app, its too hard for a noob and i cant waste time in learning now java... the book "Hello Android" its useless in that case.
Better i prepare my exams in paper but i will open a new thread with photos and descriptive text about the test examinator that i try to do, for if anyone wants to do that and help people preparing exams, because in the market doesnt no exist anything like that.
Thanks spolfliet
I just found a neat little bit of code while browsing the em.dll.
In the RD TEST go to "About EM" type in 6814 and you will get the "+/others/EM_in_EM.xaml" menu. I have not really played around with this yet but it is the first time I have heard of this menu.
This also allows you to execute things like:
EM:ATCMD_REQUEST:
EM:ATCMD_GET:
EM:FILE_COPY:
EM:S_SWINFO;
EM:FLASH_LED_ON
EM:FLASH_LED_OFF
etc
You can also do EM:REGISTRY_SET:" + <path> + "," + <key> + "," + <data type, e.g. DWORD> + "," + <data> + "," + <path_type expressed as int> + ";", 1, false but it just seems to hang there. Trying to see if we can write to anything at all.
Also further look when I was HEX editing, there is a set button in the registry editor but forwhatever reason it is hidden. I need to find a way to actually de compile the dll's but it needs a CLI interpreter.
good find but what of the details I wonder...
MJCS said:
I just found a neat little bit of code while browsing the em.dll.
In the RD TEST go to "About EM" type in 6814 and you will get the "+/others/EM_in_EM.xaml" menu. I have not really played around with this yet but it is the first time I have heard of this menu.
This also allows you to execute things like:
EM:ATCMD_REQUEST:
EM:ATCMD_GET:
EM:FILE_COPY:
EM:S_SWINFO;
EM:FLASH_LED_ON
EM:FLASH_LED_OFF
etc
You can also do EM:REGISTRY_SET:" + <path> + "," + <key> + "," + <data type, e.g. DWORD> + "," + <data> + "," + <path_type expressed as int> + ";", 1, false but it just seems to hang there. Trying to see if we can write to anything at all.
Also further look when I was HEX editing, there is a set button in the registry editor but forwhatever reason it is hidden. I need to find a way to actually de compile the dll's but it needs a CLI interpreter.
Click to expand...
Click to collapse
good work, keep on truckin'! wish I could help but i know nothing...
raiderfan247365 said:
good work, keep on truckin'! wish I could help but i know nothing...
Click to expand...
Click to collapse
Thank you. I decompiled the entire EM application and am in the process of recompiling it to bypass a few restrictions with the current com dll. I might have native comm access working by the end of the week
You're my f***ing hero!
Please keep up the great work!
MJCS said:
Thank you. I decompiled the entire EM application and am in the process of recompiling it to bypass a few restrictions with the current com dll. I might have native comm access working by the end of the week
Click to expand...
Click to collapse
Hey I dont know if you are on Mango or Nodo but I still have a NoDo backup so if you need testing that cant be done on Mango let me know.
raiderfan247365 said:
Hey I dont know if you are on Mango or Nodo but I still have a NoDo backup so if you need testing that cant be done on Mango let me know.
Click to expand...
Click to collapse
Thanks. I might need that.
The SET button doesn't work even after being enabled. Are you refering to the EM (v1.12) in the new Mango FW (.219).
By the way, the details you listed were there right from beginning and is of no use until post nodo DVP update(EM app V1.10)..worth a try in V1.12, but i doubt.
I only had the nodo 1.10 version. I don't know how to extract the EM app.
MJCS said:
I only had the nodo 1.10 version. I don't know how to extract the EM app.
Click to expand...
Click to collapse
Then no dice..But you keep doing your work..Especially if you write any C level programming and use the IDA pro disassemblers, you might be lucky..
notebookgrail said:
Then no dice..But you keep doing your work..Especially if you write any C level programming and use the IDA pro disassemblers, you might be lucky..
Click to expand...
Click to collapse
Got it to compile. Need to get the 1.12 dll's now
** EDIT **
Oh dear god...it was version 0.26 :|.
Grrrr. Where would the EM App be located ine the file structure. \Windows\?
** EDIT **
I think this was actually created by Microsoft for Dell if you look at the signing and the properties of the dll. I wonder if that is why it is so locked down
MJCS said:
Got it to compile. Need to get the 1.12 dll's now
** EDIT **
Oh dear god...it was version 0.26 :|.
Grrrr. Where would the EM App be located ine the file structure. \Windows\?
** EDIT **
I think this was actually created by Microsoft for Dell if you look at the signing and the properties of the dll. I wonder if that is why it is so locked down
Click to expand...
Click to collapse
Every Native dll is signed by Microsoft TCB. As for the EM App, it would most likely be hidden in \Windows. I would try \Windows\EM_App.xap. You can always see if you can copy the \Windows\FieldTestApp.xap and open it up and see what you get. Alternatively, look at the WMAppManifest.xml within the EM App project and you should be able to more or less guess what the name of the .xap would be.
What about EM:FILE_COPY command? What does it do?
Strange, but it seems this command has only one argument like:
EM:FILE_COPY:\Update.log;
If I write command with more arguments like EM:REGISTRY_GET, for example:
EM:FILE_COPY:\Update.log,\UpdateApp2.log;
It will return FALSE, FILE_NAME_ERROR!