天道酬勤,学无止境

android

How to set my toolbar fixed while scrolling android

I am currently working in e-commerce android app, i need to fix the toolbar while scrolling. As i attached the screenshot below. while scrolling the action bar need to be fixed and the body content scroll behind the toolbar Here is the layout xml: <LinearLayout android:id="@+id/container_toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <include android:id="@+id/toolbar_reg" layout="@layout/app_bar" /> </LinearLayout> <ScrollView android:layout_width="match_parent" android:layout_height="match_parent" android:elevation="3dp">

2022-01-19 12:00:14    分类:问答    android   android-actionbar   android-toolbar

Why is AndroidAsync disconnect time so long?

I'm using the AndroidAsync koush low level network protocol library. I am connecting to a server with WebSocket. I am able to connect, send/receive messages, and disconnect. My disconnect time is very long. Server does not detect the disconnect for on average 59 seconds. In order to reproduce the problem, I connect WebSocket, authorize, and start pinging every 10 seconds. Then I turn on Airplane Mode and my network connection drops. At this time the setClosedCallback method is called. Here is how I am logging this message: private WebSocket mConnection; private WebSocketConnectCallback

2022-01-19 02:41:28    分类:问答    android   websocket   androidasync-koush

Recording Videos in Chunks Using Media Recorder Android

I am implementing an Application that includes the functionality of saving Recorded Video in to Different Video Files based on a certain amount of Time. For Achieving that i have implemented a Custom Camera and used the MediaRecorder.stop() and MediaRecorder.start() in a certain Loop. But this approach is creating a Lag Effect while restarting Media Recorder (Stop and Start). Is it possible to seamlessly Stop and Start Recording using Media Recorder or any Third Party Library ? Any help is Highly Appreciated.

2022-01-19 02:41:06    分类:问答    android   mediarecorder   android-mediarecorder   video-recording

How to add a Footer View (TextView) to the end of a ListView?

i am trying to make a layout like this: actionbar ==================== txtViewTitle -------------------- listview item1 listview item2 listview item3 ........scroll scroll scroll ...at the end of all the items: ----------------- txtViewFooter ================== linearlayout of buttons [always visible at the bottom] ------------------------------- the part between the ==========s should be scrollable here's my code, it works except for txtViewFooter which is displayed if the list is short enough to accomodate in part of the screen. but not displayed if list is longer and requores scroling

2022-01-19 02:37:41    分类:问答    android   android-layout   android-listview

Facebook: sharing a Play Store link using the Share Dialog

I share a link using the share dialog from the Facebook Android SDK. My code looks like this: FacebookDialog shareDialog = new FacebookDialog.ShareDialogBuilder(this) .setName("My app name") .setCaption("A caption") .setDescription("My description...") .setLink("https://play.google.com/store/apps/details?id=com.company.myapp") .setPicture("http://link_to_picture") .build(); As I want users to be redirected to my app's Play Store page, I put this url in the link. But in that case, the post doesn't show the information I specified (name, caption, description). Instead, it shows the app name

2022-01-19 02:35:36    分类:问答    android   facebook   facebook-android-sdk

Unrecoverable error. mremap(): failed: Out of memory in io_realm_internal_SharedGroup.cpp line 188

I have implemented Realm as my DB, and in my app I run a service on the phone contacts for checking any change in my phonebook. The service works for like 3 to 4 changes and then the app crashes with this error in my logcat. Unrecoverable error. mremap(): failed: Out of memory in io_realm_internal_SharedGroup.cpp line 188 Here's my code: public static void refreshingContactsDB() { createCountryDetailsArrayModel(); TelephonyManager tm = (TelephonyManager) ApplicationController.getInstance() .getSystemService(Context.TELEPHONY_SERVICE); String simCountryISO = tm.getSimCountryIso(); for (int i =

2022-01-19 02:35:08    分类:问答    android   realm

Java / Android package name for example code

Is there a legitimate 'generic' package name I can use to open-source some demo code? I want to provide the source of a demo Android app as 'public-domain' via Google Code or wherever but I'd like the source package to be 'generic'. In other words, I do have a registered domain which I normally use for package naming but I'd rather not have that for demo code. I sometimes see example code packages using com.example.some.package (for example) but that's a registered domain name. Is there any common accepted way of naming a generic package which doesn't use someone's registered domain?

2022-01-19 02:34:40    分类:问答    java   android

How to obtain Firmware version of Android programmatically?

The following screenshot of a generic tablet shows an example of Firmware version: We have tried pretty much everything of Android Build, none of them is the firmware version.

2022-01-19 02:32:22    分类:问答    android   version   android-build   android-firmware

How to scale a MapView from Pixels to Meters

I'm making an Android application which uses Google Maps API, and I want to scale a MapView to X_pixels:X_meters. For example, 5 pixels of the MapView in my screen, 20 meters on reality. Is that possible? Thx

2022-01-19 02:31:40    分类:问答    android   google-maps   android-mapview   scale

youtube video not showing in webView

I am new to android. Can anyone please tell how to play youtube video. My requirement is the video should display in the 'WebView' initially and on tapping that, the video should get played. webView = (WebView)findViewById(R.id.webView1); WebSettings websets = webView.getSettings(); websets.setJavaScriptEnabled(true); registerForContextMenu(webView); webView.loadUrl("file:///android_asset/youtubes.html");

2022-01-19 02:28:10    分类:问答    android   video   webview