integrating ZXing barcode reader in symbian - camera

I am trying to integrating ZXing barcode in my symbian application but i its working
only in the UI class but i want to integrate in listbox view so that when i click
list item Zxing has to open. is this possible?
anybody have idea on this?

Do you just want to open zxing camera view when clicking listbox item?
Then you need to catch listbox event
void CCasesContainer::HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType) {
if ((aEventType == MEikListBoxObserver::EEventEnterKeyPressed)
|| (aEventType == MEikListBoxObserver::EEventItemClicked)) {
TInt currentItem(iListBox->CurrentItemIndex());
// open the zxing view smth like
DeactivateActiveViewL();
CAknViewAppUi::ActivateLocalViewL(TUid::Uid(zxingView));
}
}
To learn more how views work in symbian start from here or there

Related

Windows Phone Back Button VB

I have been trying to get the back button to work for windows phone using vb, however I cant find anything on the internet, anything I do find is for c#
Can someone please tell me how I can make the back button go to the previous page as every time the back button is pressed it quits out of the app.
thanks
I'm not good at VB so, I'll make it in C# and consider to do it in your way in VB
In the Constructor of a page, write this code :
Windows.Phone.UI.Input.HardwareButtons.BackPressed += HardwareButtons_BackPressed;
In the Page's class, write this :
void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
{
if (this.Frame.CanGoBack)
{
this.Frame.GoBack();
}
else
{
Application.Current.Exit();
}
}
Consider to write it in all pages.

how to click on action bar menu items in test app that having only apk using robotium

I am testing APK file. I dont have source code. I need to click on the action bar menu item
I have tried solo.clickonActionbaritems option and it did not work. Please help me. Many thanks!
I guess you want to click on Android Menu button:
Find your keycode here
solo.sendKey(KeyEvent.KEYCODE_MENU);
Also I highly recommend to use Hierarchy viewer in DDMS to find id of required button.
View requiredButton = getViewById(id.reqired_button_id);
solo.clickOnView(requiredButton);
// Method returns view
protected View getViewById(int id) {
View view = solo.getView(id);
assertNotNull("View is null", view);
assertTrue("View is not shown", view.isShown());
return view;
}
Also you can use clickOnText.

I can't redraw my CEikRichTextEditor control in Symbian

I'm using code below to drag CEikRichTextEditor contents up and down (Scroll) on touch screen devices but the problem is that when I drag the scroll-bar itself (up or down), and then start dragging again (inside the control), the scroll-bar still in its place with no update:
void CAIBookDescribtion::HandlePointerEventL(const TPointerEvent& aPointerEvent)
{
static TInt firstpoint;
if(aPointerEvent.iType == TPointerEvent::EButton1Down)
{
firstpoint = aPointerEvent.iPosition.iY;
}
if(aPointerEvent.iType == TPointerEvent::EDrag)
{
if(aPointerEvent.iPosition.iY > firstpoint)
{
iRichText1->TextView()->ScrollDisplayL(TCursorPosition::EFLineUp);
iRichText1->UpdateScrollBarsL();
DrawNow();
iRichText1->DrawNow();
}
else
{
iRichText1->TextView()->ScrollDisplayL(TCursorPosition::EFLineDown);
iRichText1->UpdateScrollBarsL();
DrawNow();
iRichText1->DrawNow();
}
}
}
So how can I refresh (Redraw) the control and its scroll-bar to reflect its contents?
I'm using Symbian C++, S60 5th Ed SDK, Carbide.C++ 2.7, Testing on Nokia E7 (Symbian Anna)
I created the CEikRichTextEditor control using Carbide.C++ 2.7 UI controls.
Best Regards.
Try using the scrollbar frame:
iRichText1->ScrollBarFrame()->DrawScrollBarsNow()
CEikScrollBarFrame, Nokia SDK

How can I interact with "iPad keyboard hiding button" programmatically?

There is a button at bottom right of iPad keyboard which is to hide the keypad.
How can I interact with it programmatically? (get the button then send UIControlEventTouchUpInside to it).
Does anyone know this?
[Edit]
In my case, the keyboard is shown on a modal view.
Overriding disablesAutomaticKeyboardDismissal to return NO as below allows you to dismiss the keyboard when you resignFirstResponder, even when your UITextView is on a modal view. You should put this code to your view controller, from which you initiate the keyboard:
- (BOOL)disablesAutomaticKeyboardDismissal {
return NO;
}
Source: https://stackoverflow.com/a/6268520
In general, you would send the resignFirsResponder message to the active input view.
Something like this? I can't remember where I found this code but I used it to toggle the on-screen keyboard because it would be hidden by default if a bluetooth one was connected.
- (void) toggleKeyboard(UIKeyboardImpl * keyImpl){
if (UIKeyboardAutomaticIsOnScreen()) {
UIKeyboardOrderOutAutomatic();
} else {
UIKeyboardOrderInAutomatic();
}
Edit
I found where I got this code from. It works fine but the catch is that you need to import the private framework GraphicsServices, which would most likely get your app rejected from the App store.

how to use a flash movie as a background image of a vb.net form

I want to put a flash movie in my vb.net form as a form background. i want controls like buttons and labels on top of that flash movie. If this is possible then please provide a step by step answer. Thank you
If you have flash installed.
Right click on the visual studio toolbox > choose items .. when the dialog appears click on the COM components tab and scroll till you find the "Shockwave Flash Object" , tick the checkbox to add it to your toolbox.
Drag the control from your toolbox to your form ... set its "Movie" property to absolute url of your flash swf file.
you can now drop controls on top of the shockwave flash control (your flash movie host).
You might need to drag the control to fill up the available form size.
To disable the flash menu you could put a Panel above the Shockwave Flash Object and make the panel transparent ... but the usual way won't work properly.
Code below is gotten from this link
public class TransparentPanel : Panel
{
public TransparentPanel()
{
}
protected override CreateParams CreateParams
{
get
{
CreateParams createParams = base.CreateParams;
createParams.ExStyle |= 0x00000020; // WS_EX_TRANSPARENT
return createParams;
}
}
protected override void OnPaintBackground(PaintEventArgs e)
{
// Do not paint background.
}
}
Add that to your project and make the panel you add an instance of this class you'll get a transparent overlay on the shockwave flash object that disables the right click on any other mouse events.
Hope this helps.