我做了一个运行php脚本的bash脚本.没有参数它工作正常但是当我添加参数(id和url)时,有一些错误:
PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/cli/conf .d/mcrypt.ini on line 1 in Unknown on line 0
Could not open input file: /var/www/dev/dbinsert/script/automatisation.php? id=1
Run Code Online (Sandbox Code Playgroud)
我像这样从bash运行php脚本:
php /var/www/dev/dbinsert/script/automatisation.php?id=19&url=http://bkjbezjnkelnkz.com
Run Code Online (Sandbox Code Playgroud) 我的应用程序使用ListView显示单元格中不同项目的应用程序.它必须有照片和名称,但它恰好有描述和图标.
问题是:当我滚动ListView并回到顶部时,描述和图标已经消失,只有图像和名称.我的印象是描述和图标已被删除,每行的大小相同.
我(BaseAdapter)为我使用自定义适配器ListView:
public class MyAdapterPark extends BaseAdapter {
private ArrayList<DataPark> datapark;
private LayoutInflater myInflater;
public MyAdapterPark (Context context, ArrayList<DataPark> _datapark)
{
this.myInflater = LayoutInflater.from(context);
this.datapark = _datapark;
}
@Override
public int getCount() {
return this.datapark.size();
}
@Override
public Object getItem(int arg0) {
return this.datapark.get(arg0);
}
@Override
public long getItemId(int position) {
return position;
}
public static class ViewHolder {
ImageView image;
TextView text01;
ImageView facebook;
ImageView twitter;
ImageView linkedin;
ImageView blog; …Run Code Online (Sandbox Code Playgroud) 我想在webview完全加载时显示一个toast.但吐司永远不会出现,我不知道为什么......我的代码是:
public class WebViewSignUp extends Activity{
WebView mWebView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.webviewsignup);
mWebView = (WebView) findViewById(R.id.webview);
mWebView.getSettings().setJavaScriptEnabled(true);
((TextView)findViewById(R.id.home)).setOnClickListener(new OnClickListener(){
public void onClick(View v) {
finish();
}
});
mWebView.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(mWebView, url);
Toast.makeText(getApplicationContext(), "Done!", Toast.LENGTH_SHORT).show();
}
});
mWebView.loadUrl("http://pabebbe.com/m/register");
mWebView.setWebViewClient(new WebViewClient() {
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
Toast.makeText(getApplicationContext(), "Oh no! " + description, Toast.LENGTH_SHORT).show();
}
});
}
}
Run Code Online (Sandbox Code Playgroud) 在我的Android应用程序中,我在ListView中显示一些用户.我想显示(用户的pic,first_name,last_name).现在,它只适用于first_name和last_name.我想添加图片.我从服务器(python)收到的数据JSON是这样的:
[{"profil":"first_name": "Jim", "last_name": "Carrey"}}, "_id": {"$oid": "4d595cda1d41c81536000000"}}, {"profil":{"first_name": "Mathieu", "last_name": "Polnari"}}, "_id": {"$oid": "4d5916581d41c80e88000000"}}, {"profil": {"first_name": "Vincent", "last_name": "Fatou"}}, "_id": {"$oid": "4d58fc7e1d41c8090e000000"}}...]
Run Code Online (Sandbox Code Playgroud)
如果我在图片的JSON中添加一个参数应该会更好.
您是否认为将图片作为字符串返回JSON并使用Base64进行解码是个好主意?
我的应用运行地理定位服务,用户可以通过toggleButton激活或停用.要检查服务的状态,我在共享首选项中写了一个布尔值.由于我的服务的onDestroy(),我听服务的开始和结束.
我的问题是:当用户使用"高级任务杀手"杀死服务时,我不知道服务被杀死了,onDestroy没有被调用!
我该怎么处理?
谢谢你的帮助.
弗洛朗
我想在Url中传递一个参数(更新我的URL包含的许多参数之一),如下所示:
httpGet.setURI(new URI(url/user?"nickname"="John")
Run Code Online (Sandbox Code Playgroud)
Python中的ServerSide:
class GetInfo(BaseHandler):
def Get(self):
nickname = self.get_argument("nickname")
gender = self.get_argument("gender")
logging.info(nickname)
logging.info(gender)
application = tornado.web.Application([
(r"/", MainHandler),
(r"/user", GetInfo),
])
Run Code Online (Sandbox Code Playgroud)
服务器告诉我,我不能这样做,因为缺少参数"性别".我能怎么做?
谢谢
我可以从我的Android应用程序轻松打开facebook和twitter配置文件,如下所示:
if (facebookId != null)
{
try
{
long longFacebookid = Long.parseLong(facebookId);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setClassName("com.facebook.katana", "com.facebook.katana.ProfileTabHostActivity");
intent.putExtra("extra_user_id", longFacebookid);
startActivity(intent);
return;
}
catch (ActivityNotFoundException e)
{
e.printStackTrace();
}
catch (NumberFormatException e)
{
e.printStackTrace();
}
}
Run Code Online (Sandbox Code Playgroud)
但我不知道如何打开linkedin应用程序?有人知道Linkedin的类名吗?
多谢你们!
我使用twitter API搜索所有公共推文"4sq.com":
所以我在Foursquare上获得了实际在Twitter上分享的所有登机手续.
{"created_at":"Sun, 08 Jan 2012 20:05:27 +0000","from_user":"fenavergara","from_user_id":50876086,"from_user_id_str":"50876086","from_user_name":"Fernanda Vergara Ch","geo":null,"id":156104246239051776,"id_str":"156104246239051776","iso_language_code":"lt","metadata":{"result_type":"recent"},"profile_image_url":"http://a2.twimg.com/profile_images/1708744785/image_normal.jpg","profile_image_url_https":"https://si0.twimg.com/profile_images/1708744785/image_normal.jpg","source":"<a href="http://foursquare.com" rel="nofollow">foursquare</a>","text":"I'm at Roca Roja (Antofagasta) http://t.co/DIKdYGwD","to_user":null,"to_user_id":null,"to_user_id_str":null,"to_user_name":null},{"created_at":"Sun, 08 Jan 2012 20:05:27 +0000","from_user":"Fabioland76","from_user_id":357326176,"from_user_id_str":"357326176","from_user_name":"Fabio Landini","geo":null,"id":156104246104821760,"id_str":"156104246104821760","iso_language_code":"no","metadata":{"result_type":"recent"},"profile_image_url":"http://a3.twimg.com/profile_images/1506958638/profiloJPG_normal.jpg","profile_image_url_https":"https://si0.twimg.com/profile_images/1506958638/profiloJPG_normal.jpg","source":"<a href="http://foursquare.com" rel="nofollow">foursquare</a>","text":"I'm at Burger King (Gallerie Cantoni, Legnano) http://t.co/rU1jIJ4A","to_user":null,"to_user_id":null,"to_user_id_str":null,"to_user_name":null}
Run Code Online (Sandbox Code Playgroud)
通过这些推文,Foursquare提供了一个链接(如下所示:http: //t.co/DIKdYGwD),我可以在地图上看到办理登机手续的位置(如果我在网页上显示链接).
如何直接从推文列表中以编程方式获取经度和纬度?
想法:我是否需要获取网页上的链接并进行分析以获得经度和纬度?
编辑:我不想使用Twitter地理编码
这个mysql命令行返回我:count(*)19.对我来说这是一个很大的问题,因为我只想要19用这个数字做一个循环.我能怎么做?
var = $(echo "select count(*) from shop_tab where catalog <> '';" | mysql -h abcdcef.com --port=3306 --user=root --password=hbbfe shop)
Run Code Online (Sandbox Code Playgroud) 我想更改选项卡的背景.我在最近两天尝试了所有内容,所以我决定在这里发布我的代码.ActionBar的背景设置正确,但TABS保持黑色.
<style name="CustomActivityTheme" parent="Theme.Sherlock">
<item name="android:actionBarStyle">@style/MyActionBar</item>
<item name="android:actionBarTabStyle">@style/MyActionBarTabStyle</item>
<!-- other activity and action bar styles here -->
</style>
<!-- style for the action bar backgrounds -->
<style name="MyActionBar" parent="Widget.Sherlock.ActionBar">
<item name="android:background">@drawable/backgroundactionbar</item>
</style>
<style name="MyActionBarTabStyle" parent="Widget.Sherlock.ActionBar.TabView">
<item name="android:background">@drawable/backgroundactionbar</item>
</style>
Run Code Online (Sandbox Code Playgroud)
在清单上:
<activity android:name=".FragmentActivityDashboard"
android:label="@string/app_name"
android:configChanges="keyboardHidden|orientation|screenLayout"
android:theme="@style/CustomActivityTheme"
>
</activity>
Run Code Online (Sandbox Code Playgroud) tabs android android-fragments actionbarsherlock android-actionbar
我正在研究ViewPager项目,但我无法从Jake Wharton导入库:https://github.com/JakeWharton/Android-ViewPagerIndicator
我知道我需要将此代码添加到build.gradle:
repositories {
maven { url "http://dl.bintray.com/populov/maven" }
mavenCentral()
}
Run Code Online (Sandbox Code Playgroud)
和
dependencies {
// ...
compile 'com.viewpagerindicator:library:2.4.1@aar'
// ...
}
Run Code Online (Sandbox Code Playgroud)
但是当我构建gradle时出现错误:
Gradle 'ViewPager' project refresh failed: Artifact 'com.viewpagerindicator:library:2.4.1:library.aar' not found
Run Code Online (Sandbox Code Playgroud)
这是我的完整成绩:
apply plugin: 'android'
repositories {
mavenCentral()
maven { url 'http://dl.bintray.com/populov/maven' }
}
android {
compileSdkVersion 19
buildToolsVersion "19.0.3"
defaultConfig {
minSdkVersion 14
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile …Run Code Online (Sandbox Code Playgroud) android gradle android-viewpager viewpagerindicator android-gradle-plugin
我想使用这个库为我的应用程序制作一些ActionBar:https://github.com/johannilsson/android-actionbar但我不知道如何在我的android项目中导入它.没有jar文件.我能怎么做?
弗洛
android ×9
bash ×2
geolocation ×2
listview ×2
python ×2
shell ×2
api ×1
base64 ×1
foursquare ×1
gradle ×1
http-get ×1
http-post ×1
image ×1
json ×1
kill ×1
layout ×1
linkedin ×1
load ×1
mysql ×1
ondestroy ×1
parameters ×1
php ×1
return-value ×1
scrollview ×1
tabs ×1
task ×1
toast ×1
tornado ×1
twitter ×1
webview ×1
xml ×1