[Q]c# / development questions (background-img, checkbox) - Windows Phone 7 Q&A, Help & Troubleshooting

Hi
i work on my first app, the info-part is finished. now i want add a simple question/answer-part. the first part with button for answers and questions works fine, but with the checkboxes i have some problems.
i want two or three solutions for one question, wich can be choose if i am click on one of these checkboxes. the answer is showing up in MessageBox and work so far, but the checkbox don't be cleared!?
What i have to do, to clear the checkbox. please help me! i don't know so much about the source-code c#, so every explanation will help me! Thanks!
xaml.cs
Code:
private void checkBox6_Checked(object sender, RoutedEventArgs e)
{
MessageBox.Show("Richtig!");
checkBox6.?? = checkBox6.??;
}
private void checkBox7_Checked(object sender, RoutedEventArgs e)
{
MessageBox.Show("Richtig!");
checkBox7.?? = checkBox7.??;
}
xaml
Code:
<TextBlock Height="73" HorizontalAlignment="Left" Margin="13,489,0,0" Name="DerTextblock13" VerticalAlignment="Top" TextWrapping="Wrap" Width="436" FontSize="22">Question?</TextBlock>
<CheckBox Content="YES" Height="72" HorizontalAlignment="Left" Margin="5,518,0,0" Name="checkBox6" VerticalAlignment="Top" Checked="checkBox6_Checked" />
<CheckBox Content="NO" Height="72" HorizontalAlignment="Right" Margin="0,518,18,0" Name="checkBox7" VerticalAlignment="Top" Checked="checkBox7_Checked" />

Just need to change the IsChecked property.
checkbox6.IsChecked = false;

hi
thanks for your comment.. i have read and search about "checkbox6.IsChecked = false;" and test it, but it doesn't work. i got this error in attached image.. checkbox6 is in content not available, but there is in content the checkbox6 (Name="checkbox6" and Checked="checkBox6_Checked")..
so i still don't know, why i get this error.. sorry for my stupid question..

Control names are case sensitive. It should be checkBox6.IsChecked = false;

oh man, what a stupid error.. thanks, case sensitive was the right keyword!

how can i change background-image for other xaml-site
hi
i don`t want open a new thread, so i ask here.
new problem! how can i change the background-image for an other xaml-site?
i searched a lot and find a lot, but nothing show me exactly how i can realize this.
in the source-code below, you see that i can change the background-image for example on mainpage.xaml.
Now i want integrate in my setting.xaml and settings.xaml.cs the same checkboxes to change the background-image on the mainpage.xaml.
What i have to do? Thanks for help!
xaml.cs
Code:
private void checkBox2_Checked(object sender, RoutedEventArgs e)
{
Uri uriR = new Uri("image/angler.png", UriKind.Relative);
BitmapImage imgSource = new BitmapImage(uriR);
this.imagechange.Source = imgSource;
checkBox1.IsChecked = false;
}
private void checkBox1_Checked(object sender, RoutedEventArgs e)
{
Uri uriR = new Uri("image/new-background.png", UriKind.Relative);
BitmapImage imgSource = new BitmapImage(uriR);
this.imagechange.Source = imgSource;
checkBox2.IsChecked = false;
}
xaml
Code:
<CheckBox Content="Hintergrund" Height="72" Margin="54,-33,0,0" Name="checkBox2" Checked="checkBox2_Checked" Width="163" FontSize="18" />
<CheckBox Content="Hintergrund 2" Height="72" Margin="0,-33,49,0" Name="checkBox1" Checked="checkBox1_Checked" Width="187" FontSize="18" />

Well done very good

Not sure if it's the best way, but one option would be to store the value you want to use in IsolatedStorageSettings. Then, when the page loads, it checks the value in ISS and applies that background (in its OnNavigatedTo event handler is probably best).

GoodDayToDie said:
Not sure if it's the best way, but one option would be to store the value you want to use in IsolatedStorageSettings. Then, when the page loads, it checks the value in ISS and applies that background (in its OnNavigatedTo event handler is probably best).
Click to expand...
Click to collapse
thanks, i have found a code to read an image in IsolatedStorage.. see below..
but i got a error.. i found a example-project, all works fine and i can read a image-file from IsolatedStorage. but in my app it doesn't work and i got these error..
also i had added the namespaces in xaml.cs
using System.IO.IsolatedStorage;
using System.IO;
xaml.cs
xaml-code
Code:
<Image x:Name="imagechange" Margin="30,62,38,204" Stretch="Fill" />
<Button Content="lesen" Height="72" HorizontalAlignment="Left" Margin="269,533,0,0" x:Name="lesen" VerticalAlignment="Top" Width="160" FontSize="19" Click="lesen_Click" />
vs 2010 are showing no faults in debugmodus! But if i click on button "lesen", i got the attached error. Please, where is the fault or what i have to do now?

does anyone has a idea about my described problem. sorry for my stupid questions, but that's all new for me and i want to learn it..

Do you have actual file "logo.jpg" on your ISF? Insert before opening:
if (myIsolatedStorage.FileExists("logo.jpg"))
{
... your code ...

sensboston said:
Do you have actual file "logo.jpg" on your ISF? Insert before opening:
if (myIsolatedStorage.FileExists("logo.jpg"))
{
... your code ...
Click to expand...
Click to collapse
hi
i had added your comment to source-code.. now, nothing happen, if i click on the button for reading the file from isolated storage..
how can i add the file "logo.jpg" to isolated storage?? i thought, i only have to put the file to my current project, like i did it with other images and then i can save or read the file to isolated storage.
I think this must be the fault. How can manage it? thanks..
Code:
private void lesen_Click(object sender, RoutedEventArgs e)
{
BitmapImage bi = new BitmapImage();
using (IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication())
{
if (myIsolatedStorage.FileExists("logo.jpg"))
using (IsolatedStorageFileStream fileStream = myIsolatedStorage.OpenFile("logo.jpg", FileMode.Open, FileAccess.Read))
{
bi.SetSource(fileStream);
this.imagechange.Height = bi.PixelHeight;
this.imagechange.Width = bi.PixelWidth;
}
}
this.imagechange.Source = bi;
}

jayjojayson said:
i had added your code in comment to source-code.. now, nothing happen, if i click on the button for reading the file from isolated storage..
how can i add the file "logo.jpg" to isolated storage??
Click to expand...
Click to collapse
You may try to:
- download image from network and save to isf;
- copy from resource stream to isf;
- manually upload file to the app ISF using ISETool.exe or third-party tool.
jayjojayson said:
i thought, i only have to put the file to my current project, like i did it with other images and then i can save or read the file to isolated storage.
Click to expand...
Click to collapse
Wrong assumption.
P.S. Try this (btw, it's a first google link!): http://technodave.wordpress.com/201...ge-for-local-html-content-on-windows-phone-7/

hi
thanks a lot, it works... the first comment you have written are right..
i only have to save it first to isolated storage, before i can read the file.
thanks for your explanation to add files to ISF.. i have serach for that topic, but found nothing that describe how to added to ISF.. thanks for the link... i will read this in the evening...
now i have to find out, how i can change a image on a other site(xaml). than i can change for example in my setting.xaml the background in the mainpage.xaml
every day i learn new things, that's really exciting...

jayjojayson said:
now i have to find out, how i can change a image on a other site(xaml). than i can change for example in my setting.xaml the background in the mainpage.xaml
Click to expand...
Click to collapse
Sorry, I didn't read the whole thread before answering; seems like you are digging in the wrong direction. You don't need to use ISF (but it was a good practice for you), all you need is just a dynamical binding.
I'm too lazy to type code sample for you but (he-he!), our good friend google.com returned a good link for you http://www.eugenedotnet.com/2011/05...-property-in-silverlight-and-windows-phone-7/
P.S. Experience to use google should be "the must" in developer's experience.

entry Text in new line
Hi
i use google, my best friend, for a lot of my questions. but sometimes i don't know the right searchkeywords to do what i want to do (like image binding).
i have a new small problem. in my app i have 4 textboxes, that i use to write in some data. These 4 textboxes, i write to isolated storage in a textfile and let them summarized showing up in a textblock. This works fine.
Now, if i want write a new entry, these entry is written directly after the first entry.
example like is insert in textblock
Code:
▷Text - Text - Text - Text| ▷Text - Text - Text - Text|
But i want that the entry is written in a new line? How can i do this?
example like i want it
Code:
▷Text - Text - Text - Text|
▷Text - Text - Text - Text|
i know that i can create new lines with \n , \r\n and Environment.NewLine.
Code:
IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication();
//create new file
using (StreamWriter writeFile = new StreamWriter(new IsolatedStorageFileStream("fangbuch.txt", FileMode.Create, FileAccess.Write, myIsolatedStorage)))
{
string someTextData = text.Text + "▷" + datum.Text + " - " + fisch.Text + " - " + größe.Text + "cm" + " - " + gewicht.Text + "Kg" + " | " + "\r\n";
writeFile.WriteLine(someTextData);
writeFile.Close();
}
if i use one of the elements to create a new line, like is showing in code above, the new (second) entry overwrite the first entry. What can i do now? thanks for your help.

You're using FileMode.Create, which will overwrite an existing file. You need to either use FileMode.OpenOrCreate and then seek to the end of the file, or you need to use FileMode.Append (this is the preferred approach).
Additionally, the StreamWriter.WriteFile function automatically appends a newline for you. There's no need to have them manually placed at the end of your text string.
http://msdn.microsoft.com/en-us/library/system.io.filemode.aspx

Related

[Q] Load SQLite DB

I have SQLite DB file. I copy him to StorageFile and open it by SQLite
Code:
...............................
using SQLiteClient;
using Community.CsharpSqlite;
namespace PhoneApp1
{
public partial class MainPage : PhoneApplicationPage
{
// Конструктор
private string fileName = "DB";
public MainPage()
{
InitializeComponent();
IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication();
System.IO.Stream src = Application.GetResourceStream(new Uri(fileName, UriKind.Relative)).Stream;
IsolatedStorageFileStream dest = new IsolatedStorageFileStream(fileName, System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.Write, store);
src.Position = 0;
CopyStream(src, dest);
dest.Flush();
dest.Close();
src.Close();
dest.Dispose();
IsolatedStorageFile tmp= IsolatedStorageFile.GetUserStoreForApplication();
if (!tmp.FileExists(fileName))
{
return;
}
SQLiteConnection db = new SQLiteConnection(fileName);
try
{
db.Open();
SQLiteCommand cmd = db.CreateCommand("SELECT * FROM table");
var lst = cmd.ExecuteQuery<Test>();
ApplicationTitle.Text = "Selected " + lst.ToList().Count + " items\r\nTime ";
}
catch (SQLiteException ex)
{
ApplicationTitle.Text = "Error: " + ex.Message;
}
}
private static void CopyStream(System.IO.Stream input, IsolatedStorageFileStream output)
{
byte[] buffer = new byte[32768];
long TempPos = input.Position;
int readCount;
do
{
readCount = input.Read(buffer, 0, buffer.Length);
if (readCount > 0)
{
output.Write(buffer, 0, readCount);
}
} while (readCount > 0);
input.Position = TempPos;
}
}
public class Test
{
public Test()
{
}
int _id;
public int id
{
get { return _id; }
set { _id = value; }
}
}
}
Result : ApplicationTitle = unable to opendatabase file.
Why? Plz help.
Probably because you doing something wrong, for example, opening SQLiteConnection
Seems like correct syntax should be
Code:
new SqliteConnection("Version=3,uri=file:db")
Download and try source code from http://wp7sqlite.codeplex.com/SourceControl/list/changesets#
error "Couldn't open database file version=3,urlB"
file DB i created from command "backup DB File". It's right?
I have no idea what kind of file do you have. I just downloaded and ran example from sources mentioned above and it works fine (but with few assertions). BTW you should have a complete source code of SQLite, just debug into SQLite procedures and check what's wrong.
Example work fine. I want read database from project file (Content).He isn't located in StorageFile. I use him after i'm saving myfile to StorageFile .
evgen_wp said:
Example work fine. I want read database from project file (Content).He isn't located in StorageFile. I use him after i'm saving myfile to StorageFile .
Click to expand...
Click to collapse
I already understood you. Add your code (to save database file from resource stream to isf) to example, and test conn.Open() call using F11 (Step Into). You'll see what's wrong. I don't have your database file and have no idea what did you put inside
File did not have time to create. It is ... work now.he can open empty file but can't open file with data
P.S. I use Sqlite Client for Windows Phone from http://sqlitewindowsphone.codeplex.com/
Why don't you use another codeplex project I've posted above? It works fine for me (tested because of your question).
P.S. Don't forget to push "Thanks" button. It's not a paid Microsoft customer service and I'm not your support guy.

broodROM RC5 UsbSettings force close

Hi to everyone,
I would like to reply to this post about a force close entering the UsbSettings in broodRom RC5 rev 1 & 2(prerelease).
Specifically the exception is this: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.settings/com.android.settings.UsbSettings}: java.lang.NumberFormatException: unable to parse '' as integer
Unfortunately I'm not able to post there since I've just registered my accout; I hope this is the best section to post and that someone will notice it anyway.
After a couple of hours of serious digging I found that the problem depends on the fact that build prop lacks:
Code:
persist.service.usb.setting=0
which sets the default mode (kies) for usb.
that value is requested by com.android.settings.UsbSettings.onCreate of Settings.apk
Code:
protected void onCreate(Bundle paramBundle)
{
super.onCreate(paramBundle);
int i = Integer.parseInt(SystemProperties.get("persist.service.usb.setting"));
this.mUSB_mode = i;
---cut---
restoring the above line in build prop fixes the issue!
yota73 said:
Hi to everyone,
I would like to reply to this post about a force close entering the UsbSettings in broodRom RC5 rev 1 & 2(prerelease).
Specifically the exception is this: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.settings/com.android.settings.UsbSettings}: java.lang.NumberFormatException: unable to parse '' as integer
Unfortunately I'm not able to post there since I've just registered my accout; I hope this is the best section to post and that someone will notice it anyway.
After a couple of hours of serious digging I found that the problem depends on the fact that build prop lacks:
Code:
persist.service.usb.setting=0
which sets the default mode (kies) for usb.
that value is requested by com.android.settings.UsbSettings.onCreate of Settings.apk
Code:
protected void onCreate(Bundle paramBundle)
{
super.onCreate(paramBundle);
int i = Integer.parseInt(SystemProperties.get("persist.service.usb.setting"));
this.mUSB_mode = i;
---cut---
restoring the above line in build prop fixes the issue!
Click to expand...
Click to collapse
Thanks! , I saw it before but didn't knew if this was the right fix^^
thanks for the solution..im sorry but im newbie but where to locate that in the script manager?im still learning about this android..thanks
The file is /system/build.prop, you need to be root to edit it and to mount /system read write.
Both things are enabled by default in broodrom, and any detail can be easily found by searching the forum.
Please note that this has nothing to do with scriptmanager and is best achieved though ADB.
If you have not the android SDK installed, maybe it would be better if you just wait Rev 2, which hopefully will integrate the fix
Colors fixes
Hi brood,
still posting here until I (if ever) reach 10 posts.
I've managed to fix color-issue (at least for most colors) in your rom by editing the twframework-res.apk.
It seems that samsung apps are using it instead of framework-res.apk.
The quickest way to improve the situation is modify .xmls that are using tw_color002 to use tw_color001 instead.
As you can see in /res/values/colors.xml tw_color002 is black while tw_color001 is white.
Obviously there is not one unique solution, but is more a matter of choosing the right palette to fit with the dark theme, either by changing color reference in each xml or by changing them all at once in /res/values/colors.xml
I hope this can help!

Detection of key-pressing at boot-time.

Hi good people of N7 land,
I wanted to ask if it's possible to make keys get detected at boot-time so that a certain function is carried out. If so how?
For example:
The N7 is booting up. I press the Vol + key, and due to a script executed by the init.delta.rc, /system is mounted to a IMG file in the sdcard. A dual-boot mod.
I also ask if this is the best way to do this, and please for the love of God, don't point me to MultiROM. I want to work on my own mod.
I expect helpful answers. And if you can't answer my question, don't even bother posting here.
Although this is a question, this is more dev-related than anything I've encountered in the Q/A section. So I thought of posting it here.
Please move this if this is not the right place, and accept my apologies.
sgt. meow
I don't think this is possible using just some script - init has no way to get input events from keys, so you would have to either edit the init binary or use exec init command.
You could use it to run another binary, which would check if volwhatever is pressed and either did nothing or did the dual-boot stuff.
It depends on when you want to check for the keypress, because if it is after the /system partition is mounted, you could use busybox and run bash script, otherwise it would have to be real binary, because when init is started, you have pretty much "just" kernel running and no userspace.
Or you could pack busybox to boot.img, but if you can code, the binary is pretty easy to make.
@up
Exactly the kind of answer I was hoping to find. Sucks to realize that I still don't know a lot of coding. But I'm willing to learn if you could point me to the right direction.
sgt. meow said:
Hi good people of N7 land,
I wanted to ask if it's possible to make keys get detected at boot-time so that a certain function is carried out. If so how?
For example:
The N7 is booting up. I press the Vol + key, and due to a script executed by the init.delta.rc, /system is mounted to a IMG file in the sdcard. A dual-boot mod.
I also ask if this is the best way to do this, and please for the love of God, don't point me to MultiROM. I want to work on my own mod.
I expect helpful answers. And if you can't answer my question, don't even bother posting here.
Although this is a question, this is more dev-related than anything I've encountered in the Q/A section. So I thought of posting it here.
Please move this if this is not the right place, and accept my apologies.
sgt. meow
Click to expand...
Click to collapse
The first idea that comes to my mind would be to code a simple no-UI app which would use a Service executed by a BroadCastReceiver set to BOOT_COMPLETED.
Then, when triggered (=at boot-time), the service would wait for the user to press a defined key (i.e : volume up). When the service receives the key press, it would mount /system or whatever you wanna do, then stop running (so that other volume up presses don't trigger this event again).
The code could be something like :
Your AndroidManifest.xml :
Code:
< ?xml version="1.0" encoding="utf-8"?>
< manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sgtmeow.boot.service"
android:versionCode="1"
android:versionName="1.0">
< uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
< application android:icon="@drawable/icon" android:label="@string/app_name">
< service android:name=".BootService">
< intent-filter>
< action
android:name = "com.sgtmeow.boot.service.BootService">
< /action>
< /intent-filter>
< /service>
< receiver android:name=".BootReceiver">
< intent-filter>
< action
android:name ="android.intent.action.BOOT_COMPLETED">
< /action>
< /intent-filter>
< /receiver>
< /application>
< uses-sdk android:minSdkVersion="8"
android:targetSdkVersion="17"android:targetSdkVersion="17" />
< /manifest>
BootReceiver.java :
Code:
package com.sgtmeow.boot.service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
public class BootDemoReceiver extends BroadcastReceiver {
@Override
public void onReceive(final Context context, final Intent bootintent) {
Intent mServiceIntent = new Intent();
mServiceIntent.setAction("com.sgtmeow.boot.service.BootService");
context.startService(mServiceIntent);
}
}
BootService.java
Code:
package com.sgtmeow.boot.service;
import java.io.DataOutputStream;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;
import android.view.KeyEvent;
import com.sgtmeow.boot.service.BootReceiver;
public class BootService extends Service {
Runtime mRuntime;
Process mProcess = null;
DataOutputStream mOutput = null;
@Override
public IBinder onBind(final Intent intent) {
return null;
}
@Override
public void onCreate() {
super.onCreate();
}
public boolean onKeyDown(int keyCode, KeyEvent event) {
super.onKeyDown(keyCode, event);
if (keyCode == KeyEvent.KEYCODE_VOLUME_UP) {
mountSystem();
Log.w("SGT.MEOW", "Volume Up has been pressed");
return true;
}
return true;
}
public void onStartCommand(final Intent intent, final int startId) {
super.onStartCommand(intent, startId, startId);
mountSystem();
}
private void mountSystem() {
Runtime.getRuntime();
// The service is now started, ask for root and mount /system using
// busybox (or not)
try {
mProcess = mRuntime.exec("su");
mOutput = new DataOutputStream(mProcess.getOutputStream());
mOutput.writeBytes("busybox mount -o remount,rw /system");
mOutput.flush();
stopService(new Intent(BootService.this, BootReceiver.class));
} catch (Exception e) {
Log.e("SGT.MEOW", "An Error Has Occured", e);
e.printStackTrace();
}
}
}
EDIT : unfortunately after some research I found out that Services cannot act as an onKeyListener, you'll have to call an activity to actually listen to the keypress so maybe just a dialog or something, but you won't be able to do it completely UI-less this way, my bad.
This is not something i would attempt to if you dont know what your doing due to the chance of bricks. but your best bet would be to luanch a binary from early init in the ram disk
aaronpoweruser said:
This is not something i would attempt to if you dont know what your doing due to the chance of bricks. but your best bet would be to luanch a binary from early init in the ram disk
Click to expand...
Click to collapse
I know how to launch the binary during init. The binary is the problem I am running into.
Thanks though.
You might want to take a look at how custom recoveries on the Xperia T handles the initial recovery vs. boot selection. On that device, there is no recovery partition, so a single kernel image must support both recovery and normal operation. The bootloader doesn't support an "enter recovery" poweron keycombo, so on the T there are some tricks so that at boot, it:
Sets the LED to purple
Waits 3 seconds or so
If the VolUp key is pressed during those 3 seconds, boot to recovery
Otherwise, boot normally
I believe the same approach is also used on the Xperia Z.
Maybe you could have a custom recovery that allows this? TWRP and CWM Touch both have source code available that you can check out so you can make your own recovery, which could allow booting of separate ROMS. Recoveries generally boot faster than full ROMs.
That's not what I was aiming to achieve. If I can manage to map the keys and find a way to detect them at boot-time, the rest is easy as pie. . Thanks though.
Entropy512 said:
You might want to take a look at how custom recoveries on the Xperia T handles the initial recovery vs. boot selection. On that device, there is no recovery partition, so a single kernel image must support both recovery and normal operation. The bootloader doesn't support an "enter recovery" poweron keycombo, so on the T there are some tricks so that at boot, it:
Sets the LED to purple
Waits 3 seconds or so
If the VolUp key is pressed during those 3 seconds, boot to recovery
Otherwise, boot normally
I believe the same approach is also used on the Xperia Z.
Click to expand...
Click to collapse
sgt. meow said:
That's not what I was aiming to achieve. If I can manage to map the keys and find a way to detect them at boot-time, the rest is easy as pie. . Thanks though.
Click to expand...
Click to collapse
None of the phones made by Sony have a recovery partition so they have to use a work around to detect keys on boot up. This is what all Xperia devices do to get into recovery: on boot check to see if the desired key is being pressed and if it is unzip the recovery, if it isn't being pressed unzip the normal ramdisk. (I'll post the ramdisk here for you to see how everything works yourself) So with the Xperia Play CyanogenMod kernel that I have how it works is it has two .cpio files. One for the ramdisk and one for the recovery. It uses a .sh file in the sbin to check if keys are being pressed by using /dev/input/event# which in most cases is event1 for volume down (on Nexus 7 the is event0, event1, and event2. My guess is 0 = power button and one and two are vol + and vol -). It then has a link to the init.sh in the root of the ramdisk called init so that when the kernel starts and calls init it starts the script. So what you could do is the same but instead of having two .cpio files you could rename the init file to something else then place the script and link in your ramdisk so that when the key is pressed it calls both what you want to do and the rename init executable. (Not sure how well this would work this is just an idea, if not depending on what you want to do you can keep the compressed ramdisk idea...)
Here is a ramdisk of what I've been talking about that is pulled from my kernel (extracted from an already compiled kernel to make it easy read.):
Link
It's made for the Xperia Play so it also tries to start the LED and vibrator to tell you when to click the Vol - key so how you would tell people to click it on the Nexus 7 I'm not sure...probably just have to have people will just have to spam the key. If you have any questions feel free to ask or if this didn't help I'm sorry just an idea.
Also what it seems like you want to do with the dual boot mod being with the SDCard sounds a lot like what a guy named CosmicDan did on the Xperia Play. You had to change the updater-script in your flashable zip but it worked. Here is the thread: Turbo Kernel and the source code to his kernel: GitHub
I know what he did with his kernel. I am working on something similar to the HD2 dual boot method. Haven't had any success yet.
Sent from my Nexus 7 using xda app-developers app
sgt. meow said:
I know what he did with his kernel. I am working on something similar to the HD2 dual boot method. Haven't had any success yet.
Sent from my Nexus 7 using xda app-developers app
Click to expand...
Click to collapse
hi! were you able to solve this?
thanks!

[PC][WINDOWS] ANDROID LOCALIZER - Translate Android App Easy

ANDROID LOCALIZER
{
"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"
}
NOTES:
Translating Android App Is Hard And Long Process
I Will Present You This App Which Can Help You To Do Basic Translation Progress Faster And More Accurate.
Purpose Of This App Is Basic Translation Job - For Disassembling And Assembling Android APK Files You Must Use Other Tools Like APK Tool
This App Is Originally Maded By Crew From ArtfulBits Team And All Credits Are Going To Them.
I'm Not responsible For Any Eventual Errors And Misbehaving Of Your Devices.
Big Thanks To ArtfulBits - Creator Of Android Localizer
【Software Information】
Software Name:Android Localizer
Version Information:1.5
Version Size:0.2 MB
Applicable Models / Systems:MS Windows PC - Windows Os Xp/Vista/7/8
Playstore Link:No Playstore/PC Software/Developer Website:http://www.artfulbits.com/products/free/ailocalizer.aspx
【Software】
Features
Automatic Translate (Google Translate)
Google Translate works now over JSON
Grid font become changeable
Stability improved
Remember last opened application for localization
Create new localization folder by copying "original" values
Edit values
Edit arrays
Save result in XML with original localization in comments
Create backup file of localization
Browsing in localization XML as in folders structure
Add localization key or array item
Delete XML files directly from GUI
FAQ:
Q: How auto translation works?
A: Select elements in grid which you want to translate and press "Auto translate" button on toolbar. If language on which you are working known to Google Translate service then application will start in background element by element translate selections. In any moment you can cancel that operation.
Q: After translation instead of unicode symbols I saw white boxes, what to do?
A: That often happens due to usage of fonts that does not support properly you localization symbols. To solve this open "Options" of application and change font to proper one. Application will remember your choice for future.
Q: Application fails all the time, what to do?
A: Application on fall shows message box to you and save the same information into LOG file. LOG file can be found in application folder. Please send us that LOG file and we will try to fix problem ASAP.
Q: How to create skipped elements?
A: At the current moment application does not support <skip/> tag. You should wait next release or modify sources of the project;
Q: Application searching for "notepad++.exe", but I don't have it. How to fix that?
A: You have two choices. change external editor settings or install Notepad++, First: Application has "aiLocalization.exe.config" file; In it you have to find section "ExternalEditor" and place there editor on your choice. Second: go by link Notepad++ and download it.
Q: I saw that application has customized Copyright in output XML. How to change it?
A: You have to edit application configuration file "aiLocalization.exe.config" and find in it section "Copyright".
Q: I set application folder correctly but tool does not recognize my Android project, what to do?
A: Application is searching for "AndroidManifest.xml" file in project. If application can not find it then it think that project does not belong to Android sources at all. So please check file existence.
【Update log】
1.5:
Automatic Translate (Google Translate)
Google Translate works now over JSON
Grid font become changeable
Stability improved
【Software screenshot】
【Software Download】
View attachment 2327641
Getting the following error while trying auto translate
---------------------------
Error
---------------------------
Error reading JObject from JsonReader. Current JsonReader item is not an object: StartArray
\
coolgal302006 said:
Getting the following error while trying auto translate
---------------------------
Error
---------------------------
Error reading JObject from JsonReader. Current JsonReader item is not an object: StartArray
\
Click to expand...
Click to collapse
Try To Redownload Software Aggain - Attachment Changed.
BalcanGSM said:
Try To Redownload Software Aggain - Attachment Changed.
Click to expand...
Click to collapse
same error throw Error reading JObject from JsonReader. Current JsonReader item is not an object: StartArray when i click auto translate
billy_cater said:
same error throw Error reading JObject from JsonReader. Current JsonReader item is not an object: StartArray when i click auto translate
Click to expand...
Click to collapse
Make Sure You Have Installed Latest Java JRE & JDK Packages Although With .Net Frameworks 3.5 & 4.5
The app is unable to show "values" folder. Only "values-xxx" is shown. An fix for this?
Also, will this going to be open source? I'm interested in this.
billy_cater said:
same error throw Error reading JObject from JsonReader. Current JsonReader item is not an object: StartArray when i click auto translate
Click to expand...
Click to collapse
Same error as this guy. Have the latest software as you stated.
BalcanGSM said:
Make Sure You Have Installed Latest Java JRE & JDK Packages Although With .Net Frameworks 3.5 & 4.5
Click to expand...
Click to collapse
JRE 1.7.0.25-b17, JDK 1.7 , .NET FRAMEWORKS 4.5 win8 64bit sir
Thanks,this is the what I needed
frenzyboi said:
The app is unable to show "values" folder. Only "values-xxx" is shown. An fix for this?
Also, will this going to be open source? I'm interested in this.
Same error as this guy. Have the latest software as you stated.
Click to expand...
Click to collapse
Unfortunately I got the same error, even that I've followed OP instructions.
Hi:
I get the following error while trying to save the translated file:
Can not save file due to error: An XML comment cannot contain '--', and '-' cannot be the last character. Do you want to save file into another location?
And two buttons with yes and no. On clicking yes, I try to save it to another location, but keep getting the same error.
Thanks for your help!
billy_cater said:
same error throw Error reading JObject from JsonReader. Current JsonReader item is not an object: StartArray when i click auto translate
Click to expand...
Click to collapse
Change link
http://translate.google.com/translate_a/t?client=t&sl=en&tl={1}&text={0}
with
http://translate.google.com/translate_a/t?client=j&sl=en&tl={1}&text={0}
---------- Post added at 06:32 PM ---------- Previous post was at 06:22 PM ----------
Can't save file because reader is not closed.
In MainForm.LoadDocuments() add
reader.Close();
at line 700
---------- Post added at 07:25 PM ---------- Previous post was at 06:32 PM ----------
Translation did not work on multiple sentences and didn't remove heading and trailing quotes. I've modified the code.
Code:
public static string TranslateText( string textToTranslate, string abbr )
{
string strLangPair = string.Format( "en|{0} ", abbr );
// generate google translate request
// http://translate.google.com/translate_a/t?client=j&sl=en&tl=ru&text=some%20text
string url = String.Format( "http://translate.google.com/translate_a/t?client=j&sl=en&tl={1}&text={0}",
textToTranslate, abbr );
WebClient webClient = new WebClient();
byte[] resultBin = webClient.DownloadData( url );
string charset = webClient.ResponseHeaders[ "Content-Type" ];
charset = charset.Substring( charset.LastIndexOf( '=' ) + 1 );
Encoding transmute = Encoding.GetEncoding( charset );
string result = transmute.GetString( resultBin );
// find result box and get a text
JObject item = JObject.Parse( result );
JToken token = item[ "sentences" ];
String translation = string.Empty;
foreach (JToken childToken in token)
{
string phrase = childToken["trans"].ToString();
translation += phrase.TrimStart('"').TrimEnd('"');
}
return translation;
}
Tostis said:
Change link
http://translate.google.com/translate_a/t?client=t&sl=en&tl={1}&text={0}
with
http://translate.google.com/translate_a/t?client=j&sl=en&tl={1}&text={0}
---------- Post added at 06:32 PM ---------- Previous post was at 06:22 PM ----------
Can't save file because reader is not closed.
In MainForm.LoadDocuments() add
reader.Close();
at line 700
---------- Post added at 07:25 PM ---------- Previous post was at 06:32 PM ----------
Translation did not work on multiple sentences and didn't remove heading and trailing quotes. I've modified the code.
Code:
public static string TranslateText( string textToTranslate, string abbr )
{
string strLangPair = string.Format( "en|{0} ", abbr );
// generate google translate request
// http://translate.google.com/translate_a/t?client=j&sl=en&tl=ru&text=some%20text
string url = String.Format( "http://translate.google.com/translate_a/t?client=j&sl=en&tl={1}&text={0}",
textToTranslate, abbr );
WebClient webClient = new WebClient();
byte[] resultBin = webClient.DownloadData( url );
string charset = webClient.ResponseHeaders[ "Content-Type" ];
charset = charset.Substring( charset.LastIndexOf( '=' ) + 1 );
Encoding transmute = Encoding.GetEncoding( charset );
string result = transmute.GetString( resultBin );
// find result box and get a text
JObject item = JObject.Parse( result );
JToken token = item[ "sentences" ];
String translation = string.Empty;
foreach (JToken childToken in token)
{
string phrase = childToken["trans"].ToString();
translation += phrase.TrimStart('"').TrimEnd('"');
}
return translation;
}
Click to expand...
Click to collapse
sir,where can i find that line and change as you ask i do not know how to edit exe file
billy_cater said:
sir,where can i find that line and change as you ask i do not know how to edit exe file
Click to expand...
Click to collapse
You should download sources from official site.
You need Visual Studio to edit sources and recompile the application. You can't edit exe file!
billy_cater said:
same error throw Error reading JObject from JsonReader. Current JsonReader item is not an object: StartArray when i click auto translate
Click to expand...
Click to collapse
Gotten the same error, Can someone make the change and upload it again please?
Which folder have to choose from browse tab? I', confused. Its saying invalid path
I have complied and improved it a little bit
mrjoy said:
Which folder have to choose from browse tab? I', confused. Its saying invalid path
Click to expand...
Click to collapse
hi, I have introduced the modifications and another useful thing, the text path for locating the decompiled apk folder. So this way one can copy and paste the path, which normally is tedious to find by browsing.
I have tried and it translates very well, congrats to the developers!!
Hope it can be helpful
ertioct said:
hi, I have introduced the modifications and another useful thing, the text path for locating the decompiled apk folder. So this way one can copy and paste the path, which normally is tedious to find by browsing.
I have tried and it translates very well, congrats to the developers!!
Hope it can be helpful
Click to expand...
Click to collapse
It would have been nice if you also provided the modified source files for download.
Besides that, it is pretty sad that xml tags are not really preserved. For example: the tag formatted="false" is not kept.
This can be really annoying.
What kind of license does it have? Maybe i can upload modified sources on google code like site?
How to auto - translate Portuguese ? Appears only symbols
crash on some apk files
example : line
thanks bro

[Automation Tool] [Java] [WIP] [Tutorials] Selenium [RHBROMS]

{
"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"
}
SELENIUM by Ravi H Basawa​
This will be a Full Tutorial on Selenium Automation Tool
I will be updating this thread as I get time. SO NO ETA's.
Click to expand...
Click to collapse
If anybody wants to use / copy this tutorial to their Website or Blog please feel free to contact me at my personal email id: [email protected]
or at our official Website: www.rhbroms.com
Click to expand...
Click to collapse
Please Click on Thanks button if this tutorial by me had helped you for some extent !!!
Click to expand...
Click to collapse
Contents:
1. What is Selenium?
2. What all we need before we get it started?
3. How to setup Selenium for Eclipse?
4. Simple Selenium Test Script for google.co.in
5. Execution using Junit
5a. Execution using TestNG
6. DataDriven Testing using POI jar files
7. Issues or challenges with Selenium
Credits:
@Swaroop Bandagadde
My Other Works:
1. ROBOTIUM AUTOMATION TOOL
2. MONKEYRUNNER AUTOMATION TOOL
Selenium
1. What is Selenium?​
Selenium is an open source ( It's free !!!!) automation testing tool used for automating websites under any browser(not all).
Selenium supports the following browsers: IE, FireFox(Default), Chrome, Safari, Opera.
We write Selenium WebDriver Scripts in Eclipse. These scripts are written in Java language.
Things that you should be good at Java are: Constructors, Overriding, Overloading, Constructor Chaining, Interface, Inheritance, Abstract Class and UpCasting - DownCasting concepts are enough to write Selenium WebDriver Script.
What all we need before we get it started?
2. What all we need before we get it started?​
1. Windows 7 / 8
2. Java
3. Eclipse ((Juno or ADT) what I have worked on !! )
4. selenium-server-standalone-2.38.0
5. TestNG plugin for Eclipse
6. POI jar files
Downloads:
POI jar files: POI.zip
Selenium Jar file
How to setup Selenium for Eclipse?
3. How to setup Selenium for Eclipse?​
1. Open Eclipse goto Help -> Install new software.. -> give work with edittext field value as " TestNG - http://beust.com/eclipse " -> select all -> Next -> Finish
2. when you create a new test project inside its build path add selenium webdriver jar files. I will show it in next chapter.
4. Simple Selenium Test Script for Google website
4. Simple Selenium Test Script for Google website ​
1. Create new java project with name Selenium Test as shown below:
2. Now we have to add the selenium Jar file to the build path ( Goto project -> Properties -> Java Build path ) as shown in below screen shot and add the downloaded selenium-server-standalone-2.38.0.jar file. by clicking on the add external Jar's button. After this goto "Order and Export" tab click on "Select All" button and click "ok" button.
3.After completion of the above step now create a new java class ( Goto Project -> New -> Class) as shown in below ss and give name as TestWebDriver
4. After this now we will write a code to open Mozilla FireFox Browser and also open Google website inside it. The code for this is as below:
package com.rhb.selenium; // package name what I have given. It can differ with yours
import org.openqa.selenium.WebDriver; // Automatically imported by eclipse [This is for invoking the WebDriver class from selenium API]
import org.openqa.selenium.firefox.FirefoxDriver; // Automatically imported by eclipse [This is for invoking the FireFoxDriver class from selenium API]
public class TestWebDriver {
static WebDriver driver = null; // initialization
//the below method is made static to call this method inside our package without creating any instance for it.
public static void setup(){
driver = new FirefoxDriver(); // inbuilt method called from selenium class
driver.get("http://www.google.co.in"); // opens the website which is written inside the braces.
}
}
Click to expand...
Click to collapse
5. Now Lets create another java class called FunLib and inside this what we do is we will try to enter some text into the edit text box of the Google website and also we will click on the search button. the code for this is as below:
import org.openqa.selenium.By;
public class FunLib extends TestWebDriver {
public static void Search() throws InterruptedException {
driver.findElement(By.xpath("//div[@id='hplogo']")).click(); // clicks on the Google Logo
Thread.sleep(3000); // sleeps for 3000 milliseconds
driver.findElement(By.xpath("//input[@name='q']")).sendKeys("RHBROMS"); // type as RHBROMS in the edit text field
driver.findElement(By.xpath("//button[@id='gbqfb']")).click(); // Click on the Search button
Thread.sleep(3000); // again sleeps for 3000 milliseconds
driver.findElement(By.xpath("//li[1]/div/div/h3/a")).click(); // Click on the first link that is rhbroms.com
System.out.println("button got clicked"); // displays the msg on console.
}
}
Click to expand...
Click to collapse
6. Okay now you might be thinking as how to identify the edit text field as well as other elements.!! Its easy for that we need some Extensions for FireFox they are as below:
7. After installing these Extensions we now see how to use them to Identify the objects. Thing is we don't use all these but some, It again depends on which tool u want to use!!. which one is best for you.
8. First I will show you how to Identify the Google Logo by using Xpath. To do this open FireFox and open Google website and right click on Google Logo and select View XPath. After this you will see something like as shown below:
9. As you can see from the image as XPath is given as : id('hplogo') but thing is how to use this in our code.. Simple just add the tag type in this case it is <div> (The <div> tag defines a division or a section in an HTML document.) the changes what u have to do is as shown in below Screen Shot.
10. Now the same goes for other objects too..!! If you find any doubts on this feel free to ask me by either commenting here or by emailing me.
11. Now we will see how to execute our first Automation Script in the next chapter.
5. Execution using Junit and TestNG
5. Execution using Junit ​
1. First we will see how to execute our script via JUnit Suit.
2. Let us create a new JUnit test case (project -> New -> Junit test case) as shown in below screen shot:
3. Now let us give the Junit test case name as "Junit" as shown below in the screen shot. NOTE: Uncheck setup and teardown options.
4. Okay as we are done with creating new Junit test case just do the below editing:
package com.rhb.selenium; // package name
import junit.framework.TestCase; // auto import
import org.testng.annotations.Test; // auto import to give annotations that are necessary
public class Junit extends TestCase {
@Test
public void test1() throws Exception{
Main m = new Main(); // creating instance for Main class as "m"
m.setup(); // as setup is a method which is declared under Main class we can access it using access specifier "m"
m.Search(); // as Search is a method which is declared under Main class we can access it using access specifier "m"
}
}
Click to expand...
Click to collapse
5. To run the above JUnit Test right click on Junit.java file -> RunAs -> Junit Test
6. When you run the Junit test FireFox runs automatically in WebDriver mode as shown below and all the operations that we have specified in the Main class will be performed. Screen Shot of this is as shown below:
7. The below snap shows the test case is pass and the color is changed to Green. And also we got a msg at console as "button got clicked" what we have written in FunLib.java !!
8. The Result at FireFox WebDriver should be as shown below:
9. Okay now we will see how to execute using TestNG ( Easy one )
5a. Execution using TestNG
5a. Execution using TestNG​
1. Don't worry it is very easy compared to JUnit.
2. I hope you have installed the plugin of TestNG to your Eclipse.
3. Lets Create a new java class with name TestNGSuite1. Copy paste the below code after creation:
package com.rhb.selenium;
import java.io.FileNotFoundException;
import java.io.IOException;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.testng.annotations.Test;
public class TestNGSuite1 {
@Test
public void testngtest() throws FileNotFoundException, InvalidFormatException, IOException, Exception {
Main m = new Main(); // instance of Main class
m.setup(); // call for setup method
m.Search(); // call for Search method
}
}
Click to expand...
Click to collapse
3. Right click on TestNGSuite1.java file -> TestNG -> Convert to TestNG as shown in below screen shot:
4. Now you will see as below Screen Shot, here TestNG is converting our java file to executable xml format.
5. Now click on Finish button and you will see a Testing.xml file as shown below:
6. Now Just right click on the xml file -> RunAs -> TestNG Suite as shown below:
7. Finally you will see the final result as below:
6. DataDriven Testing using POI jar files and TestNG XSLT + ANT
6. DataDriven Testing using POI jar files​
1.We go for data driven testing when we have some modules that need to be tested for multiple values. For example in a application which has a login page with username and password field we have to test these edit text boxes for multiple inputs, It can be a number or it also can be a string or both together.
2. Here I will take Google.com as example and show you how to extract data from a excel file and push the same to Google website.
3. First we will create an excel file with some data present in it to test our application. (An Excel file for testing our app is attached here)
4. To extract data from Excel we use “FileInputStream” Class by which we can create/delete and modify a file.
5. Now add POI.jar files to Java Build Path same as how we added Selenium Jar file.
6. After adding of POI jar files to Java Build Path you will see them added as shown below:
7. After this is done we will create a new java class and will give the name as "DataDriveTest" and extend it from "TestWebDriver" Class.
8. Now what we will do is we will open google.com enter "search" value as "RHBROMS" ( 1st value from the excel sheet ) click on the first link and then we will click on back button of the browser and then we will clear the search box and enter "xda developers" ( 2nd value from the excel sheet ) and click on first link that will be xda developers website.
9. The code for this is as written below with explanation.
package com.rhb.selenium;
// below package imports are for File I/O operations
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
// below packages are for excel sheet operations
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.openqa.selenium.By;
public class DataDriveTest extends TestWebDriver {
public static void test() throws Exception, IOException,
FileNotFoundException,InvalidFormatException {
String cellval1 = null; // set the current value of cellval1 as NULL
String cellval2 = null; // set the current value of cellval2 as NULL
FileInputStream fis= new FileInputStream("E:\\Test.xls");
Workbook wb = WorkbookFactory.create(fis); // creates object for workbook Test.xls
Sheet ws = wb.getSheet("Sheet1"); // opens Sheet1 from workbook Test.xls
int rc = ws.getLastRowNum(); // counts the number of rows which are used
for(int i=1; i<=rc; i++)
{
Row r = ws.getRow(i); // ponts to the i'th ROW
for (int j=0;j==0;j++){
{
Cell c = r.getCell(j); // points to the j'th Column
cellval1=c.getStringCellValue(); // gets the data from J'th cell
Cell c1 = r.getCell(j+1); // ponts to the J+1'th column
cellval2=c1.getStringCellValue(); // gets the data from J+1'th cell
driver.findElement(By.xpath("//div[@id='hplogo']")).click(); // Clicks on the google logo
driver.findElement(By.xpath("//input[@name='q']")).sendKeys(cellval1); // take the first value from first column and paste it at the search box
driver.findElement(By.xpath("//button[@id='gbqfb']")).click(); // clicks on the search button
Thread.sleep(3000); // sleeps for 3000milisecs
driver.findElement(By.xpath("//li[1]/div/div/h3/a")).click(); // clicks on first link
driver.navigate().back(); // clicks on the back button of the browser
driver.findElement(By.xpath("//input[@name='q']")).clear(); // clears the search box
driver.findElement(By.xpath("//input[@name='q']")).sendKeys(cellval2); // enters the second value from the excel sheet
driver.findElement(By.xpath("//button[@id='gbqfb']")).click(); // clicks on the search button again
Thread.sleep(3000);
driver.findElement(By.xpath("//li[1]/div/div/h3/a")).click(); // clicks on the first link
}
}
}
}
}
Click to expand...
Click to collapse
10. Now to execute this we have to do some editing at Main.java file as:
Code:
public class Main extends DataDriveTest {
public static void main(String args[]) throws FileNotFoundException, InvalidFormatException, IOException, Exception{
setup();
test();
}
11. And also in TestNGSuit1.java file as:
Code:
@Test
public void testngtest() throws FileNotFoundException, InvalidFormatException, IOException, Exception {
Main m = new Main();
m.setup();
m.test();
}
12. Now as usual convert the TestNGSuit1 file to TestNG and execute. :victory:
13. To see your TestNG results go to your eclipse workspace and open selenium project inside that you will find test-output folder. As shown in below Screen Shot:
14. For Generation of Graphical and more clean Results we use TestNG xslt with ANT. lets see how to do it in Next Chapter :laugh::laugh:
6. TestNG xslt with ANT ​
1. Download Ant from here: http://ant.apache.org/
2. Unzip it and rename the folder as ant.
3. Set ANT_HOME to environmental variables.( In windows 7 Right click on Computer -> properties -> “Advance system setting”
-> Choose Advanced Tab
-> Press Environment Variables Button
-> In the System Variables, click New Button
Give the Variable Name:ANT_HOME
Give the Value: E:\ant
Click OK )
as shown in Below Screen Shot.
4. Set ANT_HOME path,
go to path
Give the Value C:\ANT\bin
Click OK
5. To check ANT works properly or not
In the command prompt, type:
Code:
ant -version
you will see as below Screen Shot:
6. Now download testng-xslt from HERE
7. After this extract the downloaded zip file and go to testNG-xslt -> src -> main -> resources and copy the file testng-results.xsl and also copy this file from testNG-xslt -> lib that is saxon-8.7.jar and keep them at any folder for time being.
8. Now go to your project workspace and goto SeleniumTest -> test-output and paste testing-results.xsl that you copied.
9. and now goto eclipse and add saxon-8.7.jar to buildpath.
NOTE: the thing is you have to keep all your jar files in a same folder as I have kept at jar folder as shown below in my setup:
10. Now after doing all this create new xml file and call it as Build.xml
11. After creating this just copy paste the below code:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<project name="SeleniumTest" default="compile" basedir=".">
<path id="cp">
<pathelement path="bin" />
<fileset dir="jars"/>
</path>
<!-- for compiling -->
<target name="compile">
<javac classpathref="cp" srcdir="src" destdir="bin"/>
</target>
<!-- for running -->
<target name="run" depends="compile">
<java classpathref="cp" classname="org.testng.TestNG" args="testng.xml"/>
</target>
<!-- for report generation -->
<target name="report" depends="run">
<xslt in="./test-output/testng-results.xml" style="./test-output/testng-results.xsl" out="./test-output/testng-xslt.html">
<param expression="${basedir}/test-output/" name="testNgXslt.outputDir" />
<classpath refid="cp"/>
</xslt>
</target>
</project>
12. After this save the file.
13. Now right click on the project and do as below and select TestNG:
14. Now Run the Build.xml file. and your results will be stored at Index.html at test-output folder.
To be continued .. NEXT will be Maven with TestNG!!
Excellent..
This tutorial helps in starting up with Selenium with all the configuration.
Thanks
Swaroop Bandagadde said:
This tutorial helps in starting up with Selenium with all the configuration.
Click to expand...
Click to collapse
Thank you @Swaroop Bandagadde for helping me to write this Tutorial !!..:victory:

Categories

Resources