w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
how to record video of current screen activity programmatically in android
There are no APIs yet in Android to do this directly. However, you could take screenshots of the app, and then merge them to make a video out of the images. However, this process is quite tedious, and would probably take a lot of research and investigation. Since you know how to take screenshots, a good starting point would be to look for libraries/APIs that can take in a series of images, and convert them into a video. ffmpeg/JMF could be two good starting points.

Categories : Android

android - unload ImageView image from memeory when it goes off screen inside ScrollView
An easier approach would be to just have the bitmaps themselves load and unload on demand. I say "easier" because Android has built-in support for this. Resources r = getResources(); BitmapFactory.Options options = new BitmapFactory.Options(); options.inPurgeable = true; options.inInputShareable = true; imageView1.setImageBitmap(BitmapFactory.decodeResource(r, R.drawable.image1, options); imageView2.setImageBitmap(BitmapFactory.decodeResource(r, R.drawable.image2, options); The magic here is in the inPurgeable and inInputShareable options. When these options are used, Android allocates the bitmap on a special heap where it can be quickly discarded under memory pressure, and Android will automatically re-decode a purged bitmap when it needs to be displayed again.

Categories : Java

android how to drag a hidden view/fragment from the screen left side inside my app
Try using standard Google libraries like Navigation Drawer or ViewDragHelper. As it seems you're trying to replicate the exact same pattern / behaviour.

Categories : Android

how to position Views on an Android screen relative to the screen edges using offsets in terms of pixel position on the screen coordinates?
You can put a margin to your element to move it away from the edge. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" <!-- move it to the top left corner --> android:layout_alignParentLeft="true" <!-- move it to the top left corner --> android:layout_marginTop="10dp" <!-- move it 10dp down --> android:layout_marginLeft="10dp" <!-- move it 10dp right --> android:text="@string/hello_world" /> </RelativeLayout>

Categories : Android

How to make 2 images views each be sized to cover screen inside a linear layout inside a horizontal scrollview
I'd be inclined to use a viewpager with a custom page adapter showing your scaled imageview instead of trying to do it in way you are currently. The view pager / adapter would handle view recyling, page snapping etc for you.

Categories : Android

How to record device screen video using iOS sdk?
I got a sample app from iOS Developer Library. AVSimpleEditor. Along with the video recording it can trim, rotate, crop and add music. Description: AVSimpleEditor is a simple AVFoundation based movie editing application which exercises the APIs of AVVideoComposition, AVAudioMix and demonstrates how they can be used for simple video editing tasks. It also demonstrates how they interact with playback (AVPlayerItem) and export (AVAssetExportSession). The application performs trim, rotate, crop, add music, add watermark and export.

Categories : IOS

How to record video without taking up the whole screen
Try using the UIContainerView. It allows one UIViewController and its views to be displayed in a container of your desired size. Similar to a UITabBarController, which displays its child view controllers in a specified part of the screen, not the whole screen. For examples and documentation, check out Apple's (hopefully secure) Developer site. http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/CreatingCustomContainerViewControllers/CreatingCustomContainerViewControllers.html

Categories : Iphone

How to use media Queries for android devices with android version 2.2.1 and 2.3.5 and their screen size of 240 * 320 and screen size of 480 * 800?
These are few possiblities why your media query is not working. 1.When you used media query css did you remove your normal css? or you kept both ? if you want to have both, then you need to keep them appropriately else normal css will over write the one inside mediaquery. For example if your css is like this ... @media only screen and (max-width: 241px) { .container { width:180px; height:150px; margin-left:10px; margin-right:10px; background-color:#CCCCCC; border-radius:20px; box-shadow: 10px 10px 5px #888888; padding:10px; ; } } .container { width:180px; height:150px; margin-left:10px; margin-right:10px; background-color:#CCCCCC; border-radius:20px; box-shadow: 10px 10px 5px #888888; padding:10px; ; } The .container style which is outside the media query will overw

Categories : Android

How to create videoview like youtube "small screen and full screen play in android "
You have to override setAnchorView in your new java class which extend the Android's MediaController (android.widget.MediaController) and add an extra view/button to the controller. And do something like this @Override public void setAnchorView(View view) { super.setAnchorView(view); Button fullScreen = new Button(context); fullScreen.setText("FullScreen"); FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); params.gravity = Gravity.RIGHT|Gravity.TOP; addView(fullScreen, params); } now add clicklister to view

Categories : Android

Phonegap (Android Build) - Intermediate Screen before Splash Screen
Does your app eventually show or does it just stay blank? Cant really tell what is going on but a quick something came to mind. Are you using a splash screen? Take a look at the config.xml docs at the section about splash screen duration (Android only). The docs can be found here. Splash Screen Duration splash-screen-duration with a value in milliseconds defaults to 5000 (5 seconds) example: <preference name="splash-screen-duration" value="10000" /> for auto-hide behaviour call navigator.splashscreen.hide(); in the device-ready method supported on PhoneGap 2.1.0 and above Try setting the duration to 0 (<preference name="splash-screen-duration" value="0" />) and see what happens. *On second thought, it probably isn't a splash screen issue but worth a shot. Post some code

Categories : Android

screen shot of a specific screen area in android
is there any way to capture a specific area of a screen or view Capture something larger, then cut out the "specific area" into a separate Bitmap, probably using one of the createBitmap() methods.

Categories : Android

How to know exactly off screen size of the screen in android?
If you want the the display size in pixels you can use getSize: Display display = getWindowManager().getDefaultDisplay(); Point size = new Point(); display.getSize(size); int width = size.x; int height = size.y; If you're not in an Activity you can get the default Display via WINDOW_SERVICE: WindowManager wm = (WindowManager) ctx.getSystemService(Context.WINDOW_SERVICE); Display display = wm.getDefaultDisplay(); You can get more information here

Categories : Android

If my screen Size is 480x800 what screen size should i choose in photoshop for android UI design
For this purpose exacly they created this page. The problem here is not only the devices resolutions, but also those here: Supporting Different Screen Sizes Supporting Different Densities You will also have to take a look here and here. Designing an App is not a simple matter if you would like it to look "the same" on different devices, those are devises with different screen sizes and/or densities. EDIT: You may also like to take a look at this like here, which explains, as stated on the title "Understanding Density Independence in Android". Cheers

Categories : Android

How can I retrieve and use the ID of a record I've created inside an RSpec/Capybara test?
I think the implementation of visit is not correct. If the other implementation of create_ticket is correct and you're sure about that. You can try this: it "should display some text" do log_employee_in create_ticket visit ticket_path(Ticket.last.id) # you should be even able to get the ticket with Ticket.last page.should have_content 'Some Text' end

Categories : Database

Connect to a table inside foreach and check if a record exists
Create a class and a method for checking the lot no like below public class NewClass { public bool CheckLot(int id) { //do the logic } } you can create an instance of this class from the model itself for accessing the method CheckLot @model IEnumerable<Deltas.carga> @{ ViewBag.Title = "Cargas por Lote"; var obj=new NewClass(); } and then you can check inside the loop like below for displaying the link <td> if(obj.CheckLot(item.lot_numero)) { @Html.ActionLink(item.lot_numero, "Details", "Lote",new { id = item.lot_numero },null) } </td> Hope this helps

Categories : C#

Using JQuery inside repeater item for update / remove database record
ya sure, give buttons a css class and bind the click event of that button to do what you need $(dcoument).ready(function(){ $('.Update').click(function(){ // do something }); }) Easier solution is to use GridView with update panel to update without refresh the page http://www.aspsnippets.com/Articles/GridView---Add-Edit-Update-Delete-and-Paging-the-AJAX-way.aspx http://msdn.microsoft.com/en-us/library/bb386452%28v=vs.100%29.aspx

Categories : Asp Net

How to execute a command inside a screen session
In the bash shell you can use ctrl-V to explicitly put non-printable characters into a string. So try ctrl-V ctrl-L ctrl-V ctrl-M at the end of your command just before the ".

Categories : Linux

How to show a preview of screen saver inside WPF window
You need to use Windows.Forms interop, because screen savers expect windows handles (HWND) and in WPF, only top-level windows have them. MainWindow.xaml <Window x:Class="So18547663WpfScreenSaverPreview.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:forms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms" Title="Screen Saver Preview" Height="350" Width="525" Loaded="MainWindow_OnLoaded" Closed="MainWindow_OnClosed" SizeToContent="WidthAndHeight"> <StackPanel Orientation="Vertical" Margin="8"> <TextBlock Text="Preview"/> <WindowsFormsHost x:Name="host" Width="320" Height="240"> <

Categories : C#

To avoid screen-reader text inside the button
This markup is announced at 'Hai button' in Voiceover OSX 10.8.4, ChromeVox 1.29.1, and JAWS 14. <button aria-label='Hai'> <span aria-hidden='true'>firstbutton</span> </button>`

Categories : Google Chrome

AsynTask inside service: dealing with Screen Orientation
If you use a bound service keep in mind, that the Service will be destroyed if no Activity is bound. I don't know if you unbind in onPause(), but this would destroy your Service at an orientation change. Because of this you will loose the Service and the reference to the AsyncTask. Furthermore there is no onRetainInstanceState() available for a Service, to save the AsyncTask and grab it again. Think about an IntentService in this case it would be the proper way. Or if you wanna keep the Service use startService(), to keep it alive while no Activity is bound. Then you can still bind and unbind from the service the way you want. The next point is to keep a reference of the AsyncTask. Because you have to set your callback again if the Activity was destroyed. Because the callback reference

Categories : Android

VideoView inside fragment causes black screen flicking
I was able to fix this by adding a 0px by 0px SurfaceView in the layout of the parent activity of the fragment: <SurfaceView android:layout_width="0px" android:layout_height="0px" />

Categories : Android

How to get the absolute screen coordinates of an element placed inside a DataTemplate
For example : xaml : <ListBox x:Name="myListBox" SelectedIndex="2"> <ListBoxItem>1</ListBoxItem> <ListBoxItem>2</ListBoxItem> <ListBoxItem>3</ListBoxItem> <ListBoxItem>4</ListBoxItem> <ListBoxItem>5</ListBoxItem> </ListBox> <Button Content="GetIndexFromContainer" Click="Button_Click" /> cs : private void Button_Click(object sender, RoutedEventArgs e) { var index = GetSelectedIndexFromList(); } private int GetSelectedIndexFromList() { var container = myListBox.ItemContainerGenerator.ContainerFromItem(MyListBox.SelectedItem); var index = myListBox.ItemContainerGenerator.IndexFromContainer(container); r

Categories : C#

Android: Customize android default navigation back button at the bottom of the screen
Which device are you using? Nexus? One solution can be.. overriding the onBackPressed() method, and making it empty..so that nothing happens on its pressing.. Like this: public void onBackPressed() {//No implementation};

Categories : Android

My Android app splash screen launches in the android emulator, but then the actual app never shows
I believe that it can't find your main activity because you have spelled the example wrong in your manifest on the line: package="com.examle.firstapp" should be: package="com.example.firstapp"

Categories : Android

Flag inside a Runnable (Android:Thread inside Service) not updating properly?
Try volatile boolean shouldPlayNext=false; Threads can keep cached copies of variables. So, in theory, a thread can keep working with an old cached copy even when the actual variable is changed. volatile keyword make the reads/writes to a variable visible to all threads.

Categories : Java

How to adjust images to all android screen devices using cocos2d android library without using xml layout for Game designing
CGSize winSize = CCDirector.sharedDirector().displaySize(); CCSprite background=CCSprite.sprite("background.png"); background.setScaleX(winSize .width/background.getTexture().getWidth()); background.setScaleY(winSize.height/background.getTexture().getHeight()); background.setPosition(CGPoint.make(winSize.width/2, winSize.height/2)); addChild(background); Set to exact , what is the screen size

Categories : Android

How can ı make Layout for Small than 3" screen and Layout for 4.8" screen (android)
Android has a lot of really nice tools to help developers deal with multiple screen sizes and densities. You can read more about how it all works at this Android Developers Page.

Categories : Android

Android lock screen / media controls on the lock screen
Is it somehow possible to force the lock screen to redraw/update? Not really. Can i somehow manipulate the built-in media controls on the lock screen Can i somehow dynamically disable/unregister the appearance of the media controls on the lock screen through code? There are no "built-in media controls on the lock screen" in Android 2.3. Certain devices from certain device manufacturers may have extended their lockscreens support media controls, in which case you would have to ask your questions of those device manufacturers.

Categories : Android

Display video inside the Uiwebview not in device full screen
To play video in UIWebView use below code.... NSString *strVedio = @"<video controls> <source src="YourVideo.mp4"> </video>"; NSString *path = [[NSBundle mainBundle] pathForResource:@"YourVideo" ofType:@"mp4"]; [Webview loadHTMLString:strVedio baseURL:[NSURL fileURLWithPath:path]]; UPDATE: use this below code to display video in UIWebView from video URL... NSString *embedHTML = @" <html><head> <style type="text/css"> body { background-color: transparent; color: white; } </style> </head><body style="margin:0"> <embed id="yt" src="%@" type="application/x-shockwave-flash" width="%0.0f" height="%0.0f"></embed> </body></html>"; NSString *strHtml = [NSString stringWithFormat:embedHTML,

Categories : Iphone

jQuery solution for keeping Dropdown submenu inside screen
How about this: It checks to see if the sub menu is going to overflow and modifies it's position by the width of the sub menu so it's on the other side $('.sub-menu').parent().hover(function() { var menu = $(this).find("ul"); var menupos = $(menu).offset(); if (menupos.left + menu.width() > $(window).width()) { var newpos = -$(menu).width(); menu.css({ left: newpos }); } }); http://jsfiddle.net/svLKN/4/

Categories : Jquery

Android - can I create an HTML5 screen in a native Android app?
Yes this is possible, have a look into WebView http://developer.android.com/reference/android/webkit/WebView.html A View that displays web pages. This class is the basis upon which you can roll your own web browser or simply display some online content within your Activity. It uses the WebKit rendering engine to display web pages and includes methods to navigate forward and backward through a history, zoom in and out, perform text searches and more. You may find some performance/compatability issues but this is the easiest solution and one that I would do as a first step.

Categories : Android

How To Assign an Existing Record to Another Record in Active Record
According to your models your Host must have a student_id. It's unclear from your example, but it seems like your student_id in Host.first is not Student.last.id. Another point which was touched on a bit by @kobaltz comment is that your Post model has the host_id and student_id. This looks like you are using it as an association. So your model should probably look like this. post.rb belongs_to :host belongs_to :student student.rb has_many :posts has_many :hosts, :through => :posts host.rb has_many :posts has_many :students, :through => :posts

Categories : Ruby On Rails

ImageView inside ScrollView won't resize to fill screen(keeping aspect)
Please state the problem word by word, for the other part change all of the: android:layout_below="@+id/full_image_view" android:layout_alignBottom="@+id/onthelist_animal_date" android:layout_alignTop="@+id/onthelist_animal_date" android:layout_toRightOf="@+id/onthelist_animal_date" To: android:layout_below="@id/full_image_view" android:layout_alignBottom="@id/onthelist_animal_date" android:layout_alignTop="@id/onthelist_animal_date" android:layout_toRightOf="@id/onthelist_animal_date" E.G. - Remove the "+", this is used only for "android:id" and marks the name of the layout.

Categories : Android

iOS autolayout-move a view located inside a tableviewcell to the center of the screen
So I guess you want something like this: First, you need to know that as of Xcode 4.6.3, the nib editor (“Interface Builder”) has a bug when setting up constraints in a table view cell. It should create the constraints between the subviews and the cell's content view, but instead it creates the constraints between the subviews and the cell itself. This tends to screw up layout at runtime. (This bug is fixed in Xcode 5 and later.) The consequence of this is that you should either remove all of the constraints that were in the nib and recreate them in code, or just get rid of the nib and create the cell's entire view hierarchy in code. Second, there's an easier way to do the image zooming. Here's the basic procedure when a cell is selected: Convert the selected cell's image vi

Categories : IOS

TilePane inside Scroll Pane just occupies a small portion of the screen
The problem was not with the scrollPane or the TilePane, I was adding the scrollPane to a borderPane and i was using : border.setTop(viewGallery(Stage stage)); Just changing the above code to the below code resolved my issue.. border.setCenter(viewGallery(Stage stage)); The docs are pretty clear: The top and bottom children will be resized to their preferred heights and extend the width of the borderpane. The left and right children will be resized to their preferred widths and extend the length between the top and bottom nodes. And the center node will be resized to fill the available space in the middle

Categories : Java

How to add Android.Dialog as an Android Fragment inside an Android Activity?
This isn't supported 'out-of-the-box' in the current MvvmCross source - but it should be relatively straight-forward to merge the fragments and Activity-dialog code in order to create a working sample. The exception you list is thrown from https://github.com/slodge/MvvmCross/blob/v3/CrossUI/CrossUI.Droid/DroidResources.cs#L99 It suggests that the Setup hasn't been called - in the standard samples (e.g. N+1 video samples) this is called via https://github.com/slodge/MvvmCross/blob/v3/Cirrious/Cirrious.MvvmCross.Dialog.Droid/MvxAndroidDialogSetup.cs#L45 So this suggests you should check the setup in your code sample - are the resources being initialised?

Categories : Android

Android record and playback
Your playback is choppy because the AudioTrack is getting starved and not getting data smoothly. In your code you are recursively calling run and creating a new AudioTrack per marker. Instead, instantiate AudioRecord and AudioTrack only once and just handle their events. Also, to help smooth out playback you should probably start recording slightly before playback and maintain a queue of the recorded buffers. You can then manage passing these buffers to the AudioTrack and make sure there is always a new buffer to submit on each marker event.

Categories : Android

Playing Youtube Video from UIWebView inside UIModalPresentationPageSheet limits full screen to size of modal view
The simple answer is that you have to embed the video inside an iframe. if (self.youTubeID) { NSString *embeddedYouTubeURL = [NSString stringWithFormat:@"http://www.youtube.com/embed/%@",self.youTubeID]; //NSString *controls = @"?controls=2&autohide=1"; self.webView.opaque = NO; self.webView.backgroundColor = [UIColor blackColor]; NSString *html = [NSString stringWithFormat:@"<!DOCTYPE HTML><head></head><html><body><iframe width='%f' height='%f' src='%@' allowfullscreen></iframe></body></html>", self.webView.frame.size.width *2, self.webView.frame.size.height*2, embeddedYouTubeURL]; [self.webView loadHTMLString:html baseURL:nil]; }

Categories : Objective C

What is "activity record object" in Android?
I wrote the passage you quote here (it's from the book Brian Hardy and I wrote, Android Programming: The Big Nerd Ranch Guide). Let me see if I can answer your questions. The "activity record object" (I usually say "activity record") is not visible to you as an application developer. Instead, it lives in the Android OS, where it is used to keep track of your activity. That object is where your saved instance state is stored; it's where the intent that initially started your activity lives, where the activity results you receive are stored before they are delivered. More importantly, if the activity record is alive, it may be used to reconstitute an Activity instance in your application. The activity record object is much cheaper to keep alive than an instance of the Activity class. An Ac

Categories : Android

Pause playing record in android
Don't use .stop() to pause. In the MediaPlayer API you can see that .pause() would be the best option. If you reorganized mPlayer.setDataSource(mFileName); mPlayer.prepare(); To happen in your onCreate method you can avoid it resetting every time. Check out their diagram http://i.stack.imgur.com/svHrq.gif

Categories : Android



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.